diff --git a/backend/wordpress/wp-content/plugins/types/application/autoload_classmap.php b/backend/wordpress/wp-content/plugins/types/application/autoload_classmap.php deleted file mode 100644 index 56c66a9..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/autoload_classmap.php +++ /dev/null @@ -1,218 +0,0 @@ - dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/forms.php', -'Toolset_Filesystem_Directory' => dirname( __FILE__ ) . '/../vendor/toolset/filesystem/directory.php', -'Toolset_Filesystem_Exception' => dirname( __FILE__ ) . '/../vendor/toolset/filesystem/exception.php', -'Toolset_Filesystem_File' => dirname( __FILE__ ) . '/../vendor/toolset/filesystem/file.php', -'Types_Admin' => dirname( __FILE__ ) . '/controllers/admin.php', -'Types_Admin_Edit_Custom_Fields_Group' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.edit.custom.fields.group.php', -'Types_Admin_Edit_Fields' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.edit.fields.php', -'Types_Admin_Edit_Meta_Fields_Group' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.edit.meta.fields.group.php', -'Types_Admin_Edit_Post_Type' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.edit.post.type.php', -'Types_Admin_Edit_Taxonomy' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.edit.taxonomy.php', -'Types_Admin_Fields' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.fields.php', -'Types_Admin_Menu' => dirname( __FILE__ ) . '/controllers/admin_menu.php', -'Types_Admin_Page' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.page.php', -'Types_Admin_Post_Type' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.post-type.php', -'Types_Admin_Post_Types_List_Table' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.post.types.list.table.php', -'Types_Admin_Taxonomies' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.taxonomies.php', -'Types_Admin_Taxonomies_List_Table' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.taxonomies.list.table.php', -'Types_Admin_Usermeta_Control_Table' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.usermeta.table.php', -'Types_Admin_Usermeta_Groups_List_Table' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.admin.usermeta.groups.list.table.php', -'Types_Ajax' => dirname( __FILE__ ) . '/controllers/ajax.php', -'Types_Ajax_Handler_Abstract' => dirname( __FILE__ ) . '/controllers/ajax/handler/abstract.php', -'Types_Ajax_Handler_Check_Slug_Conflicts' => dirname( __FILE__ ) . '/controllers/ajax/handler/check_slug_conflicts.php', -'Types_Ajax_Handler_Field_Control_Action' => dirname( __FILE__ ) . '/controllers/ajax/handler/field_control_action.php', -'Types_Ajax_Handler_Interface' => dirname( __FILE__ ) . '/controllers/ajax/handler_interface.php', -'Types_Ajax_Handler_Settings_Action' => dirname( __FILE__ ) . '/controllers/ajax/handler/settings_action.php', -'Types_Api' => dirname( __FILE__ ) . '/controllers/api.php', -'Types_Api_Handler_Filter_Get_Field_Group_Ids_By_Post_Type' => dirname( __FILE__ ) . '/controllers/api/handler/filter_get_field_group_ids_by_post_type.php', -'Types_Api_Handler_Import_From_Zip_File' => dirname( __FILE__ ) . '/controllers/api/handler/import_from_zip_file.php', -'Types_Api_Handler_Interface' => dirname( __FILE__ ) . '/controllers/api/handler/interface.php', -'Types_Api_Handler_Query_Groups' => dirname( __FILE__ ) . '/controllers/api/handler/query_groups.php', -'Types_Asset_Help_Tab_Loader' => dirname( __FILE__ ) . '/controllers/asset/help_tab_loader.php', -'Types_Asset_Manager' => dirname( __FILE__ ) . '/controllers/asset/manager.php', -'Types_Assets' => dirname( __FILE__ ) . '/controllers/assets.php', -'Types_Dialog_Box' => dirname( __FILE__ ) . '/controllers/dialog_box.php', -'Types_Embedded' => dirname( __FILE__ ) . '/controllers/embedded.php', -'Types_Field_Group' => dirname( __FILE__ ) . '/models/field/group.php', -'Types_Field_Group_Factory' => dirname( __FILE__ ) . '/models/field/group/factory.php', -'Types_Field_Group_Post' => dirname( __FILE__ ) . '/models/field/group/post.php', -'Types_Field_Group_Post_Factory' => dirname( __FILE__ ) . '/models/field/group/post_factory.php', -'Types_Field_Group_Term' => dirname( __FILE__ ) . '/models/field/group/term.php', -'Types_Field_Group_Term_Factory' => dirname( __FILE__ ) . '/models/field/group/term_factory.php', -'Types_Field_Group_User' => dirname( __FILE__ ) . '/models/field/group/user.php', -'Types_Field_Group_User_Factory' => dirname( __FILE__ ) . '/models/field/group/user_factory.php', -'Types_Fields_Conditional' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.types.fields.conditional.php', -'Types_Field_Type_Converter' => dirname( __FILE__ ) . '/controllers/field/type_converter.php', -'Types_Field_Type_Definition_Checkbox' => dirname( __FILE__ ) . '/models/field/gateway/checkbox.php', -'Types_Field_Type_Definition_Checkboxes' => dirname( __FILE__ ) . '/models/field/gateway/checkboxes.php', -'Types_Field_Type_Definition_Date' => dirname( __FILE__ ) . '/models/field/gateway/date.php', -'Types_Field_Type_Definition' => dirname( __FILE__ ) . '/models/field/type/definition.php', -'Types_Field_Type_Definition_Factory' => dirname( __FILE__ ) . '/models/field/type/definition_factory.php', -'Types_Field_Type_Definition_Numeric' => dirname( __FILE__ ) . '/models/field/gateway/numeric.php', -'Types_Field_Type_Definition_Radio' => dirname( __FILE__ ) . '/models/field/gateway/radio.php', -'Types_Field_Type_Definition_Select' => dirname( __FILE__ ) . '/models/field/gateway/select.php', -'Types_Field_Type_Definition_Singular' => dirname( __FILE__ ) . '/models/field/gateway/singular.php', -'Types_Field_Utils' => dirname( __FILE__ ) . '/controllers/field/utils.php', -'Types_Frontend' => dirname( __FILE__ ) . '/controllers/frontend.php', -'Types_Helper_Condition_Archive_Exists' => dirname( __FILE__ ) . '/models/helper/condition/archive/exists.php', -'Types_Helper_Condition_Archive_Has_Fields' => dirname( __FILE__ ) . '/models/helper/condition/archive/has_fields.php', -'Types_Helper_Condition_Archive_Missing' => dirname( __FILE__ ) . '/models/helper/condition/archive/missing.php', -'Types_Helper_Condition_Archive_No_Fields' => dirname( __FILE__ ) . '/models/helper/condition/archive/no_fields.php', -'Types_Helper_Condition_Archive_No_Support' => dirname( __FILE__ ) . '/models/helper/condition/archive/no_support.php', -'Types_Helper_Condition_Archive_Support' => dirname( __FILE__ ) . '/models/helper/condition/archive/support.php', -'Types_Helper_Condition_Cred_Active' => dirname( __FILE__ ) . '/models/helper/condition/cred/active.php', -'Types_Helper_Condition_Cred_Forms_Exist' => dirname( __FILE__ ) . '/models/helper/condition/cred/forms_exist.php', -'Types_Helper_Condition_Cred_Forms_Missing' => dirname( __FILE__ ) . '/models/helper/condition/cred/forms_missing.php', -'Types_Helper_Condition_Cred_Missing' => dirname( __FILE__ ) . '/models/helper/condition/cred/missing.php', -'Types_Helper_Condition' => dirname( __FILE__ ) . '/models/helper/condition.php', -'Types_Helper_Condition_Layouts_Active' => dirname( __FILE__ ) . '/models/helper/condition/layouts/active.php', -'Types_Helper_Condition_Layouts_Archive_Exists' => dirname( __FILE__ ) . '/models/helper/condition/layouts/archive_exists.php', -'Types_Helper_Condition_Layouts_Archive_Missing' => dirname( __FILE__ ) . '/models/helper/condition/layouts/archive_missing.php', -'Types_Helper_Condition_Layouts_Compatible' => dirname( __FILE__ ) . '/models/helper/condition/layouts/compatible.php', -'Types_Helper_Condition_Layouts_Missing' => dirname( __FILE__ ) . '/models/helper/condition/layouts/missing.php', -'Types_Helper_Condition_Layouts_Template_Exists' => dirname( __FILE__ ) . '/models/helper/condition/layouts/template_exists.php', -'Types_Helper_Condition_Layouts_Template_Missing' => dirname( __FILE__ ) . '/models/helper/condition/layouts/template_missing.php', -'Types_Helper_Condition_Screen' => dirname( __FILE__ ) . '/models/helper/condition/screen.php', -'Types_Helper_Condition_Single_Exists' => dirname( __FILE__ ) . '/models/helper/condition/single/exists.php', -'Types_Helper_Condition_Single_Has_Fields' => dirname( __FILE__ ) . '/models/helper/condition/single/has_fields.php', -'Types_Helper_Condition_Single_Missing' => dirname( __FILE__ ) . '/models/helper/condition/single/missing.php', -'Types_Helper_Condition_Single_No_Fields' => dirname( __FILE__ ) . '/models/helper/condition/single/no_fields.php', -'Types_Helper_Condition_Template' => dirname( __FILE__ ) . '/models/helper/condition/template.php', -'Types_Helper_Condition_Type_Fields_Assigned' => dirname( __FILE__ ) . '/models/helper/condition/type/fields_assigned.php', -'Types_Helper_Condition_Type_No_Post_Or_Page' => dirname( __FILE__ ) . '/models/helper/condition/type/no_post_or_page.php', -'Types_Helper_Condition_Type_Post_Or_Page' => dirname( __FILE__ ) . '/models/helper/condition/type/post_or_page.php', -'Types_Helper_Condition_Views_Active' => dirname( __FILE__ ) . '/models/helper/condition/views/active.php', -'Types_Helper_Condition_Views_Archive_Exists' => dirname( __FILE__ ) . '/models/helper/condition/views/archive_exists.php', -'Types_Helper_Condition_Views_Archive_Missing' => dirname( __FILE__ ) . '/models/helper/condition/views/archive_missing.php', -'Types_Helper_Condition_Views_Missing' => dirname( __FILE__ ) . '/models/helper/condition/views/missing.php', -'Types_Helper_Condition_Views_Template_Exists' => dirname( __FILE__ ) . '/models/helper/condition/views/template_exists.php', -'Types_Helper_Condition_Views_Template_Missing' => dirname( __FILE__ ) . '/models/helper/condition/views/template_missing.php', -'Types_Helper_Condition_Views_Views_Exist' => dirname( __FILE__ ) . '/models/helper/condition/views/views_exist.php', -'Types_Helper_Condition_Views_Views_Missing' => dirname( __FILE__ ) . '/models/helper/condition/views/views_missing.php', -'Types_Helper_Create_Content_Template' => dirname( __FILE__ ) . '/models/helper/create/content_template.php', -'Types_Helper_Create_Form' => dirname( __FILE__ ) . '/models/helper/create/form.php', -'Types_Helper_Create_Layout' => dirname( __FILE__ ) . '/models/helper/create/layout.php', -'Types_Helper_Create_View' => dirname( __FILE__ ) . '/models/helper/create/view.php', -'Types_Helper_Create_Wordpress_Archive' => dirname( __FILE__ ) . '/models/helper/create/wordpress_archive.php', -'Types_Helper_Output_Interface' => dirname( __FILE__ ) . '/models/helper/output/interface.php', -'Types_Helper_Output_Meta_Box' => dirname( __FILE__ ) . '/models/helper/output/meta_box.php', -'Types_Helper_Placeholder' => dirname( __FILE__ ) . '/models/helper/placeholder.php', -'Types_Helper_Twig' => dirname( __FILE__ ) . '/models/helper/twig.php', -'Types_Helper_Url' => dirname( __FILE__ ) . '/models/helper/url.php', -'Types_Import_Export' => dirname( __FILE__ ) . '/controllers/import_export.php', -'Types_Information_Container' => dirname( __FILE__ ) . '/models/information/container.php', -'Types_Information_Controller' => dirname( __FILE__ ) . '/controllers/information/controller.php', -'Types_Information_Message' => dirname( __FILE__ ) . '/models/information/message.php', -'Types_Information_Message_Post_Type' => dirname( __FILE__ ) . '/models/information/message/post_type.php', -'Types_Information_Table' => dirname( __FILE__ ) . '/models/information/table.php', -'Types_Interop_Handler_Divi' => dirname( __FILE__ ) . '/controllers/interop/handler/divi.php', -'Types_Interop_Handler_Interface' => dirname( __FILE__ ) . '/controllers/interop/handler_interface.php', -'Types_Interop_Handler_The7' => dirname( __FILE__ ) . '/controllers/interop/handler/the7.php', -'Types_Interop_Handler_Use_Any_Font' => dirname( __FILE__ ) . '/controllers/interop/handler/use_any_font.php', -'Types_Interop_Handler_Wpml' => dirname( __FILE__ ) . '/controllers/interop/handler/wpml.php', -'Types_Interop_Mediator' => dirname( __FILE__ ) . '/controllers/interop/mediator.php', -'Types_Main' => dirname( __FILE__ ) . '/controllers/main.php', -'Types_Page_Abstract' => dirname( __FILE__ ) . '/controllers/page/abstract.php', -'Types_Page_Dashboard' => dirname( __FILE__ ) . '/controllers/page/dashboard.php', -'Types_Page_Extension_Edit_Post' => dirname( __FILE__ ) . '/controllers/page/extension/edit_post.php', -'Types_Page_Extension_Edit_Post_Fields' => dirname( __FILE__ ) . '/controllers/page/extension/edit_post_fields.php', -'Types_Page_Extension_Edit_Post_Type' => dirname( __FILE__ ) . '/controllers/page/extension/edit_post_type.php', -'Types_Page_Extension_Settings' => dirname( __FILE__ ) . '/controllers/page/extension/settings.php', -'Types_Page_Field_Control' => dirname( __FILE__ ) . '/controllers/page/field_control.php', -'Types_Page_Hidden_Helper' => dirname( __FILE__ ) . '/controllers/page/hidden/helper.php', -'Types_Post_Type' => dirname( __FILE__ ) . '/models/post_type.php', -'Types_Setting_Boolean' => dirname( __FILE__ ) . '/models/setting/boolean.php', -'Types_Setting' => dirname( __FILE__ ) . '/models/setting.php', -'Types_Setting_Interface' => dirname( __FILE__ ) . '/models/setting/interface.php', -'Types_Setting_Option' => dirname( __FILE__ ) . '/models/setting/option.php', -'Types_Setting_Option_Interface' => dirname( __FILE__ ) . '/models/setting/option/interface.php', -'Types_Setting_Preset_Information_Table' => dirname( __FILE__ ) . '/models/setting/preset/information_table.php', -'Types_Taxonomy' => dirname( __FILE__ ) . '/models/taxonomy.php', -'Types_Twig_Autoloader' => dirname( __FILE__ ) . '/controllers/twig_autoloader.php', -'Types_Upgrade' => dirname( __FILE__ ) . '/controllers/upgrade.php', -'Types_Utils' => dirname( __FILE__ ) . '/controllers/admin_notice/utils.php', -'Types_Admin_Notices_Free_Version' => dirname( __FILE__ ) . '/controllers/admin_notice/free-version.php', -'Types_Utils_Post_Type_Option' => dirname( __FILE__ ) . '/controllers/utils/post_type_option.php', -'Types_Wpml_Field_Group' => dirname( __FILE__ ) . '/models/wpml/field_group.php', -'Types_Wpml_Field_Group_String_Description' => dirname( __FILE__ ) . '/models/wpml/field/group/string/description.php', -'Types_Wpml_Field_Group_String' => dirname( __FILE__ ) . '/models/wpml/field/group/string.php', -'Types_Wpml_Field_Group_String_Name' => dirname( __FILE__ ) . '/models/wpml/field/group/string/name.php', -'Types_Wpml_Interface' => dirname( __FILE__ ) . '/models/wpml/interface.php', -'Wpcf_Cake_Validation' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/validation-cakephp.php', -'WPCF_Conditional' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/conditional.php', -'WPCF_Custom_Fields_List_Table' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.wpcf.custom.fields.list.table.php', -'WPCF_Editor' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/editor.php', -'WPCF_Evaluate' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/evaluate.php', -'WPCF_Field_Accessor_Abstract' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/accessor/abstract.php', -'WPCF_Field_Accessor_Dummy' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/accessor/dummy.php', -'WPCF_Field_Accessor_Termmeta' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/accessor/termmeta.php', -'WPCF_Field_Accessor_Termmeta_Field' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/accessor/termmeta_field.php', -'WPCF_Field_DataMapper_Abstract' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/datamapper/abstract.php', -'WPCF_Field_DataMapper_Checkbox' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/datamapper/checkbox.php', -'WPCF_Field_DataMapper_Checkboxes' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/datamapper/checkboxes.php', -'WPCF_Field_DataMapper_Identity' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/datamapper/identity.php', -'WPCF_Field_Data_Saver' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/data_saver.php', -'WPCF_Field_Definition_Abstract' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_abstract.php', -'WPCF_Field_Definition' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition.php', -'WPCF_Field_Definition_Factory' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_factory.php', -'WPCF_Field_Definition_Factory_Post' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_factory_post.php', -'WPCF_Field_Definition_Factory_Term' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_factory_term.php', -'WPCF_Field_Definition_Factory_User' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_factory_user.php', -'WPCF_Field_Definition_Generic' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_generic.php', -'WPCF_Field_Definition_Post' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_post.php', -'WPCF_Field_Definition_Term' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_term.php', -'WPCF_Field_Definition_User' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/definition_user.php', -'WPCF_Field' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field.php', -'WPCF_Field_Hooks_API' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/hooks_api.php', -'WPCF_Field_Instance_Abstract' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/instance_abstract.php', -'WPCF_Field_Instance' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/instance.php', -'WPCF_Field_Instance_Term' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/instance_term.php', -'WPCF_Field_Instance_Unsaved' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/instance_unsaved.php', -'WPCF_Field_Option_Checkboxes' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/option_checkboxes.php', -'WPCF_Field_Option_Radio' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/option_radio.php', -'WPCF_Field_Option_Select' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/option_select.php', -'WPCF_Field_Renderer_Abstract' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/abstract.php', -'WPCF_Field_Renderer_Factory' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/factory.php', -'WPCF_Field_Renderer_Preview_Address' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/address.php', -'WPCF_Field_Renderer_Preview_Base' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/base.php', -'WPCF_Field_Renderer_Preview_Checkbox' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/checkbox.php', -'WPCF_Field_Renderer_Preview_Checkboxes' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/checkboxes.php', -'WPCF_Field_Renderer_Preview_Colorpicker' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/colorpicker.php', -'WPCF_Field_Renderer_Preview_Date' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/date.php', -'WPCF_Field_Renderer_Preview_File' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/file.php', -'WPCF_Field_Renderer_Preview_Image' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/image.php', -'WPCF_Field_Renderer_Preview_Radio' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/radio.php', -'WPCF_Field_Renderer_Preview_Skype' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/skype.php', -'WPCF_Field_Renderer_Preview_Textfield' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/textfield.php', -'WPCF_Field_Renderer_Preview_URL' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/preview/url.php', -'WPCF_Field_Renderer_Toolset_Forms' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field/renderer/toolset_forms.php', -'WPCF_Fields' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/fields.php', -'WPCF_GUI_Term_Field_Editing' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/gui/term_field_editing.php', -'WPCF_Helper_Ajax' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/helper.ajax.php', -'WPCF_Import_Export' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/class.wpcf-import-export.php', -'WPCF_Loader' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/loader.php', -'WPCF_Page_Abstract' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/page/abstract.php', -'WPCF_Page_Edit_Termmeta' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/page/edit/termmeta.php', -'WPCF_Page_Edit_Termmeta_Form' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/page/edit/termmeta_form.php', -'WPCF_Page_Listing_Abstract' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/page/listing/abstract.php', -'WPCF_Page_Listing_Table' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/page/listing/table.php', -'WPCF_Page_Listing_Termmeta' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/page/listing/termmeta.php', -'WPCF_Page_Listing_Termmeta_Table' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/page/listing/termmeta_table.php', -'WPCF_Path' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/path.php', -'WPCF_Post_Types' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/class.wpcf-post-types.php', -'WPCF_Relationship_Child_Form' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/relationship/form-child.php', -'WPCF_Relationship' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/relationship.php', -'WPCF_Repeater' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/repeater.php', -'WPCF_Roles' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.wpcf.roles.php', -'WPCF_Termmeta_Field' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/field.php', -'WPCF_Termmeta_Repeater' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/repeater.php', -'WPCF_Types_Marketing' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.wpcf.marketing.php', -'WPCF_Types_Marketing_Messages' => dirname( __FILE__ ) . '/../vendor/toolset/types/includes/classes/class.wpcf.marketing.messages.php', -'WPCF_Usermeta_Field' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/usermeta_field.php', -'WPCF_Usermeta_Repeater' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/usermeta_repeater.php', -'WPCF_Validation' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/validation.php', -'WPCF_WPViews' => dirname( __FILE__ ) . '/../vendor/toolset/types/embedded/classes/wpviews.php', -); diff --git a/backend/wordpress/wp-content/plugins/types/application/bootstrap.php b/backend/wordpress/wp-content/plugins/types/application/bootstrap.php deleted file mode 100644 index 7e5d4ac..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/bootstrap.php +++ /dev/null @@ -1,63 +0,0 @@ -add_path( 'Toolset', TYPES_ABSPATH . '/vendor/toolset' ); - - -/* - * Load old Types - */ -if( ! defined( 'WPCF_RELPATH' ) ) { - define( 'WPCF_RELPATH', TYPES_RELPATH . '/vendor/toolset/types' ); -} - -if( ! defined( 'WPCF_EMBEDDED_TOOLSET_ABSPATH' ) ) { - define( 'WPCF_EMBEDDED_TOOLSET_ABSPATH', TYPES_ABSPATH . '/vendor/toolset' ); -} - -if( ! defined( 'WPCF_EMBEDDED_TOOLSET_RELPATH') ) { - define( 'WPCF_EMBEDDED_TOOLSET_RELPATH', TYPES_RELPATH . '/vendor/toolset' ); -} - -if( ! defined( 'WPTOOLSET_COMMON_PATH' ) ) { - define( 'WPTOOLSET_COMMON_PATH', TYPES_ABSPATH . '/vendor/toolset/toolset-common' ); -} - -if ( !defined( 'EDITOR_ADDON_RELPATH' ) ) { - define( 'EDITOR_ADDON_RELPATH', WPCF_EMBEDDED_TOOLSET_RELPATH . '/toolset-common/visual-editor' ); -} - -// installer -$installer = TYPES_ABSPATH . '/vendor/otgs/installer/loader.php'; -if ( file_exists( $installer ) ) { - /** @noinspection PhpIncludeInspection */ - include_once $installer; - if ( function_exists( 'WP_Installer_Setup' ) ) { - WP_Installer_Setup( - $wp_installer_instance, - array( - 'plugins_install_tab' => '1', - 'repositories_include' => array('toolset', 'wpml') - ) - ); - } -} - - -// Get new functions.php -require_once( dirname( __FILE__ ) . '/functions.php' ); - -// Initialize legacy code -require_once( dirname( __FILE__ ) . '/../vendor/toolset/types/wpcf.php' ); - -// Public API -require_once( dirname( __FILE__ ) . '/controllers/main.php' ); - -// Jumpstart new Types -Types_Main::initialize(); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/admin.php b/backend/wordpress/wp-content/plugins/types/application/controllers/admin.php deleted file mode 100644 index 2a9d141..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/admin.php +++ /dev/null @@ -1,80 +0,0 @@ -on_init(); - } - - - private function __clone() { } - - - private function on_init() { - - Types_Upgrade::initialize(); - - // Load Twig - this is a bit hacky way to do it, see Types_Twig_Autoloader class for explanation. - Types_Twig_Autoloader::register(); - - // Load menu - won't be loaded in embedded version. - if( apply_filters( 'types_register_pages', true ) ) { - Types_Admin_Menu::initialize(); - } - - $this->init_page_extensions(); - - // admin notices - Toolset_Singleton_Factory::get( 'Types_Admin_Notices_Free_Version' ); - } - - - /** - * Add hooks for loading page extensions. - * - * @since 2.1 - */ - private function init_page_extensions() { - // extensions for post edit page - add_action( 'load-post.php', array( 'Types_Page_Extension_Edit_Post', 'get_instance' ) ); - - // extension for post type edit page - add_action( 'load-toolset_page_wpcf-edit-type', array( 'Types_Page_Extension_Edit_Post_Type', 'get_instance' ) ); - - // extension for post fields edit page - add_action( 'load-toolset_page_wpcf-edit', array( 'Types_Page_Extension_Edit_Post_Fields', 'get_instance' ) ); - - // settings - add_action( 'load-toolset_page_toolset-settings', array( $this, 'init_settings' ) ); - } - - - /** - * Initialize the extension for the Toolset Settings page. - * - * @since 2.1 - */ - public function init_settings() { - $settings = new Types_Page_Extension_Settings(); - $settings->build(); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/admin_menu.php b/backend/wordpress/wp-content/plugins/types/application/controllers/admin_menu.php deleted file mode 100644 index bb1ab55..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/admin_menu.php +++ /dev/null @@ -1,124 +0,0 @@ -maybe_add_ondemand_submenu( $pages, $page_name ); - } - return $pages; - } - - - /** - * Check if an on-demand submenu should be added, and jumpstart it's controller if needed. - * - * On-demand submenu means that the submenu isn't displayed normally, it appears only when its page is loaded. - * - * Note: All page controllers should inherit from Types_Page_Abstract. - * - * @param array $pages Array of menu item definitions. - * @param string $page_name - * @return array Updated item definition array. - * @since 2.0 - */ - private function maybe_add_ondemand_submenu( $pages, $page_name ) { - $page = null; - switch( $page_name ) { - case self::PAGE_NAME_FIELD_CONTROL: - $page = Types_Page_Field_Control::get_instance(); - break; - case self::PAGE_NAME_HELPER: - Types_Page_Hidden_Helper::get_instance(); - break; - } - - if( $page instanceof Types_Page_Abstract ) { - - // Jumpstart the page controller. - try { - $page->prepare(); - } catch( Exception $e ) { - wp_die( $e->getMessage() ); - } - - $pages[ $page_name ] = array( - 'slug' => $page_name, - 'menu_title' => $page->get_title(), - 'page_title' => $page->get_title(), - 'callback' => $page->get_render_callback(), - 'load_hook' => $page->get_load_callback(), - 'capability' => $page->get_required_capability(), - 'contextual_help_hook' => array( Types_Asset_Help_Tab_Loader::get_instance(), 'add_help_tab' ) - ); - - // todo we might need to handle adding URL parameters to submenu URLs in some standard way, it's common scenario for ondemand submenus - - } - - return $pages; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/admin_notice/free-version.php b/backend/wordpress/wp-content/plugins/types/application/controllers/admin_notice/free-version.php deleted file mode 100644 index 49460bf..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/admin_notice/free-version.php +++ /dev/null @@ -1,99 +0,0 @@ -constants = $constants; - - add_action( 'init', array( $this, 'init' ), 1000 ); - } - - /** - * Init notices by screen - */ - public function init_screens() { - if( ! function_exists( 'get_current_screen' ) ) { - // loaded to early - return; - } - - $this->current_screen = get_current_screen(); - - $this->screen_wordpress_dashboard(); - } - - /** - * Notices for the Wordpress Dashboard Page - */ - protected function screen_wordpress_dashboard() { - if( $this->get_current_screen_id() != 'dashboard' ) { - return; - } - - $this->new_features_of_paid_types(); - } - - /** - * New feature of paid types - * Will only show notices if only types is active - */ - private function new_features_of_paid_types() { - if( ! $this->only_types_active() ) { - // not only types active - return; - } - - // new features of paid types (here should only be the newest version, - // otherwise new clients or old on new installations see all release notices) - $this->notice_types_release_3_0(); - } - - /** - * Notice about Types 3.0 features - * - * @return bool|Toolset_Admin_Notice_Dismissible - */ - private function notice_types_release_3_0() { - $notice = new Toolset_Admin_Notice_Dismissible( self::NOTICE_TYPES_3_0, '', $this->constants ); - $notice->set_similar_notices_key( Toolset_Admin_Notices_Manager::SIMILAR_NOTICES_FREE_PLUGIN_SHOWS_PAID_FEATURES ); - $notice->set_content( TYPES_ABSPATH . '/application/views/admin-notices/free-version/types-3-0.phtml' ); - Toolset_Admin_Notices_Manager::add_notice( $notice ); - - return $notice; - } - - /** - * Notice about Types 3.1 features - * - * NOT USED YET - ADDED FOR TESTING AND KEPT IT FOR NEXT RELEASE - * - * @return bool|Toolset_Admin_Notice_Dismissible - */ - private function notice_types_release_3_1() { - $notice = new Toolset_Admin_Notice_Dismissible( self::NOTICE_TYPES_3_1, '', $this->constants ); - $notice->set_similar_notices_key( Toolset_Admin_Notices_Manager::SIMILAR_NOTICES_FREE_PLUGIN_SHOWS_PAID_FEATURES ); - $notice->set_content( TYPES_ABSPATH . '/application/views/admin-notices/free-version/types-3-1.phtml' ); - Toolset_Admin_Notices_Manager::add_notice( $notice ); - - return $notice; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/admin_notice/utils.php b/backend/wordpress/wp-content/plugins/types/application/controllers/admin_notice/utils.php deleted file mode 100644 index 82eb054..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/admin_notice/utils.php +++ /dev/null @@ -1,266 +0,0 @@ - true, '_builtin' => true ), $output_mode ); - } - - - /** - * Get a list of taxonomies that should be excluded from any sort of Types/Toolset functionality. - * - * @return string[] Taxonomy slugs. - * @since 2.2.9 - */ - public static function get_excluded_taxonomies() { - return array( 'nav_menu', 'link_category', 'post_format' ); - } - - - /** - * Get registered taxonomies that can be edited by Types/Toolset. - * - * That includes custom taxonomies from Types and the built-in ones (which are not excluded). - * - * @return WP_Taxonomy[] Taxonomy objects. - * @since 2.2.9 - */ - public static function get_editable_taxonomies() { - $custom_taxonomies = array_keys( wpcf_ensarr( get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() ) ) ); - $builtin_taxonomies = self::get_builtin_taxonomies( 'names' ); - $allowed_taxonomies = array_merge( $custom_taxonomies, $builtin_taxonomies ); - - $excluded_taxonomies = self::get_excluded_taxonomies(); - $allowed_taxonomies = array_diff( $allowed_taxonomies, $excluded_taxonomies ); - - $taxonomies = get_taxonomies( '', 'objects' ); - foreach( $taxonomies as $taxonomy_slug => $taxonomy ) { - if( ! in_array( $taxonomy_slug, $allowed_taxonomies ) ) { - unset( $taxonomies[ $taxonomy_slug ] ); - } - } - - return $taxonomies; - } - - - /** - * Get a definitive set of all taxonomies recognized by Types. - * - * That also includes inactive taxonomies. - * Respects if some builtin taxonomy is overridden by Types. - * - * @return array - * @since 1.9 - */ - public static function get_all_taxonomies() { - // todo add simple caching - $taxonomies = array(); - - // Read Types taxonomies first. - $types_taxonomies = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() ); - if ( is_array( $types_taxonomies ) ) { - foreach ( $types_taxonomies as $slug => $data ) { - $taxonomies[ $slug ] = $data; - } - } - - // Get all taxonomies and add them to the set, but avoid overwriting Types taxonomies - $all_taxonomies = self::object_to_array_deep( get_taxonomies( array( 'public' => true ) , 'objects' ) ); - foreach ( $all_taxonomies as $slug => $data ) { - // check if taxonomies are already saved as custom taxonomies - if ( isset( $taxonomies[ $slug ] ) ) { - continue; - } - - if ( ! isset( $data['slug'] ) ) { - $data['slug'] = $slug; - } - - $taxonomies[ $slug ] = $data; - } - - return $taxonomies; - } - - - /** - * Transform an object and all it's fields recursively into an associative array. If any object's field is - * an array, individual elements of the array will be transformed as well. - * - * @param object|array $object The object or array of objects to transform. - * @return array - * @since 1.9 - */ - public static function object_to_array_deep( $object ) { - if ( is_array( $object ) || is_object( $object ) ) { - $result = array(); - foreach ( $object as $key => $value ) { - $result[ $key ] = self::object_to_array_deep( $value ); - } - - return $result; - } - - return $object; - } - - - /** - * Try to convert a taxonomy slug to a label. - * - * @param string $slug Taxonomy slug. - * @param string $label_name One of the available labels of the taxonomy. - * - * @link https://codex.wordpress.org/Function_Reference/get_taxonomies Taxonomy object description. - * - * @return string Selected taxonomy label or slug if the label was not found. - * @since 1.9 - */ - public static function taxonomy_slug_to_label( $slug, $label_name = 'name' ) { - $all_taxonomies = self::get_all_taxonomies(); - - $taxonomy_display_name = wpcf_getnest( $all_taxonomies, array( $slug, 'labels', $label_name ), $slug ); - - return $taxonomy_display_name; - } - - - /** - * Check if searched string is a substring of the value. - * - * @param string $search_string - * @param string $value - * @return bool - * @since 1.9 - */ - public static function is_string_match( $search_string, $value ) { - return ( false !== strpos( mb_strtolower( $value ), mb_strtolower( trim( $search_string ) ) ) ); - } - - - /** - * Insert elements into source array at a specified position. - * - * @param array $source Source array. - * @param array $to_insert Array of elements to insert. - * @param int|array $position When integer is provided, zero or positive value means index of the first element that - * will not be included before $to_insert. Negative value defines the position from the end of the source array - * (-1 will insert at the very end, -2 before last element, etc.). When an array is provided, it is expected to - * have form: - * - 'key': Key to select an element in the source array - * - 'where': Insert 'before'|'after' the selected element - * - * @return array - * @since 1.9.1 - */ - public static function insert_at_position( $source, $to_insert, $position) { - - if( is_array( $position ) ) { - $pivot_key = wpcf_getarr( $position, 'key', null ); - $direction = wpcf_getarr( $position, 'where', 'after', array( 'after', 'before' ) ); - - if( array_key_exists( $pivot_key, $source ) ) { - $pivot_index = array_search( $pivot_key, array_keys( $source ) ); - $position = ( 'before' == $direction ) ? $pivot_index : $pivot_index + 1; - } else { - $position = ( 'before' == $direction ) ? 0 : -1; - } - } - - // $position should be index of the first element that will NOT be included before $to_insert. - $position = (int) $position; - - if( 0 > $position ) { - // E.g.: When $position == -1, the inserted elements should be placed after the last element of $source. - // $position will point after the last element of $source, new elements will be inserted after it. - $position = count( $source ) + 1 + $position; - //echo "pos=$position\n"; - - // Handle too low $position value - insert elements before whole $source. - if( 0 > $position ) { - $position = 0; - } - } - - $first_source_part = array_slice( $source, 0, $position ); - $second_source_part = array_slice( $source, $position ); - $result = array_merge( $first_source_part, $to_insert, $second_source_part ); - - return $result; - } - - - /** - * Return an ID of an attachment by searching the database with the file URL. - * - * First checks to see if the $url is pointing to a file that exists in - * the wp-content directory. If so, then we search the database for a - * partial match consisting of the remaining path AFTER the wp-content - * directory. Finally, if a match is found the attachment ID will be - * returned. - * - * Taken from: - * @link http://frankiejarrett.com/get-an-attachment-id-by-url-in-wordpress/ - * - * @param string $url URL of the file. - * @return int|null Attachment ID if it exists. - * @since 1.9.1 - * @deprecated Since 2.2.7. Use Toolset_Utils::get_attachment_id_by_url() instead. To be removed in 2.3 or later. - */ - public static function get_attachment_id_by_url( $url ) { - - // Split the $url into two parts with the wp-content directory as the separator. - $parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url ); - - // Return null if image is not on domain (WP_CONTENT_URL). - if ( count( $parsed_url ) === 1 ) { - return null; - } - - // Get the host of the current site and the host of the $url, ignoring www. - $this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) ); - $file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) ); - - // Return nothing if there aren't any $url parts or if the current host and $url host do not match. - $attachment_path = $parsed_url[1]; - if ( ! isset( $attachment_path ) || empty( $attachment_path ) || ( $this_host != $file_host ) ) { - return null; - } - - // Now we're going to quickly search the DB for any attachment GUID with a partial path match. - // Example: /uploads/2013/05/test-image.jpg - global $wpdb; - - $query = $wpdb->prepare( - "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND guid LIKE %s", - '%' . $attachment_path - ); - - $attachment = $wpdb->get_col( $query ); - - if ( is_array( $attachment ) && ! empty( $attachment ) ) { - return array_shift( $attachment ); - } - - return null; - } - - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax.php b/backend/wordpress/wp-content/plugins/types/application/controllers/ajax.php deleted file mode 100644 index 6bdc737..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax.php +++ /dev/null @@ -1,177 +0,0 @@ -maybe_disable_column_autohiding( $taxonomy_name, $_meta_value, $page_name ); - } - } - } - - - /** - * This offers a possibility to handle legacy AJAX wp_ajax_wpcf_ajax calls - * if they're not handled in the legacy code anymore. - * - * Note that the method needs to always finish with die() to keep consistency with the legacy code. - * - * @since 2.2.16 - */ - public function do_legacy_wpcf_ajax() { - die(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/abstract.php b/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/abstract.php deleted file mode 100644 index 8d1c2df..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/abstract.php +++ /dev/null @@ -1,48 +0,0 @@ -ajax_manager = $ajax_manager; - } - - - /** - * Get the Types AJAX manager. - * - * @return Types_Ajax - */ - protected function get_am() { - return $this->ajax_manager; - } - - - protected function ajax_begin( $arguments ) { - $am = $this->get_am(); - return $am->ajax_begin( $arguments ); - } - - - protected function ajax_finish( $response, $is_success = true ) { - $am = $this->get_am(); - return $am->ajax_finish( $response, $is_success ); - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/check_slug_conflicts.php b/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/check_slug_conflicts.php deleted file mode 100644 index 5ff0076..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/check_slug_conflicts.php +++ /dev/null @@ -1,259 +0,0 @@ -ajax_begin( - array( 'nonce' => Types_Ajax::CALLBACK_CHECK_SLUG_CONFLICTS ) - ); - - // Read and validate input - $domains = wpcf_getpost( 'domains' ); - $value = wpcf_getpost( 'value' ); - $exclude = wpcf_getpost( 'exclude' ); - $exclude_id = wpcf_getarr( $exclude, 'id', 0 ); - $exclude_domain = wpcf_getarr( $exclude, 'domain' ); - $diff_domains = array_diff( $domains, self::$supported_domains ); - - if( !is_array( $domains ) - || !empty( $diff_domains ) - || !is_string( $value ) - || !is_array( $exclude ) - || 0 === $exclude_id - || !in_array( $exclude_domain, self::$supported_domains ) - ) { - $this->ajax_finish( array(), false ); - } - - - $conflict = $this->check_slug_conflicts( $value, $domains, $exclude_domain, $exclude_id ); - - - // Parse output (report a conflict if there is any) - if( false === $conflict ) { - $this->ajax_finish( array( 'isConflict' => false ), true ); - } else { - - $message = sprintf( - '%s: %s', - __( 'Warning', 'wpcf' ), - wpcf_getarr( $conflict, 'message' ) - ); - - $this->ajax_finish( - array( - 'isConflict' => true, - 'displayMessage' => $message - ), - true - ); - } - - } - - - /** - * Check given slug for conflicts across defined domains. - * - * @param string $value Value to check. - * @param string[] $domains Array of valid domains - * @param string $exclude_domain Domain of the excluded object. - * @param string|int|null $exclude_id Id of the excluded object. - * - * @return array|bool Conflict information (an associative array with conflicting_id, message) or false when - * there's no conflict. - * - * @since 2.1 - */ - private function check_slug_conflicts( $value, $domains, $exclude_domain, $exclude_id ) { - - foreach( $domains as $domain ) { - $conflict = $this->check_slug_conflicts_in_domain( $value, $domain, ( $domain == $exclude_domain ) ? $exclude_id : null ); - if( false !== $conflict ) { - return $conflict; - } - } - - // No conflicts found - return false; - } - - - /** - * Check given slug for conflicts in one domain. - * - * @param string $value Value to check. - * @param string $domain Domain name. - * @param string|int|null $exclude_id ID of an object to exclude within this domain, or null if there is none. - * - * @return array|bool Conflict information (an associative array with conflicting_id, message) or false when - * there's no conflict. - * - * @since 2.1 - */ - private function check_slug_conflicts_in_domain( $value, $domain, $exclude_id = null ) { - switch( $domain ) { - case self::DOMAIN_POST_TYPE_REWRITE_SLUGS: - return $this->check_slug_conflicts_in_post_type_rewrite_rules( $value, $exclude_id ); - case self::DOMAIN_TAXONOMY_REWRITE_SLUGS: - return $this->check_slug_conflicts_in_taxonomy_rewrite_rules( $value, $exclude_id ); - default: - return false; - } - } - - - /** - * Check a slug for conflict with slugs used for taxonomy permalink rewriting. - * - * @param string $value Value to check. - * @param string $exclude_id Taxonomy slug to exclude from checking. - * - * @return array|bool Conflict information (an associative array with conflicting_id, message) or false when - * there's no conflict. - * @since 2.1 - */ - private function check_slug_conflicts_in_taxonomy_rewrite_rules( $value, $exclude_id ) { - - // Merge currently registered taxonomies (which might include some from other plugins) and - // Types settings (which might include deactivated taxonomies). - $taxonomy_settings = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() ); - if( !is_array( $taxonomy_settings ) ) { - return false; - } - $taxonomy_settings = array_merge( $taxonomy_settings, get_taxonomies( array(), 'objects' ) ); - - foreach( $taxonomy_settings as $taxonomy ) { - - // Read information from the taxonomy object or Types settings - if( is_object( $taxonomy ) ) { - $slug = $taxonomy->name; - $rewrite_slug = wpcf_getarr( $taxonomy->rewrite, 'slug' ); - $is_permalink_rewriting_enabled = !empty( $rewrite_slug ); - } else { - $slug = wpcf_getarr( $taxonomy, 'slug' ); - $is_permalink_rewriting_enabled = (bool) wpcf_getnest( $taxonomy, array( 'rewrite', 'enabled' ) ); - $rewrite_slug = wpcf_getnest( $taxonomy, array( 'rewrite', 'slug' ) ); - } - - if( $slug == $exclude_id ) { - continue; - } - - // Detect if there is a conflict - $is_custom_slug_used = !empty( $rewrite_slug ); - - if( $is_permalink_rewriting_enabled ) { - $conflict_candidate = ( $is_custom_slug_used ? $rewrite_slug : $slug ); - - if( $conflict_candidate == $value ) { - - $conflict = array( - 'conflicting_id' => $slug, - 'message' => sprintf( - __( 'The same value is already used in permalink rewrite rules for the taxonomy "%s". Using it again can cause issues with permalinks.', 'wpcf' ), - esc_html( $slug ) - ) - ); - - return $conflict; - } - } - } - - // No conflicts found. - return false; - } - - - /** - * Check a slug for conflict with slugs used for post type permalink rewriting. - * - * @param string $value Value to check. - * @param string $exclude_id Post type slug to exclude from checking. - * - * @return array|bool Conflict information (an associative array with conflicting_id, message) or false when - * there's no conflict. - * @since 2.1 - */ - private function check_slug_conflicts_in_post_type_rewrite_rules( $value, $exclude_id ) { - - // Merge currently registered post types (which might include some from other plugins) and - // Types settings (which might include deactivated post types). - $post_type_option = new Types_Utils_Post_Type_Option(); - $post_type_settings = $post_type_option->get_post_types(); - if( !is_array( $post_type_settings ) ) { - return false; - } - $post_type_settings = array_merge( $post_type_settings, get_post_types( array(), 'objects' ) ); - - foreach( $post_type_settings as $post_type ) { - - // Read information from the post type object or Types settings - if( is_object( $post_type ) ) { - $slug = $post_type->name; - $is_permalink_rewriting_enabled = (bool) wpcf_getarr( $post_type->rewrite, 'enabled' ); - $rewrite_slug = wpcf_getarr( $post_type->rewrite, 'slug' ); - $is_custom_slug_used = !empty( $rewrite_slug ); - } else { - $slug = wpcf_getarr( $post_type, 'slug' ); - $is_permalink_rewriting_enabled = (bool) wpcf_getnest( $post_type, array( 'rewrite', 'enabled' ) ); - $is_custom_slug_used = ( wpcf_getnest( $post_type, array( 'rewrite', 'custom' ) ) == 'custom' ); - $rewrite_slug = wpcf_getnest( $post_type, array( 'rewrite', 'slug' ) ); - } - - if( $slug == $exclude_id ) { - continue; - } - - if( $is_permalink_rewriting_enabled ) { - $conflict_candidate = ( $is_custom_slug_used ? $rewrite_slug : $slug ); - - if( $conflict_candidate == $value ) { - - $conflict = array( - 'conflicting_id' => $slug, - 'message' => sprintf( - __( 'The same value is already used in permalink rewrite rules for the custom post type "%s". Using it again can cause issues with permalinks.', 'wpcf' ), - esc_html( $slug ) - ) - ); - - return $conflict; - } - } - } - - // No conflicts found. - return false; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/field_control_action.php b/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/field_control_action.php deleted file mode 100644 index 7917280..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/field_control_action.php +++ /dev/null @@ -1,367 +0,0 @@ -get_am(); - - $am->ajax_begin( array( 'nonce' => $am->get_action_js_name( Types_Ajax::CALLBACK_FIELD_CONTROL_ACTION ) ) ); - - // Read and validate input - $field_action = sanitize_text_field( wpcf_getpost( 'field_action' ) ); - $fields = wpcf_getpost( 'fields' ); // array of values, will be sanitized when processed - - $current_domain = wpcf_getpost( 'domain', null, Types_Field_Utils::get_domains() ); - if( null == $current_domain ) { - $am->ajax_finish( array( 'message' => __( 'Wrong field domain.', 'wpcf' ) ), false ); - } - - if( !is_array( $fields ) || empty( $fields ) ) { - $am->ajax_finish( array( 'message' => __( 'No fields have been selected.', 'wpcf' ) ), false ); - } - - // will be sanitized when/if used by the action-specific method - $action_specific_data = wpcf_getpost( 'action_specific', array() ); - - // Process fields one by one - $errors = array(); - $results = array(); - foreach( $fields as $field ) { - - $result = $this->single_field_control_action( $field_action, $field, $current_domain, $action_specific_data ); - - if( is_array( $result ) ) { - // Array of errors - $errors = array_merge( $errors, $result ); - } else if( $result instanceof WP_Error ) { - // Single error - $errors[] = $result; - } else if( false == $result ) { - // This should not happen...! - $errors[] = new WP_Error( 0, __( 'An unexpected error happened while processing the request.', 'wpcf' ) ); - } else { - // Success - - // Save the field definition model as a result if we got a whole definition - if( $result instanceof WPCF_Field_Definition ) { - $result = $result->to_json(); - } - - $results[ wpcf_getarr( $field, 'slug' ) ] = $result; - } - } - - $data = array( 'results' => $results ); - $is_success = empty( $errors ); - - if( !$is_success ) { - $error_messages = array(); - /** @var WP_Error $error */ - foreach( $errors as $error ) { - $error_messages[] = $error->get_error_message(); - } - $data['messages'] = $error_messages; - } - - $am->ajax_finish( $data, $is_success ); - - } - - - /** - * @param string $action_name One of the allowed action names: 'manage_with_types' - * @param array $field Field definition model passed from JS. - * @param string $domain Field domain name. - * @param mixed $action_specific_data - * @return bool|mixed|null|WP_Error|WP_Error[]|WPCF_Field_Definition An error, array of errors, boolean indicating - * success or a result value to be passed back to JS. - * @since 2.0 - */ - private function single_field_control_action( $action_name, $field, $domain, $action_specific_data ) { - - $field_slug = sanitize_text_field( wpcf_getarr( $field, 'slug' ) ); - - switch ( $action_name ) { - - case 'manage_with_types': - return $this->start_managing_field( sanitize_text_field( wpcf_getarr( $field, 'metaKey' ) ), $domain ); - - case 'stop_managing_with_types': - return $this->stop_managing_field( $field_slug, $domain ); - - case 'change_group_assignment': - // $action_specific_data is a list of group slugs, will be sanitized by - // trying to load a group model - return $this->change_assignment_to_groups( $field_slug, $domain, $action_specific_data ); - - case 'delete_field': - return $this->delete_field( $field_slug, $domain ); - - case 'change_field_type': - return $this->change_field_type( $field_slug, $domain, $action_specific_data ); - - case 'change_field_cardinality': - return $this->change_field_cardinality( $field_slug, $domain, $action_specific_data ); - - default: - return new WP_Error( 42, __( 'Invalid action name.', 'wpcf' ) ); - } - } - - - /** - * Start managing a field with given meta_key with Types. - * - * Looks if there already exists a field definition that uses the meta_key. If yes, it's most probably a "disabled" - * one, that is stored only for the possibility of later "re-activation" (which is happening now). In that case, - * the field definition will be simply updated. - * - * If there is no matching field definition whatsoever, it will be created with in some default manner. - * Check WPCF_Field_Definition_Factory::create_field_definition_for_existing_fields() for details. - * - * AJAX callback helper only, do not use elsewhere. - * - * @param string $meta_key - * @param string $domain Field domain - * @return false|null|WPCF_Field_Definition The updated/newly created field definition or falsy value on failure. - * @since 2.0 - */ - public function start_managing_field( $meta_key, $domain ) { - $factory = WPCF_Field_Definition_Factory::get_factory_by_domain( $domain ); - $definition = $factory->meta_key_belongs_to_types_field( $meta_key, 'definition' ); - if( null == $definition ) { - $result = $factory->create_field_definition_for_existing_fields( $meta_key ); - if( false != $result ) { - return $factory->load_field_definition( $result ); - } else { - return false; - } - } else { - $is_success = $definition->set_types_management_status( true ); - return ( $is_success ? $definition : false ); - } - } - - - /** - * Stop managing a field with given field slug by Types. - * - * AJAX callback helper only, do not use elsewhere. - * - * @param string $field_slug - * @param string $domain Field domain. - * @return WP_Error|WPCF_Field_Definition Error with a user-friendly message on failure - * or the updated definition on success. - * @since 2.0 - */ - public static function stop_managing_field( $field_slug, $domain ) { - - $factory = WPCF_Field_Definition_Factory::get_factory_by_domain( $domain ); - $definition = $factory->load_field_definition( $field_slug ); - - if( null == $definition ) { - - return new WP_Error( 42, sprintf( __( 'Field definition for field "%s" not found in options.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - - } else { - - $is_success = $definition->set_types_management_status( false ); - - if( $is_success ) { - return $definition; - } else { - return new WP_Error( - 42, - sprintf( - __( 'Unable to set types management status for field definition "%s".', 'wpcf' ), - sanitize_text_field( $field_slug ) - ) - ); - } - } - } - - - /** - * Change which groups is a field definition associated with. - * - * AJAX callback helper only, do not use elsewhere. - * - * @param string $field_slug Field definition slug. - * @param string $domain Field domain - * @param string[][] $groups Action-specific data passed through AJAX. Array containing a single key 'group_slugs', - * containing an array of field group slugs. - * - * @return WP_Error|WPCF_Field_Definition The updated field definition on success or an error object. - * @since 2.0 - */ - public function change_assignment_to_groups( $field_slug, $domain, $groups ) { - $factory = WPCF_Field_Definition_Factory::get_factory_by_domain( $domain ); - $definition = $factory->load_field_definition( $field_slug ); - if( null == $definition ) { - return new WP_Error( 42, sprintf( __( 'Field definition for field "%s" not found in options.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - } - $new_groups = wpcf_ensarr( wpcf_getarr( $groups, 'group_slugs' ) ); - $associated_groups = $definition->get_associated_groups(); - $is_success = true; - foreach( $associated_groups as $group ) { - if( !in_array( $group->get_slug(), $new_groups ) ) { - $is_success = $is_success && $group->remove_field_definition( $definition ); - } - } - $group_factory = $factory->get_group_factory(); - foreach( $new_groups as $new_group_slug ) { - $new_group = $group_factory->load_field_group( $new_group_slug ); - if( null != $new_group ) { - $is_success = $is_success && $new_group->add_field_definition( $definition ); - } else { - $is_success = false; - } - } - - if( $is_success ) { - return $definition; - } else { - return new WP_Error(); - } - } - - - /** - * Delete a field definition and all values of the field within given domain. - * - * @param string $field_slug - * @param string $domain - * @return bool|WP_Error True for success, false or WP_Error on error. - * @since 2.0 - */ - public function delete_field( $field_slug, $domain ) { - - $factory = WPCF_Field_Definition_Factory::get_factory_by_domain( $domain ); - $definition = $factory->load_field_definition( $field_slug ); - if( null == $definition ) { - return new WP_Error( 42, sprintf( __( 'Field definition for field "%s" not found in options.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - } else if( ! $definition->is_managed_by_types() ) { - return new WP_Error( 42, sprintf( __( 'Field "%s" will not be deleted because it is not managed by Types.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - } - - $response = $factory->delete_definition( $definition ); - - return $response; - } - - - /** - * Change a field type for given field definition. - * - * Performs checks if the conversion is allowed, and if not, generate a proper error message. - * - * @param string $field_slug - * @param string $domain - * @param string[] $arguments Needs to contain the 'field_type' key with target type slug. - * @return false|WP_Error|WPCF_Field_Definition The updated definition on succes, error/false otherwise. - * @since 2.0 - */ - public function change_field_type( $field_slug, $domain, $arguments ) { - - // Load all information we need, fail if it doesn't exist. - $factory = WPCF_Field_Definition_Factory::get_factory_by_domain( $domain ); - $definition = $factory->load_field_definition( $field_slug ); - if( null == $definition ) { - return new WP_Error( 42, sprintf( __( 'Field definition for field "%s" not found in options.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - } else if( ! $definition->is_managed_by_types() ) { - return new WP_Error( 42, sprintf( __( 'Field "%s" will not be converted because it is not managed by Types.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - } - - $type_slug = sanitize_text_field( wpcf_getarr( $arguments, 'field_type' ) ); - $target_type = Types_Field_Type_Definition_Factory::get_instance()->load_field_type_definition( $type_slug ); - if( null == $target_type ) { - return new WP_Error( 42, sprintf( __( 'Unknown field type "%s".', 'wpcf' ), $type_slug ) ); - } - - // Check if we can convert between types - $is_conversion_possible = Types_Field_Type_Converter::get_instance()->is_conversion_possible( $definition->get_type(), $target_type ); - if( !$is_conversion_possible ) { - return new WP_Error( - 42, - sprintf( - __( 'Conversion from type "%s" to "%s" is currently not allowed.', 'wpcf' ), - $definition->get_type()->get_display_name(), - $target_type->get_display_name() - ) - ); - } - - // Check if we can do the conversion with current field's cardinality - $is_cardinality_sustainable = ( ! $definition->get_is_repetitive() || $target_type->can_be_repetitive() ); - if( !$is_cardinality_sustainable ) { - return new WP_Error( - 42, - sprintf( - __( 'Field "%s" cannot be converted from "%s" to "%s" because it is repetitive and the target type doesn\'t support that.', 'wpcf' ), - $definition->get_display_name(), - $definition->get_type()->get_display_name(), - $target_type->get_display_name() - ) - ); - } - - // All is fine, proceed. - $result = $definition->change_type( $target_type ); - if( $result ) { - return $definition; - } else { - // Something unexpected went wrong. - return false; - } - } - - - /** - * Change cardinality of given field, if it is permitted by its type. - * - * @param string $field_slug Field definition slug. - * @param string $domain Field domain. - * @param string[] $arguments Needs to contain the 'target_cardinality' key with 'single'|'repetitive' value. - * @return bool|WP_Error|WPCF_Field_Definition The updated definition on succes, error/false otherwise. - * @since 2.0 - */ - public function change_field_cardinality( $field_slug, $domain, $arguments ) { - $factory = WPCF_Field_Definition_Factory::get_factory_by_domain( $domain ); - $definition = $factory->load_field_definition( $field_slug ); - if( null == $definition ) { - return new WP_Error( 42, sprintf( __( 'Field definition for field "%s" not found in options.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - } else if( ! $definition->is_managed_by_types() ) { - return new WP_Error( 42, sprintf( __( 'Field "%s" will not be converted because it is not managed by Types.', 'wpcf' ), sanitize_text_field( $field_slug ) ) ); - } - - $target_cardinality = wpcf_getarr( $arguments, 'target_cardinality', null, array( 'single', 'repetitive' ) ); - if( null == $target_cardinality ) { - return false; - } - $set_as_repetitive = ( 'repetitive' == $target_cardinality ); - - $result = $definition->set_is_repetitive( $set_as_repetitive ); - - if( $result ) { - return $definition; - } else { - return false; - } - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/settings_action.php b/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/settings_action.php deleted file mode 100644 index a9f897c..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler/settings_action.php +++ /dev/null @@ -1,56 +0,0 @@ -get_am(); - - $am->ajax_begin( array( 'nonce' => $am->get_action_js_name( Types_Ajax::CALLBACK_SETTINGS_ACTION ) ) ); - - $setting = sanitize_text_field( wpcf_getpost( 'setting' ) ); - $setting_value = wpcf_getpost( 'setting_value' ); - - if( !is_array( $setting_value ) ) { - parse_str( $setting_value, $setting_value ); - $setting_value = array_pop( $setting_value ); - } - - $sanitized_value = array(); - foreach( $setting_value as $key => $value ) { - $sanitized_key = sanitize_title( $key ); - $sanitized_value[ $sanitized_key ] = sanitize_text_field( $value ); - } - - // use toolset settings if available - if( class_exists( 'Toolset_Settings' ) - && method_exists( 'Toolset_Settings', 'get_instance' ) ) { - $toolset_settings = Toolset_Settings::get_instance(); - - if( method_exists( $toolset_settings, 'save' ) ) { - $toolset_settings[ $setting ] = $sanitized_value; - $toolset_settings->save(); - $am->ajax_finish( 'success', true ); - } - } else { - update_option( $setting, $sanitized_value ); - $am->ajax_finish( 'success', true ); - } - - // default toolset setting error will be used - // todo throw specific error - $am->ajax_finish( array('error'), false ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler_interface.php b/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler_interface.php deleted file mode 100644 index d08021d..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/ajax/handler_interface.php +++ /dev/null @@ -1,24 +0,0 @@ -register_callbacks(); - } - - - /** Prefix for the callback method name */ - const CALLBACK_PREFIX = 'callback_'; - - /** Prefix for the handler class name */ - const HANDLER_CLASS_PREFIX = 'Types_Api_Handler_'; - - const DELIMITER = '_'; - - - private $callbacks_registered = false; - - - /** - * @var array Filter names (without prefix) as keys, filter parameters as values: - * - int $args: Number of arguments of the filter - */ - private static $callbacks = array( - - /** - * types_import_from_zip_file - * - * Run an import operation from given ZIP file. - * - * The file will, unlike in normal Types import, NOT be deleted. - * - * The import will be performed in the context of Framework Installer Views demo, so everything existing - * will be either overwritten or deleted. - * - * @param mixed $default Should be false/null value to indicate that the hook didn't run. - * @param string $path Absolute path to the ZIP file with Types import data - * @param array|null $args Optional array with arguments for the underlying legacy import routine. - * @return true|WP_Error - * @since 2.2 - */ - 'import_from_zip_file' => array( 'args' => 3 ), - - - /** - * types_query_groups - * - * Query field groups of one or more domains. - * - * @param mixed $ignored - * @param array $query Field group query. - * - 'domain': A single field domain (see Types_Field_Utils). Legacy domain names are also accepted: - * 'posts'|'users'|'terms'|'postmeta'|'usermeta'|'termmeta'|'all'. For 'all', - * the method returns a multidimensional arrays with results for individual domains: - * array( 'posts' => array( ... ), 'users' => array( ... ), ... ). - * - For the rest of the query arguments, see Types_Field_Group_Factory::query_groups(). - * - * @return null|Types_Field_Group[] Groups, if any, or empty otherwise. Null is returned when the query - * is invalid. - * - * @since 2.2 - */ - 'query_groups' => array( 'args' => 2 ), - - - /** - * types_filter_get_field_group_ids_by_post_type - * - * Returns all ids of field groups assigned to the given post type. - * - * Note: This is used by CRED (auto complete form). - * - * @param mixed $ignored - * @param string $post_type_slug - * - * @return array Post field group IDs (may come as numeric strings). - * - * @throws InvalidArgumentException when presented with a non-string post type. - * - * @since 2.2.14 - */ - 'filter_get_field_group_ids_by_post_type' => array( 'args' => 2 ) - - ); - - - /** - * Add API filter hooks (if that wasn't done before). - * - * Reads self::$callbacks for hook definitions and adds older/special hooks. - */ - private function register_callbacks() { - - if( $this->callbacks_registered ) { - return; - } - - foreach( self::$callbacks as $callback_name => $args ) { - - $argument_count = wpcf_getarr( $args, 'args', 1 ); - - add_filter( 'types_' . $callback_name, array( $this, self::CALLBACK_PREFIX . $callback_name ), 10, $argument_count ); - } - - $this->callbacks_registered = true; - - /** - * types_filter_query_field_definitions - * - * @param mixed $default - * @param array $query Field definition query. See Types_Field_Definition_Factory::query() for allowed arguments. - * Additionally, you can specify: - * - 'domain': Field domain (see Types_Field_Utils; legacy domain names are also accepted): - * 'posts'|'users'|'terms'|'postmeta'|'usermeta'|'termmeta'|'all'. For 'all', - * the method returns a multidimensional arrays with results for individual domains: - * array( 'posts' => array( ... ), 'users' => array( ... ), ... ). - * @return null|array Field definition arrays, sanitized as per field type, or null if an error has occurred. - * @since 2.1 - */ - add_filter( 'types_filter_query_field_definitions', array( $this, 'query_field_definitions' ), 10, 2 ); - - - /** - * types_is_active - * - * Indicate that Types is active. :-) - * - * @since 2.2 - * @return bool - */ - add_filter( 'types_is_active', '__return_true' ); - - } - - - /** - * Handle a call to undefined method on this class, hopefully an action/filter call. - * - * @param string $name Method name. - * @param array $parameters Method parameters. - * @since 2.1 - * @return mixed - */ - public function __call( $name, $parameters ) { - - $default_return_value = wpcf_getarr( $parameters, 0, null ); - - // Check for the callback prefix in the method name - $name_parts = explode( self::DELIMITER, $name ); - if( 0 !== strcmp( $name_parts[0] . self::DELIMITER, self::CALLBACK_PREFIX ) ) { - // Not a callback, resign. - return $default_return_value; - } - - // Deduct the handler class name from the callback name - unset( $name_parts[0] ); - $class_name = implode( self::DELIMITER, $name_parts ); - $class_name = strtolower( $class_name ); - $class_name = mb_convert_case( $class_name, MB_CASE_TITLE ); - $class_name = self::HANDLER_CLASS_PREFIX . $class_name; - - // Obtain an instance of the handler class. - try { - /** @var Types_Api_Handler_Interface $handler */ - $handler = new $class_name(); - } catch( Exception $e ) { - // The handler class could not have been instantiated, resign. - return $default_return_value; - } - - // Success - return $handler->process_call( $parameters ); - } - - - - /** - * Hook for types_filter_query_field_definitions. - * - * @param mixed $ignored - * @param array $query Field definition query. See Types_Field_Definition_Factory::query() for supported arguments. - * Additionally, you can specify: - * - 'domain': A single field domain (see Types_Field_Utils) or 'all'. Legacy domain names are also accepted. - * For 'all', the method returns a multidimensional arrays with results for individual domains: - * - 'refresh': A boolean to refresh the definitions, useful when getting data after saving fields - * array( 'posts' => array( ... ), 'users' => array( ... ), ... ). - * - * @note The 'refresh' parameter is temporal and might dissapear without prior notice when the groups and fields saving gets integrated in the fields definition factory - * - * @return null|array Field definition arrays, sanitized as per field type, or null if an error has occurred. - * @since 2.1 - */ - public function query_field_definitions( - /** @noinspection PhpUnusedParameterInspection */ $ignored, $query - ) { - $domain = wpcf_getarr( $query, 'domain', 'all' ); - - if( 'all' == $domain ) { - - // Call itself for each available domain. - $results_by_domain = array(); - $domains = Types_Field_Utils::get_domains(); - foreach( $domains as $field_domain ) { - $per_domain_query = $query; - $per_domain_query['domain'] = $field_domain; - $results_by_domain[ $field_domain ] = $this->query_field_definitions( null, $per_domain_query ); - } - - return $results_by_domain; - - } else { - - // Sanitize input - if( ! is_string( $domain ) || ! is_array( $query ) ) { - return null; - } - - // Get the factory by domain, and if it fails, try to convert from legacy meta_type value. - try { - $definition_factory = Types_Field_Utils::get_definition_factory_by_domain( $domain ); - } catch( InvalidArgumentException $e ) { - $definition_factory = null; - } - - if ( null == $definition_factory ) { - try { - $definition_factory = Types_Field_Utils::get_definition_factory_by_domain( Types_Field_Utils::legacy_meta_type_to_domain( $domain ) ); - } catch( InvalidArgumentException $e ) { - return null; - } - } - - // Allways query only Types fields. - $query['filter'] = 'types'; - - if ( - isset( $query['refresh'] ) - && $query['refresh'] - ) { - $definition_factory->clear_definition_storage(); - } - - /** @var WPCF_Field_Definition[] $definitions */ - $definitions = $definition_factory->query_definitions( $query ); - $definition_arrays = array(); - foreach( $definitions as $definition ) { - $definition_arrays[] = $definition->get_definition_array(); - } - - return $definition_arrays; - } - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/filter_get_field_group_ids_by_post_type.php b/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/filter_get_field_group_ids_by_post_type.php deleted file mode 100644 index 1940cf2..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/filter_get_field_group_ids_by_post_type.php +++ /dev/null @@ -1,52 +0,0 @@ -wpdb = ( null === $wpdb_di ? $wpdb : $wpdb_di ); - } - - - /** - * @param array $arguments Original action/filter arguments. - * - * @return string[] - */ - public function process_call( $arguments ) { - - $post_type = toolset_getarr( $arguments, 1 ); - - if( ! is_string( $post_type ) ) { - throw new InvalidArgumentException( 'Invalid argument for a post type.' ); - } - - $query = $this->wpdb->prepare( - "SELECT post_id FROM {$this->wpdb->postmeta} - WHERE - meta_key = '_wp_types_group_post_types' - AND ( - meta_value LIKE %s - OR meta_value = 'all' - OR meta_value REGEXP '^[,]+$' - ) - ORDER BY post_id ASC", - '%' . $post_type . '%' - ); - - $post_ids = $this->wpdb->get_col( $query ); - - return $post_ids; - - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/import_from_zip_file.php b/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/import_from_zip_file.php deleted file mode 100644 index 2587090..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/import_from_zip_file.php +++ /dev/null @@ -1,141 +0,0 @@ -get_data_from_file( $path ); - if( $import_data instanceof WP_Error ) { - return $import_data; - } elseif( null == $import_data ) { - return new WP_Error( 42, __( 'The import file could not be processed, it seems to be corrupted.', 'wpcf' ) ); - } - - $result = $this->hack_around_legacy_import_routine( $import_data, $args ); - - $message = ob_get_contents(); - ob_end_clean(); - - return $result; - } - - - - private function hack_around_legacy_import_routine( $import_data, $import_args = null ) { - - add_filter('wpcf_admin_message_store', '__return_false'); - - $_POST['overwrite-settings'] = isset( $import_args['overwrite-settings'] ) ? (bool) $import_args['overwrite-settings'] : false; - - $_POST['overwrite-groups'] = ( - isset( $import_args['overwrite-groups'] ) && 1 == $import_args['overwrite-groups'] - ? 1 - : 0 - ); - - $_POST['overwrite-fields'] = ( - isset( $import_args['overwrite-fields'] ) && 1 == $import_args['overwrite-fields'] - ? 1 - : 0 - ); - - $_POST['overwrite-types'] = ( - isset( $import_args['overwrite-types'] ) && 1 == $import_args['overwrite-types'] - ? 1 - : 0 - ); - - $_POST['overwrite-tax'] = ( - isset( $import_args['overwrite-tax'] ) && 1 == $import_args['overwrite-tax'] - ? 1 - : 0 - ); - - $_POST['post_relationship'] = isset( $import_args['post_relationship'] ) ? (bool) $import_args['post_relationship'] : false; - $_POST['delete-groups'] = isset( $import_args['delete-groups'] ) ? (bool) $import_args['delete-groups'] : false; - $_POST['delete-fields'] = isset( $import_args['delete-fields'] ) ? (bool) $import_args['delete-fields'] : false; - $_POST['delete-types'] = isset( $import_args['delete-types'] ) ? (bool) $import_args['delete-types'] : false; - $_POST['delete-tax'] = isset( $import_args['delete-tax'] ) ? (bool) $import_args['delete-tax'] : false; - - /** - * This can be emtpy string '' or 'wpvdemo', but this second option has a serious bug with xml parsing/looping - */ - $context = isset( $import_args['context'] ) ? $import_args['context'] : ''; - // Not sure if this is needed - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php'; - require_once WPCF_EMBEDDED_INC_ABSPATH . '/import-export.php'; - - // Prepare legacy arguments for Types_Data_Installer - $legacy_args = array(); - if ( isset($import_args['overwrite']) ){ - $legacy_args['force_import_post_name'] = wpcf_getarr( $import_args, 'overwrite', array() ); - } - if ( isset($import_args['skip']) ){ - $legacy_args['force_skip_post_name'] = wpcf_getarr( $import_args, 'skip', array() ); - } - if ( isset($import_args['duplicate']) ){ - $legacy_args['force_duplicate_post_name'] = wpcf_getarr( $import_args, 'duplicate', array() ); - } - - $result = wpcf_admin_import_data( $import_data, false, $context, $legacy_args ); - - return true; - } - - - private function get_data_from_file( $path ) { - - $info = pathinfo( $path ); - - $is_zip = $info['extension'] == 'zip' ? true : false; - - $data = null; - - if ( $is_zip ) { - - $zip = zip_open( $path ); - - if ( is_resource( $zip ) ) { - while( ( $zip_entry = zip_read( $zip ) ) !== false ) { - if ( zip_entry_name( $zip_entry ) == 'settings.xml' ) { - $data = @zip_entry_read( $zip_entry, zip_entry_filesize( $zip_entry ) ); - } - } - } else { - return new WP_Error( 42, __( 'Unable to open zip file', 'wpcf' ) ); - } - } else { - // Not a zip file, we'll use it directly - $data = @file_get_contents( $path ); - } - - return $data; - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/interface.php b/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/interface.php deleted file mode 100644 index 0d1360b..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/api/handler/interface.php +++ /dev/null @@ -1,16 +0,0 @@ -query_specific_domain( $field_domain, $query ); - } - - return $groups_by_domain; - - } else { - return $this->query_specific_domain( $domain, $query ); - } - - } - - - /** - * Query field groups from a single domain. - * - * @param string $domain One of the valid field domains. Legacy "meta type" values will be also accepted. - * @param array $query Query arguments for Types_Field_Group_Factory::query_groups(). - * - * @return null|Types_Field_Group[] Array of field groups or null on error. - * @since m2m - */ - private function query_specific_domain( $domain, $query ) { - - // Make sure we have a valid domain string. - $valid_domains = Types_Field_Utils::get_domains(); - if( !in_array( $domain, $valid_domains ) ) { - $domain = Types_Field_Utils::legacy_meta_type_to_domain( $domain ); - } - - // Pass the group query to the proper factory class. - try { - $group_factory = Types_Field_Group_Factory::get_factory_by_domain( $domain ); - $groups = $group_factory->query_groups( $query ); - } catch( Exception $e ) { - // We don't care, it's a failure. - return null; - } - - return $groups; - - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/asset/help_tab_loader.php b/backend/wordpress/wp-content/plugins/types/application/controllers/asset/help_tab_loader.php deleted file mode 100644 index fd99223..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/asset/help_tab_loader.php +++ /dev/null @@ -1,153 +0,0 @@ -get_help_content( $current_page ); - if( null == $help_content ) { - return; - } - - $args = array( - 'title' => wpcf_getarr( $help_content, 'title' ), - 'id' => 'wpcf', - 'content' => wpcf_getarr( $help_content, 'content' ), - 'callback' => false, - ); - - $screen->add_help_tab( $args ); - - $this->add_need_help_tab(); - - } - - - /** - * Need Help section for a bit advertising. - * - * @since 2.0 - */ - private function add_need_help_tab() { - - $args = array( - 'title' => __( 'Need More Help?', 'wpcf' ), - 'id' => 'custom_fields_group-need-help', - 'content' => wpcf_admin_help( 'need-more-help' ), - 'callback' => false, - ); - - $screen = get_current_screen(); - $screen->add_help_tab( $args ); - - } - - - /** - * Generate the configuration for help tab. - * - * The configuration needs to contain three keys: - * - title: Title of the tab. - * - template: Name of the Twig template (assuming the 'help' namespace is available) - * - context: Context object for Twig. - * - * @param string $page_name Name of current page. - * @return array|null Help tab configuration array or null when no help tab should be displayed. - * @since 2.0 - */ - private function get_help_config( $page_name ) { - - switch( $page_name ) { - case Types_Admin_Menu::PAGE_NAME_FIELD_CONTROL: - return Types_Page_Field_Control::get_instance()->get_help_config(); - - default: - return null; - } - } - - - /** - * Render help tab content from its configuration. - * - * @param string $page_name Name of current page. - * @return array|null Null when no help tab should be displayed, or an array with keys 'title' and 'content'. - * @since 2.0 - */ - private function get_help_content( $page_name ) { - - $config = $this->get_help_config( $page_name ); - if( null == $config ) { - return null; - } - - $twig = $this->get_twig(); - - return array( - 'title' => wpcf_getarr( $config, 'title' ), - 'content' => $twig->render( wpcf_getarr( $config, 'template' ), wpcf_getarr( $config, 'context' ) ) - ); - } - - - /** @var Twig_Environment|null */ - private $twig = null; - - - /** - * @return Twig_Environment Initialized Twig environment object for help tab content rendering. - * @throws Twig_Error_Loader - * @since 2.0 - */ - private function get_twig() { - if( null == $this->twig ) { - $loader = new Twig_Loader_Filesystem(); - $loader->addPath( TYPES_ABSPATH . '/application/views/help', 'help' ); - $this->twig = new Twig_Environment( $loader ); - } - return $this->twig; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/asset/manager.php b/backend/wordpress/wp-content/plugins/types/application/controllers/asset/manager.php deleted file mode 100644 index 3d90f1b..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/asset/manager.php +++ /dev/null @@ -1,147 +0,0 @@ -register_script( - self::SCRIPT_ADJUST_MENU_LINK, - TYPES_RELPATH . '/public/page/adjust_submenu_links.js', - array( 'jquery', 'underscore' ), - TYPES_VERSION - ); - - $this->register_script( - self::SCRIPT_SLUG_CONFLICT_CHECKER, - TYPES_RELPATH . '/public/js/slug_conflict_checker.js', - array( 'jquery', 'underscore' ), - TYPES_VERSION - ); - - $this->register_script( - self::SCRIPT_PAGE_EDIT_POST_TYPE, - TYPES_RELPATH . '/public/page/edit_post_type/main.js', - array( 'jquery', 'underscore', self::SCRIPT_SLUG_CONFLICT_CHECKER, self::SCRIPT_UTILS ), - TYPES_VERSION - ); - - $this->register_script( - self::SCRIPT_PAGE_EDIT_TAXONOMY, - TYPES_RELPATH . '/public/page/edit_taxonomy/main.js', - array( 'jquery', 'underscore', self::SCRIPT_SLUG_CONFLICT_CHECKER, self::SCRIPT_UTILS ), - TYPES_VERSION - ); - - $this->register_script( - self::SCRIPT_JQUERY_UI_VALIDATION, - WPCF_RES_RELPATH . '/js/jquery-form-validation/' . $this->choose_script_version( 'jquery.validate.min.js', 'jquery.validate.js'), - array( 'jquery' ), - '1.8.1' - ); - - - $this->register_script( - self::SCRIPT_ADDITIONAL_VALIDATION_RULES, - $this->get_additional_validation_script_url(), - array( 'jquery', self::SCRIPT_JQUERY_UI_VALIDATION ), - TYPES_VERSION - ); - - - return parent::__initialize_scripts(); - } - - - /** - * Unfortunately, we need to have this public because of the Divi. - * And, unfortunately, we can't define it as a constant because PHP < 5.6 doesn't support that. - * - * @since 2.2.7 - */ - public function get_additional_validation_script_url() { - return WPCF_RES_RELPATH . '/js/jquery-form-validation/additional-methods.min.js'; - } - - - /** - * Choose a production (usually minified) or debugging (non-minified) version of - * a script depending on the script debugging mode. - * - * See SCRIPT_DEBUG constant - * - * @param string $production_version File name of the production script version. - * @param string $debugging_version File name of the debugging script version. - * - * @return string - * @since 2.2.7 - */ - private function choose_script_version( $production_version, $debugging_version ) { - $is_debug_mode = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ); - return ( $is_debug_mode ? $debugging_version : $production_version ); - } - - - /** - * @param Toolset_Script $script - */ - public function register_toolset_script( $script ) { - if ( ! isset( $this->scripts[ $script->handle ] ) ) { - $this->scripts[ $script->handle ] = $script; - } - } - - - /** - * @param Toolset_Style $style - */ - public function register_toolset_style( $style ) { - if( !isset( $this->styles[ $style->handle ] ) ) { - $this->styles[ $style->handle ] = $style; - } - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/assets.php b/backend/wordpress/wp-content/plugins/types/application/controllers/assets.php deleted file mode 100644 index 9b7533e..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/assets.php +++ /dev/null @@ -1,57 +0,0 @@ -id ) ); - - $this->dialog_id = $dialog_id; - $this->twig = $twig; - $this->context = $context; - $this->template_name = $template_name; - - if( $late_register_assets ) { - $this->late_register_assets(); - } - - // We're going to render on the page we're creating this instance. - $this->init_screen_render(); - } - - - /** - * Render a predefined Twig template. - * - * @since 2.0 - */ - public function template() { - printf( - '', - esc_attr( $this->dialog_id ), - $this->twig->render( $this->template_name, $this->context ) - ); - } - - - /** - * Manually register dialog assets in Types_Asset_Manager because by now we have already missed the - * toolset_add_registered_styles and toolset_add_registered_scripts filters (but there is still enough time - * to enqueue). - * - * @since 2.0 - */ - protected function late_register_assets() { - /* - * Toolset_DialogBoxes::register_styles() no longer exists - * https://git.onthegosystems.com/toolset/toolset-common/commit/cb176128ac8382cebbad46a39848b4c76fdcc7a7 - * - // Get script and styles from parent methods, and register them manually. - $styles = $this->register_styles( array() ); - foreach( $styles as $style ) { - Types_Asset_Manager::get_instance()->register_toolset_style( $style ); - } - */ - - $scripts = $this->register_scripts( array() ); - foreach( $scripts as $script ) { - Types_Asset_Manager::get_instance()->register_toolset_script( $script ); - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/embedded.php b/backend/wordpress/wp-content/plugins/types/application/controllers/embedded.php deleted file mode 100644 index 76e2168..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/embedded.php +++ /dev/null @@ -1,30 +0,0 @@ -conversion_matrix ) { - - $simple_string_types = array( - 'audio', 'email', 'embed', 'file', 'google_address', 'image', 'numeric', 'phone', 'textfield', - 'url', 'video', 'colorpicker', 'textarea' - ); - - $allowed_conversion_source = array( - 'audio' => $simple_string_types, - 'colorpicker' => $simple_string_types, - 'checkbox' => array( 'checkbox' ), - 'checkboxes' => array( 'checkboxes' ), - 'date' => array( 'date' ), - 'email' => $simple_string_types, - 'embed' => $simple_string_types, - 'file' => $simple_string_types, - 'google_address' => $simple_string_types, - 'image' => $simple_string_types, - 'numeric' => $simple_string_types, - 'phone' => $simple_string_types, - 'radio' => array( 'radio' ), - 'select' => array( 'select' ), - 'skype' => array( 'skype' ), - 'textarea' => $simple_string_types, - 'textfield' => $simple_string_types, - 'url' => $simple_string_types, - 'video' => $simple_string_types, - 'wysiwyg' => array( 'wysiwyg' ), - ); - - - $filtered_conversion_matrix = array(); - foreach( $allowed_conversion_source as $field_type_slug => $allowed_conversions ) { - - /** - * wpcf_filter_field_control_change_type_allowed_types_from - * - * Filter the field types that you can switch to, given a type field - * - * @param string[] $allowed_conversions Valid targets for a given origin type. - * @param string $field_type_slug Field type to switch from. - * - * @since 1.8.9 - */ - $filtered_conversion_matrix[ $field_type_slug ] = apply_filters( 'wpcf_filter_field_control_change_type_allowed_types_from', $allowed_conversions, $field_type_slug ); - } - - - /** - * wpcf_filter_field_control_change_type_allowed_types - * - * Filter the pairs field type origin -> valid field type targets when using the fields control change field type feature - * - * @param array $allowed_conversion_matrix Valid correspondence between field types and target field types - * - * @since 1.8.9 - */ - $result = apply_filters( 'wpcf_filter_field_control_change_type_allowed_types', $filtered_conversion_matrix ); - - - $this->conversion_matrix = $result; - } - - return $this->conversion_matrix; - } - - - /** - * @param Types_Field_Type_Definition $type - * @return Types_Field_Type_Definition[] - */ - public function get_possible_conversions( $type ) { - - if( ! $type instanceof Types_Field_Type_Definition ) { - throw new InvalidArgumentException( 'Not a field type definition' ); - } - - $matrix = $this->get_conversion_matrix(); - $allowed_slugs = wpcf_ensarr( wpcf_getarr( $matrix, $type->get_slug() ) ); - $allowed_types = Types_Field_Type_Definition_Factory::get_instance()->load_multiple_definitions( $allowed_slugs ); - return $allowed_types; - } - - - /** - * @param Types_Field_Type_Definition $from_type - * @param Types_Field_Type_Definition $to_type - * - * @return bool - */ - public function is_conversion_possible( $from_type, $to_type ) { - - if( ! $from_type instanceof Types_Field_Type_Definition || ! $to_type instanceof Types_Field_Type_Definition ) { - throw new InvalidArgumentException( 'Not a field type definition' ); - } - - $possible_conversions = $this->get_possible_conversions( $from_type ); - - return in_array( $to_type->get_slug(), array_keys( $possible_conversions ) ); - } - - - public function is_conversion_two_way( $type_1, $type_2 ) { - if( ! $type_1 instanceof Types_Field_Type_Definition || ! $type_2 instanceof Types_Field_Type_Definition ) { - throw new InvalidArgumentException( 'Not a field type definition' ); - } - - return ( $this->is_conversion_possible( $type_1, $type_2 ) && $this->is_conversion_possible( $type_2, $type_1 ) ); - } - - - /** - * Disallow certain conversion from or to google address field. - * - * This is hooked into the wpcf_filter_field_control_change_type_allowed_types_from filter with higher priority - * than the Toolset Maps hook that adds the google_address field type to the conversion matrix. - * - * This way we can properly handle the allowed conversions not depending on the particular Toolset Maps version - * that is active. - * - * @param string[] $targets Field type slugs TO which the conversion is allowed from $origin. - * @param string $origin Field type slug FROM which the conversion can happen. - * - * @return string[] Updated $targets. - * @since 2.0 - */ - public function google_address_field_control_change_type_allowed_from( $targets, $origin ) { - - $disallowed_targets = array( - Types_Field_Type_Definition_Factory::DATE, - Types_Field_Type_Definition_Factory::CHECKBOX, - Types_Field_Type_Definition_Factory::CHECKBOXES, - Types_Field_Type_Definition_Factory::RADIO, - Types_Field_Type_Definition_Factory::SELECT, - Types_Field_Type_Definition_Factory::SKYPE, - Types_Field_Type_Definition_Factory::WYSIWYG - ); - - if( Types_Field_Type_Definition_Factory::GOOGLE_ADDRESS == $origin ) { - // Here we're filtering possible conversions FROM google address field - $safe_targets = array_diff( $targets, $disallowed_targets ); - $targets = $safe_targets; - } else if( in_array( $origin, $disallowed_targets ) ) { - // Here we're filtering possible conversions TO google address field from an undesired field type - if( in_array( Types_Field_Type_Definition_Factory::GOOGLE_ADDRESS, $targets ) ) { - $item_pos = array_search( Types_Field_Type_Definition_Factory::GOOGLE_ADDRESS, $targets ); - unset( $targets[ $item_pos ] ); - } - } - return $targets; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/field/utils.php b/backend/wordpress/wp-content/plugins/types/application/controllers/field/utils.php deleted file mode 100644 index a7b5df6..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/field/utils.php +++ /dev/null @@ -1,187 +0,0 @@ -get_post_type() == $group_post_type ) { - return $factory; - } - } - throw new InvalidArgumentException( 'Invalid field group post type.' ); - } - - - private static $domain_legacy_value_map = array( - self::DOMAIN_POSTS => 'postmeta', - self::DOMAIN_USERS => 'usermeta', - self::DOMAIN_TERMS => 'termmeta' - ); - - - /** - * Translate a field domain into a "meta_type" value, which is used in field definition arrays. - * - * @param string $domain - * @return string - * @since 2.0 - */ - public static function domain_to_legacy_meta_type( $domain ) { - return wpcf_getarr( self::$domain_legacy_value_map, $domain ); - } - - - /** - * Translate a "meta_type" value into a field domain name. - * - * @param $meta_type - * @return string - * @since 2.1 - */ - public static function legacy_meta_type_to_domain( $meta_type ) { - $map = array_flip( self::$domain_legacy_value_map ); - return wpcf_getarr( $map, $meta_type ); - } - - - /** - * Create a term field instance. - * - * @param string $field_slug Slug of existing field definition. - * @param int $term_id ID of the term where the field belongs. - * - * @return null|WPCF_Field_Instance Field instance or null if an error occurs. - * @since 1.9 - */ - public static function create_term_field_instance( $field_slug, $term_id ) { - try { - return new WPCF_Field_Instance_Term( WPCF_Field_Definition_Factory_Term::get_instance()->load_field_definition( $field_slug ), $term_id ); - } catch( Exception $e ) { - return null; - } - } - - - /** - * Obtain toolset-forms "field configuration", which is an array of settings for specific field instance. - * - * @param WPCF_Field_Instance $field - * - * @since 1.9 - * @return array - */ - public static function get_toolset_forms_field_config( $field ) { - return wptoolset_form_filter_types_field( - $field->get_definition()->get_definition_array(), - $field->get_object_id() - ); - } - - - /** - * Gather an unique array of field definitions from given groups. - * - * The groups are expected to belong to the same domain (term/post/user), otherwise problems may occur when - * field slugs conflict. - * - * @param Types_Field_Group[] $field_groups - * @return WPCF_Field_Definition[] - * @since 1.9 - */ - public static function get_field_definitions_from_groups( $field_groups ) { - $field_definitions = array(); - foreach( $field_groups as $group ) { - $group_field_definitions = $group->get_field_definitions(); - - foreach( $group_field_definitions as $field_definition ) { - $field_definitions[ $field_definition->get_slug() ] = $field_definition; - } - } - return $field_definitions; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/frontend.php b/backend/wordpress/wp-content/plugins/types/application/controllers/frontend.php deleted file mode 100644 index 80cabb7..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/frontend.php +++ /dev/null @@ -1,14 +0,0 @@ - array( 'a', 'b', '__key' => 'term' ) - * - * will translate into - * - * - * a - * b - * - * - * @since 2.1 - */ - const XML_KEY = '__key'; - - - /** - * Hash and checksum is used to check if a certain post types, custom field groups inside a module is changed. - * It's using MD5hash. This will be used by module manager to check if the module is updated (meaning the types - * definition) has changed. And it will alert the user that he is importing a different module. - * - * @link https://onthegosystems.myjetbrains.com/youtrack/issue/types-749#comment=102-105945 - */ - const XML_KEY_CHECKSUM = 'checksum'; - const XML_KEY_HASH = 'hash'; - - - /** - * '__types_id' is used as a unique identifier for CPT,Types taxonomy, custom fields groups, etc. As for the - * allowed values, it's usually using a slug as an identifier since this will not change during import/export. - * IDs on the otherhand will change after import. - * - * Now '__types_title' is just the title/label name corresponding to the '__types_id'. - * - * @link https://onthegosystems.myjetbrains.com/youtrack/issue/types-749#comment=102-105945 - */ - const XML_TYPES_ID = '__types_id'; - const XML_TYPES_TITLE = '__types_title'; - - - /** Element name for a single field group. */ - const XML_KEY_GROUP = 'group'; - - - /** Element name for a single field definition. */ - const XML_KEY_FIELD = 'field'; - - - /** - * Completely handle retrieving export data for field groups of one domain. - * - * @param string $domain Valid field domain. - * - * @return array Exported field groups. - * @since 2.1 - */ - public function export_field_groups_for_domain( $domain ) { - - $group_factory = Types_Field_Utils::get_group_factory_by_domain( $domain ); - $all_groups = $group_factory->query_groups(); - - // Each group will handle its own export. - $results = array(); - foreach ( $all_groups as $field_group ) { - $results[] = $field_group->get_export_object(); - } - - $results[ self::XML_KEY ] = self::XML_KEY_GROUP; - - return $results; - } - - - /** - * Completely handle retrieving export data for field definitions of one domain. - * - * @param string $domain Valid field domain. - * - * @return array Exported field definitions. - * @since 2.1 - */ - public function export_field_definitions_for_domain( $domain ) { - - $definition_factory = Types_Field_Utils::get_definition_factory_by_domain( $domain ); - $all_definitions = $definition_factory->query_definitions( array( 'filter' => 'types' ) ); - - // Each field definition will handle its own export. - $results = array(); - /** @var WPCF_Field_Definition $field_definition */ - foreach ( $all_definitions as $field_definition ) { - $results[] = $field_definition->get_export_object(); - } - - $results[ self::XML_KEY ] = self::XML_KEY_FIELD; - - return $results; - } - - - /** - * Generate a checksum for an to-be-exported object and store it. - * - * @param array $data An associative array representing an object. - * @param null|string[] $keys_for_checksum Array keys that should be used when generating the checksum. If null, - * the whole $data is used. - * @param null|string[] $keys_to_remove Array keys that should be _not_ used when generating the checksum. - * - * @return array The updated $data with XML_KEY_CHECKSUM and XML_KEY_HASH set. - * @since 2.1 - */ - public function add_checksum_to_object( $data, $keys_for_checksum = null, $keys_to_remove = null ) { - - // pluck requested keys - if ( null == $keys_for_checksum ) { - $checksum_source = $data; - } else { - $checksum_source = array(); - foreach ( $data as $key => $value ) { - if ( in_array( $key, $keys_for_checksum ) ) { - $checksum_source[ $key ] = $value; - } - } - } - - // unset undesired keys - if ( is_array( $keys_to_remove ) ) { - $checksum_source = $this->unset_recursive( $checksum_source, $keys_to_remove ); - } - - $checksum = $this->generate_checksum( $checksum_source ); - - $data[ self::XML_KEY_CHECKSUM ] = $checksum; - $data[ self::XML_KEY_HASH ] = $checksum; - - return $data; - } - - - /** - * Unset keys from a multidimensional array. - * - * @param array $unset_from The source array. - * @param array $unset_what Definition of keys that need to be unset. Each element of this array can be either - * a string, in which case it represents an key to be removed on the top level, or an 'key' => array( ... ) - * value, in which case the unsetting will happen in $unset_from['key']. - * - * For example, unsetting array( 'c', 'd' => array( 'b' ) ) from - * - * array( 'a' => 1, 'b' => 2, 'c' => array( 'a' => 1 ), 'd' => array( 'a' => 1, 'b' => 2 ) ) - * - * will return - * - * array( 'a' => 1, 'b' => 2, 'd' => array( 'a' => 1 ) ) - * - * @return array - * @since 2.1 - */ - private function unset_recursive( $unset_from, $unset_what ) { - if ( is_array( $unset_from ) ) { - - foreach ( $unset_what as $key => $value ) { - - if ( is_array( $value ) && isset( $unset_from[ $key ] ) ) { - $unset_from[ $key ] = $this->unset_recursive( $unset_from[ $key ], $value ); - } else { - unset( $unset_from[ $value ] ); - } - } - - } - - return $unset_from; - } - - - /** - * Add standard object annotation XML_TYPES_ID and XML_TYPES_TITLE. - * - * @param array $data An associative array representing an object. - * @param string $title - * @param string $id - * - * @return array Updated $data. - * @since 2.1 - */ - public function annotate_object( $data, $title, $id ) { - $data[ self::XML_TYPES_ID ] = $id; - $data[ self::XML_TYPES_TITLE ] = $title; - - return $data; - } - - - /** - * Generate a checksum for given object. - * - * Note: Do not touch this. - * - * @param array $data - * - * @return string Checksum - * @since 2.1 - */ - private function generate_checksum( $data ) { - return md5( maybe_serialize( $this->ksort_as_string( $data ) ) ); - } - - - /** - * Sort a multidimensional array by keys recursively. - * - * @param array|mixed $data - * - * @return array|mixed Sorted $data. - * @since 2.1 - */ - private function ksort_as_string( $data ) { - if ( is_array( $data ) ) { - ksort( $data, SORT_STRING ); - foreach ( $data as $key => $value ) { - $data[ $key ] = $this->ksort_as_string( $value ); - } - } - - return $data; - } - - - /** - * Import field definitions for given domain. - * - * Note: Currently only term fields are supported. - * - * @param string $domain Valid field domain. - * @param SimpleXMLElement $data Import data from XML. - * @param string $fields_key Node name where the field definitions can be found. - * @param bool $delete_other_fields If true, fields that are not being imported will be deleted from the site. - * @param array $field_settings Part of $_POST from the import form related to these fields. - * @param array $args Used for making skip/overwrite decisions per item (used for toolset-based themes import) - * - * @return array - */ - public function process_field_definition_import_per_domain( - $domain, - $data, - $fields_key, - $delete_other_fields, - $field_settings, - $args = array() - ) { - - $results = array(); - - $fields_to_preserve = array(); - - $fields_import_data = array(); - if ( isset( $data->$fields_key ) ) { - /** @noinspection PhpParamsInspection */ - $fields_import_data = $this->simplexmlelement_to_object( $data->$fields_key, true ); - $fields_import_data = isset( $fields_import_data[ Types_Import_Export::XML_KEY_FIELD ] ) - ? $fields_import_data[ Types_Import_Export::XML_KEY_FIELD ] : array(); - } - - foreach ( $fields_import_data as $field_import_data ) { - $field_slug = $field_import_data['slug']; - - // check if via $_POST the field is allowed - $import_field = isset( $field_settings[ $field_slug ] ) && isset( $field_settings[ $field_slug ]['add'] ); - - // on toolset based themes we allow every field - $import_field = array_key_exists( 'toolset-themes', $args ) ? true : $import_field; - - // User choices on import/update process (TBT toolset-based themes) - $field_import_data = tbt_user_choice( $args, $field_import_data ); - if ( array_key_exists( 'add', $field_import_data ) ) { - $import_field = $field_import_data['add']; - } - - if ( $import_field ) { - $result = $this->import_field_definition( $domain, $field_import_data ); - if ( $result['is_success'] ) { - $fields_to_preserve[] = $field_slug; - } - $results[] = array( - 'type' => ( $result['is_success'] ? 'success' : 'error' ), - 'content' => $result['display_message'] - ); - } - } - - $delete_results = $this->maybe_delete_fields( $domain, $delete_other_fields, $fields_to_preserve ); - $results = array_merge( $results, $delete_results ); - - return $results; - - } - - - /** - * @param string $domain - * @param bool $delete_other_fields - * @param string[] $fields_to_preserve Array of field slugs that should be preserved. - * - * @return array - */ - private function maybe_delete_fields( $domain, $delete_other_fields, $fields_to_preserve ) { - - $results = array(); - - $definition_factory = Types_Field_Utils::get_definition_factory_by_domain( $domain ); - $option_name = $definition_factory->get_option_name_workaround(); - - if ( $delete_other_fields ) { - - $fields_existing = wpcf_admin_fields_get_fields( false, false, false, $option_name, false, true ); - - foreach ( $fields_existing as $key => $existing_field_definition ) { - - if ( ! empty( $existing_field_definition['data']['controlled'] ) ) { - continue; - } - - $existing_field_slug = $existing_field_definition['slug']; - - if ( ! in_array( $existing_field_slug, $fields_to_preserve ) ) { - $results[] = array( - 'type' => 'success', - 'content' => sprintf( - __( 'User field "%s" deleted', 'wpcf' ), - $existing_field_definition['name'] - ) - ); - unset( $fields_existing[ $key ] ); - } - } - - update_option( $option_name, $fields_existing ); - } - - - return $results; - } - - - /** - * @param string $domain - * @param array $definition_array_import Field definition array (will contain some additional elements from the import file). - * - * @return array - */ - private function import_field_definition( $domain, $definition_array_import ) { - - $definition = array( - 'id' => $definition_array_import['id'], - 'name' => $definition_array_import['name'], - 'description' => isset( $definition_array_import['description'] ) ? $definition_array_import['description'] - : '', - 'type' => $definition_array_import['type'], - 'slug' => $definition_array_import['slug'], - 'data' => ( isset( $definition_array_import['data'] ) && is_array( $definition_array_import['data'] ) ) - ? $definition_array_import['data'] : array() - ); - - if ( isset( $definition_array_import['meta_key'] ) ) { - $definition['meta_key'] = $definition_array_import['meta_key']; - } - - // WPML - global $iclTranslationManagement; - if ( ! empty( $iclTranslationManagement ) && isset( $definition['wpml_action'] ) ) { - $iclTranslationManagement->settings['custom_fields_translation'][ wpcf_types_get_meta_prefix( $definition ) . $definition['slug'] ] = $definition['wpml_action']; - $iclTranslationManagement->save_settings(); - } - - $definition_factory = Types_Field_Utils::get_definition_factory_by_domain( $domain ); - $definition_factory->set_field_definition_workaround( $definition['slug'], $definition ); - - return array( - 'is_success' => true, - 'display_message' => sprintf( __( 'Term field "%s" added/updated', 'wpcf' ), $definition['name'] ) - ); - } - - - /** - * Import field definitions for given domain. - * - * Note: Currently only term fields are supported. - * - * @param string $domain Valid field domain. - * @param SimpleXMLElement $data Import data from XML. - * @param string $groups_key Node name where the field groups can be found. - * @param bool $bulk_overwrite_groups If true, all (conflicting) groups will be overwritten by the ones from import. - * @param bool $delete_other_groups If true, groups that are not being imported will be deleted from the site. - * @param array $group_settings Part of $_POST from the import form related to these groups. - * @param array $args Used for making skip/overwrite decisions per item (used for toolset-based themes import) - * - * @return array - */ - public function process_field_group_import_per_domain( - $domain, - $data, - $groups_key, - $bulk_overwrite_groups, - $delete_other_groups, - $group_settings, - $args = array() - ) { - - $results = array(); - $groups_to_preserve = array(); - - $groups_import_data = array(); - if ( isset( $data->$groups_key ) ) { - /** @noinspection PhpParamsInspection */ - $groups_import_data = $this->simplexmlelement_to_object( $data->$groups_key, true ); - $groups_import_data = isset( $groups_import_data[ Types_Import_Export::XML_KEY_GROUP ] ) - ? $groups_import_data[ Types_Import_Export::XML_KEY_GROUP ] : array(); - } - - foreach ( $groups_import_data as $group ) { - - // ID of group from the import file - $import_group_id = wpcf_getarr( $group, Types_Field_Group::XML_ID ); - - - if ( array_key_exists( 'toolset-themes', $args ) ) { - // Toolset Themes Import Way - $group = tbt_user_choice( $args, $group ); - - $group_should_be_imported = $this->tbt_group_should_be_imported( $group ); - - if ( array_key_exists( 'add', $group ) ) { - $group_actions['add'] = $group['add']; - } - } else { - // Types Import Way - $group_actions = wpcf_getarr( $group_settings, $import_group_id, array( 'add' => true ) ); - $group_should_be_imported = isset( $group_actions['add'] ); - } - - if ( $group_should_be_imported ) { - if ( $bulk_overwrite_groups // bulk overwrite (types import/export page) - || ( // OR... - array_key_exists( 'toolset-themes', $args ) // import with toolset themes - && ( // AND... - ! array_key_exists( 'update', $group ) // ADD for group is not SET (new item) - || $group['update'] // OR... UPDATE is set for item (user choice) - ) - ) - ) { - // OVERWRITE - $group_action = 'update'; - } else { - $group_action = wpcf_getarr( $group_actions, 'update', 'add', array( 'add', 'update' ) ); - } - } else { - $group_action = 'nothing'; - } - - $result = null; - - switch ( $group_action ) { - case 'add': - $result = $this->import_field_group( $domain, $group, 'create_new' ); - break; - case 'update': - $result = $this->import_field_group( $domain, $group, 'overwrite' ); - break; - } - - if ( null != $result ) { - $results[] = array( - 'type' => ( $result['is_success'] ? 'success' : 'error' ), - 'content' => $result['display_message'] - ); - if ( $result['is_success'] ) { - $groups_to_preserve[] = $result['new_group_id']; - } - } - - } - - $delete_results = $this->maybe_delete_groups( $domain, $delete_other_groups, $groups_to_preserve ); - $results = array_merge( $results, $delete_results ); - - return $results; - } - - - /** - * @param string $domain - * @param bool $delete_other_groups - * @param int[] $groups_to_preserve - * - * @return array - */ - private function maybe_delete_groups( $domain, $delete_other_groups, $groups_to_preserve ) { - - $results = array(); - if ( $delete_other_groups && ! empty( $groups_to_preserve ) ) { - $group_factory = Types_Field_Utils::get_group_factory_by_domain( $domain ); - $all_groups = $group_factory->query_groups(); - - foreach ( $all_groups as $group_to_delete ) { - if ( ! in_array( $group_to_delete->get_id(), $groups_to_preserve ) ) { - - $deleted_group_name = $group_to_delete->get_name(); - $deleted = wp_delete_post( $group_to_delete->get_id(), true ); - if ( ! $deleted ) { - $results[] = array( - 'type' => 'error', - 'content' => sprintf( __( 'Term field group "%s" delete failed', 'wpcf' ), - $deleted_group_name ) - ); - } else { - $results[] = array( - 'type' => 'success', - 'content' => sprintf( __( 'Term field group "%s" deleted', 'wpcf' ), $deleted_group_name ) - ); - } - - } - } - } - - return $results; - - } - - - /** - * @param string $domain Valid field domain - * @param array $group Field group import data as associative array. - * @param string $conflict_resolution = 'overwrite'|'create_new' Defines how to handle a situation when a - * field group already exists in the database. - * - * @return array Import results: - * 'is_success' bool - * 'display_message' string - * 'new_group_id' int - * - * @since 2.1 - */ - public function import_field_group( $domain, $group, $conflict_resolution ) { - - $group_slug = wpcf_getarr( $group, Types_Field_Group::XML_SLUG ); - - $group_factory = Types_Field_Utils::get_group_factory_by_domain( $domain ); - - $existing_groups = $group_factory->query_groups( array( 'name' => $group_slug ) ); - $group_already_exists = ( count( $existing_groups ) > 0 ); - - $new_post = array( - 'post_status' => $group['post_status'], - 'post_type' => $group_factory->get_post_type(), - 'post_title' => $group['post_title'], - 'post_content' => ! empty( $group['post_content'] ) ? $group['post_content'] : '', - ); - - $update_existing = ( $group_already_exists && 'overwrite' == $conflict_resolution ); - - if ( $update_existing ) { - $existing_group = $existing_groups[0]; - $new_post['ID'] = $existing_group->get_id(); - $new_group_id = wp_update_post( $new_post ); - } else { - $new_group_id = wp_insert_post( $new_post, true ); - } - - $is_success = ( ! is_wp_error( $new_group_id ) && 0 < $new_group_id ); - - // Update group's postmeta - if ( $is_success && ! empty( $group['meta'] ) ) { - foreach ( $group['meta'] as $meta_key => $meta_value ) { - if ( Types_Field_Group_Term::POSTMETA_ASSOCIATED_TAXONOMY == $meta_key ) { - $meta_values = explode( ',', $meta_value ); - delete_post_meta( $new_group_id, $meta_key ); - foreach ( $meta_values as $single_meta_value ) { - update_post_meta( $new_group_id, $meta_key, $single_meta_value ); - } - } else { - update_post_meta( $new_group_id, $meta_key, $meta_value ); - } - } - } - - // Create display message - if ( $is_success ) { - if ( $update_existing ) { - $display_message = sprintf( __( 'Term field group "%s" updated', 'wpcf' ), $group['post_title'] ); - } else { - $display_message = sprintf( __( 'Term field group "%s" added', 'wpcf' ), $group['post_title'] ); - } - } else { - if ( $update_existing ) { - $display_message = sprintf( __( 'Term field group "%s" update failed', 'wpcf' ), $group['post_title'] ); - } else { - $display_message = sprintf( __( 'Term field group "%s" insert failed', 'wpcf' ), $group['post_title'] ); - } - } - - return array( - 'is_success' => $is_success, - 'display_message' => $display_message, - 'new_group_id' => $new_group_id - ); - } - - - /** - * @param SimpleXMLElement $element - * @param bool $allways_expand_top_level - * - * @return array|null - */ - public function simplexmlelement_to_object( $element, $allways_expand_top_level = false ) { - $text_content = trim( (string) $element ); - if ( ! empty( $text_content ) ) { - return $text_content; - } - - if ( $element->count() > 0 ) { - $results_by_node_name = array(); - - /** @var SimpleXMLElement $child */ - foreach ( $element->children() as $child ) { - $child_name = $child->getName(); - - if ( ! isset( $results_by_node_name[ $child_name ] ) ) { - $results_by_node_name[ $child_name ] = array(); - } - - $results_by_node_name[ $child_name ][] = $this->simplexmlelement_to_object( $child, false ); - } - - $results = array(); - foreach ( $results_by_node_name as $node_name => $children ) { - $take_only_first_child = ( count( $children ) == 1 && ! $allways_expand_top_level ); - $results[ $node_name ] = ( $take_only_first_child ? $children[0] : $children ); - } - - return $results; - } - - return null; - } - - /** - * Determines if a group should be imported or not - * This is only relevant for the import process of Toolset Themes - * - * @param $group - * - * @return bool - */ - private function tbt_group_should_be_imported( $group ) { - if ( array_key_exists( 'add', $group ) && $group['add'] === false ) { - // the group already exists, but the user wants to keep his version ('add' === false) - return false; - } - - // import group (initial import / overwrite / duplicate) - return true; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/information/controller.php b/backend/wordpress/wp-content/plugins/types/application/controllers/information/controller.php deleted file mode 100644 index b541d36..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/information/controller.php +++ /dev/null @@ -1,244 +0,0 @@ -embedded_plugin_running() - || ! Types_Helper_Condition::get_post_type() - ) { - return false; - } - - return true; - } - - /** - * We don't want to show "archive" for media/pages and "template" for media - * - * @param $columns - * @param $post_type - * - * @return mixed - */ - public function filter_columns( $columns, $post_type ) { - if( $post_type != 'attachment' && $post_type != 'page' ) { - return $columns; - } - - if( array_key_exists( 'archive', $columns ) ) { - unset( $columns['archive'] ); - } - - if( $post_type == 'attachment' && array_key_exists( 'template', $columns ) ) { - unset( $columns['template'] ); - } - - return $columns; - } - - public function prepare() { - if( ! $this->requirements_met() ) - return false; - - // filter columns for specific post types - add_filter( 'types_information_table_columns', array( $this, 'filter_columns' ), 10, 2 ); - - // twig - $this->twig = new Types_Helper_Twig(); - - // script / style - add_action( 'admin_enqueue_scripts', array( $this, 'on_admin_enqueue_scripts' ) ); - - /* data files */ - $data_files = array( - TYPES_DATA . '/information/table/template.php', - TYPES_DATA . '/information/table/archive.php', - TYPES_DATA . '/information/table/views.php', - TYPES_DATA . '/information/table/forms.php', - ); - - $this->show_data_as_table_in_meta_box( $data_files ); - } - - public function on_admin_enqueue_scripts() { - - // script - wp_enqueue_script( - 'types-information', - TYPES_RELPATH . '/public/js/information.js', - array( 'jquery-ui-dialog', 'wp-pointer' ), - TYPES_VERSION, - true - ); - - // style - wp_enqueue_style( - 'types-information', - TYPES_RELPATH . '/public/css/information.css', - array( 'wp-jquery-ui-dialog', 'wp-pointer' ), - TYPES_VERSION - ); - - // load icons - wp_enqueue_style( - 'onthegosystems-icons', - WPCF_EMBEDDED_TOOLSET_RELPATH . '/onthego-resources/onthegosystems-icons/css/onthegosystems-icons.css', - array(), - TYPES_VERSION - ); - } - - protected function show_data_as_table_in_meta_box( $data_files ) { - // prepare meta box - $this->prepare_table_in_meta_box(); - - // thead - $thead_views = $this->thead_views_template_archive_views_forms(); - - // load infos - foreach( $data_files as $data_file ) { - $this->load_data_to_table( $data_file ); - } - - // table view - $output_inner = $this->twig->render( - '/information/table.twig', - array( - 'labels' => array( - 'or' => __( 'Or...', 'wpcf' ) - ), - 'thead' => $thead_views, - 'table' => $this->information - ) - ); - - // Replace Placeholders - Types_Helper_Placeholder::replace( $output_inner ); - - // no "echo" because we use meta-box as output - $this->information->render( $output_inner ); - } - - - protected function show_data_as_container_in_meta_box( $data_files ) { - // add container for warning messages - $this->information = new Types_Information_Container( 'types-informations-container' ); - // $this->information->cache_on_hook( 'edit_post' ); - - // add messages - foreach( $data_files as $data_file ) { - $this->load_data_to_table( $data_file ); - } - - // outer box - $output_meta_box = new Types_Helper_Output_Meta_Box(); - $output_meta_box->set_id( $this->information->get_id() ); - $output_meta_box->set_title( __( 'Front-end Display', 'wpcf' ) ); - // $output_meta_box->set_css_class( 'types-table-in-meta-box' ); - - $this->information->set_output_container( $output_meta_box ); - - $output_inner = $this->twig->render( - '/information/single.twig', - array( - 'icon' => 'dashicons dashicons-warning', - 'information' => $this->information - ) - ); - - // Replace Placeholders - Types_Helper_Placeholder::replace( $output_inner ); - - // no "echo" because we use meta-box as output - $this->information->render( $output_inner ); - } - - protected function load_data_to_table( $path ) { - $data = require( $path ); - - foreach( $data as $msg_id => $msg_data ) { - $msg = new Types_Information_Message(); - $msg_data['id'] = $msg_id; - $msg->data_import( $msg_data ); - $this->information->add_message( $msg ); - } - } - - protected function thead_views_template_archive_views_forms() { - - $thead_data = require( TYPES_DATA . '/information/table/question-marks.php' ); - $views = array(); - - $post_type = Types_Helper_Condition::get_post_type(); - - $allowed_columns = apply_filters( 'types_information_table_columns', array_fill_keys( array( 'template', 'archive', 'views', 'forms' ), '' ), $post_type->name ); - - foreach( $thead_data as $key => $column ) { - if( ! array_key_exists( $key, $allowed_columns ) ) - unset( $thead_data[$key] ); - } - - foreach( $thead_data as $data ) { - $views[] = $this->twig->render( - '/information/table/thead-cell.twig', - $data - ); - } - - return $views; - } - - protected function prepare_table_in_meta_box() { - // add dashboard - $this->information = new Types_Information_Table( 'types-information-table' ); - - // save on edit post - //$this->information->cache_on_hook( 'edit_post' ); - - // we want to display dashboard in a meta-box - $output_meta_box = new Types_Helper_Output_Meta_Box(); - $output_meta_box->set_id( $this->information->get_id() ); - $output_meta_box->set_title( __( 'Front-end Display', 'wpcf' ) ); - $output_meta_box->set_css_class( 'types-table-in-meta-box' ); - - $this->information->set_output_container( $output_meta_box ); - } - - /** - * Check if any embedded plugin is running. - * - * @todo Would be better placed in a helper. - * @return bool - */ - protected function embedded_plugin_running() { - - // check Layouts - if( defined( 'WPDDL_EMBEDDED' ) ) - return true; - - // check CRED - if( defined( 'CRED_FE_VERSION' ) && class_exists('CRED_Admin') === false ) - return true; - - // check Views - if( defined( 'WPV_VERSION' ) ) { - global $WP_Views; - - if( is_object( $WP_Views ) && method_exists( $WP_Views, 'is_embedded' )) - return $WP_Views->is_embedded(); - } - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/divi.php b/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/divi.php deleted file mode 100644 index 4912e98..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/divi.php +++ /dev/null @@ -1,90 +0,0 @@ -get_additional_validation_script_url(), - // add another dependency - array( 'jquery', 'validation', Types_Asset_Manager::SCRIPT_JQUERY_UI_VALIDATION ), - TYPES_VERSION - ); - - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/the7.php b/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/the7.php deleted file mode 100644 index 6156dbf..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/the7.php +++ /dev/null @@ -1,89 +0,0 @@ -add_hooks(); - } - - // Not giving away the instance on purpose. - } - - - /** - * Hook to the event of rendering the legacy editor code, which happens just before - * enqueuing assets. - */ - public function add_hooks() { - add_action( 'types_leagacy_editor_callback_init', array( $this, 'remove_presscore_hooks' ) ); - } - - - /** - * Fix a compatibility issue caused, simply put, by our own terrible mess. - * - * The issue was visible when activating The7 theme, Views and Types, on the Edit Content Template page (for example). - * When trying to add a Types field, the AJAX call to render the dialog markup has failed due to a fatal error. - * The result was that the dialog never opened and the user was left with the grey overlay and no error message. - * - * The fatal error was caused by the fact that the legacy code in Types, namely in embedded/includes/ajax/admin-header.php - * is running do_action( 'admin_enqueue_scripts', $hook_suffix ); outside of the context of the - * standard admin page loading mechanism. - * - * That causes problems in The7_Demo_Content_Admin::enqueue_scripts() (which is hooked even during this - * non-standard procedure): It accesses the global $tgmpa variable which is assumed to be - * an instance of The7_TGMPA but for some reason, it's never initialized. - * - * The workaround is also extremely ugly: We intercept the AJAX call that renders the dialog markup and check - * all admin_enqueue_scripts hooks. If its callback has a prefix coming from The7 theme, we'll remove the action. - * - * It is safe because we're targeting only a very specific scenario, where the theme's admin assets - * aren't needed at all. - * - * This can be removed when the dialog is finally refactored into something sensible. - * - * @since 2.2.16 - */ - public function remove_presscore_hooks() { - if ( toolset_getget( 'action' ) === 'wpcf_ajax' && toolset_getget( 'wpcf_action' ) === 'editor_callback' ) { - global $wp_filter; - /** @var WP_Hook $admin_enqueue_script_hooks */ - $admin_enqueue_script_hooks = toolset_getarr( $wp_filter, 'admin_enqueue_scripts', array() ); - - foreach ( $admin_enqueue_script_hooks->callbacks as $priority => $callbacks_for_priority ) { - foreach ( $callbacks_for_priority as $callback_id => $callback ) { - $function = $callback['function']; - - $the7_string_prefix = 'presscore_'; - $is_the7_string_callback = ( is_string( $function ) && substr( $function, 0, strlen( $the7_string_prefix ) ) === $the7_string_prefix ); - - $the7_class_prefix = 'The7_'; - $is_the7_class_callback = ( - is_array( $function ) - && count( $function ) === 2 - && substr( get_class( $function[0] ), 0, strlen( $the7_class_prefix ) ) === $the7_class_prefix - ); - - if ( $is_the7_class_callback || $is_the7_string_callback ) { - remove_action( 'admin_enqueue_scripts', $function, $priority ); - } - } - } - } - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/use_any_font.php b/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/use_any_font.php deleted file mode 100644 index 19bde8f..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/use_any_font.php +++ /dev/null @@ -1,62 +0,0 @@ -maybe_unregister_uaf_assets(); - } - - - /** - * Fix a compatibility issue with conflicting JS assets. - * - * Implemented for Use Any Font 4.6. - * - * On Edit Post Type page, UAF enqueues its own instance of jQuery UI Validation plugin which overwrites the one - * from Types, with added additional validation rules. - * - * Turns out, UAF enqueues everything everywhere without care although it has only a single admin page. - * In general, it has very bad coding practices (unprefixed function names, etc.) - * - * Here, we do what UAF should do on its own: Check if we're on its settings page and if - * we're not, avoid loading its assets. - * - * @since 2.2.9 - */ - function maybe_unregister_uaf_assets() { - $main_controller = Types_Main::get_instance(); - $is_uaf_settings_page = ( - $main_controller->get_plugin_mode() === Types_Main::MODE_ADMIN && wpcf_getget( 'page' ) === 'uaf_settings_page' - ); - - if ( ! $is_uaf_settings_page ) { - remove_action( 'admin_print_scripts', 'adminjslibs' ); - remove_action( 'admin_print_styles', 'adminCsslibs' ); - } - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/wpml.php b/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/wpml.php deleted file mode 100644 index 90d1fe1..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler/wpml.php +++ /dev/null @@ -1,93 +0,0 @@ - $domain, - 'name' => $string_name - ) - ); - - if ( $is_registered === null ) { - return false; - } - - // string is registered, return translation - return apply_filters( - 'wpml_translate_single_string', - $string, - $domain, - $string_name - ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler_interface.php b/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler_interface.php deleted file mode 100644 index 591945a..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/interop/handler_interface.php +++ /dev/null @@ -1,14 +0,0 @@ -initialize_interop_handlers(); - } - - // Not giving away the instance on purpose - } - - - /** - * Get definitions of all interop handlers. - * - * Each one has a method for checking whether the handler is needed - * and a name - there must be a corresponding class Types_Interop_Handler_{$name} - * implementing the Types_Interop_Handler_Interface. - * - * @return array - * @since 2.2.7 - */ - private function get_interop_handler_definitions() { - - $interop_handlers = array( - array( - 'is_needed' => array( $this, 'is_wpml_active' ), - 'class_name' => 'Wpml' - ), - array( - 'is_needed' => array( $this, 'is_divi_active' ), - 'class_name' => 'Divi' - ), - array( - 'is_needed' => array( $this, 'is_use_any_font_active' ), - 'class_name' => 'Use_Any_Font' - ), - array( - 'is_needed' => array( $this, 'is_the7_active' ), - 'class_name' => 'The7' - ), - ); - - return $interop_handlers; - } - - - /** - * Load and initialize interop handlers if the relevant plugin/theme is active. - * - * @since 2.2.7 - */ - public function initialize_interop_handlers() { - - /** - * types_get_interop_handler_definitions - * - * Allows for adjusting interop handlers. See Types_Interop_Mediator::get_interop_handler_definitions() for details. - * - * @since 2.2.17 - */ - $interop_handlers = apply_filters( 'types_get_interop_handler_definitions', $this->get_interop_handler_definitions() ); - - foreach ( $interop_handlers as $handler_definition ) { - $is_needed = call_user_func( $handler_definition['is_needed'] ); - - if ( $is_needed ) { - $handler_class_name = 'Types_Interop_Handler_' . $handler_definition['class_name']; - call_user_func( $handler_class_name . '::initialize' ); - } - } - } - - - /** - * Check whether WPML is active and configured. - * - * @return bool - * @since 2.2.7 - */ - protected function is_wpml_active() { - - global $sitepress; - $is_wpml_active = ( - defined( 'ICL_SITEPRESS_VERSION' ) - && ! ICL_PLUGIN_INACTIVE - && ! is_null( $sitepress ) - && class_exists( 'SitePress' ) - ); - - return $is_wpml_active; - } - - - /** - * Check whether the Divi theme is loaded. - * - * @return bool - */ - protected function is_divi_active() { - return function_exists( 'et_setup_theme' ); - } - - - /** - * Check whether the The7 theme is loaded. - * - * @return bool - */ - protected function is_the7_active() { - return ( 'the7' === $this->get_parent_theme_slug() ); - } - - - /** - * Check whether the Use Any Font plugin is loaded. - * - * @return bool - */ - protected function is_use_any_font_active() { - return function_exists( 'uaf_activate' ); - } - - - /** - * Retrieve a "slugized" theme name. - * - * @return string - * @since 2.2.16 - */ - private function get_parent_theme_slug() { - - /** - * @var WP_Theme|null $theme It should be WP_Theme but experience tells us that sometimes the theme - * manages to send an invalid value our way. - */ - $theme = wp_get_theme(); - - if( ! $theme instanceof WP_Theme ) { - // Something went wrong but we'll try to recover. - $theme_name = $this->get_theme_name_from_stylesheet(); - } elseif ( is_child_theme() ) { - - $parent_theme = $theme->parent(); - - // Because is_child_theme() can return true while $theme->parent() still returns false, oh dear god. - if( ! $parent_theme instanceof WP_Theme ) { - $theme_name = $this->get_theme_name_from_stylesheet(); - } else { - $theme_name = $parent_theme->get( 'Name' ); - } - } else { - $theme_name = $theme->get( 'Name' ); - } - - // Handle $theme->get() returning false when the Name header is not set. - if( false === $theme_name ) { - return ''; - } - - $slug = str_replace( '-', '_', sanitize_title( $theme_name ) ); - - return $slug; - } - - - private function get_theme_name_from_stylesheet() { - $theme_name = ''; - - $stylesheet = get_stylesheet(); - if( is_string( $stylesheet ) && ! empty( $stylesheet ) ) { - $theme_name = $stylesheet; - } - - return $theme_name; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/main.php b/backend/wordpress/wp-content/plugins/types/application/controllers/main.php deleted file mode 100644 index 725134f..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/main.php +++ /dev/null @@ -1,165 +0,0 @@ -mode = self::MODE_AJAX; - Types_Ajax::initialize(); - } else { - $this->mode = self::MODE_ADMIN; - Types_Admin::initialize(); - } - } else { - $this->mode = self::MODE_FRONTEND; - Types_Frontend::initialize(); - } - } - - - /** - * @var string One of the MODE_* constants. - */ - private $mode = self::MODE_UNDEFINED; - - const MODE_UNDEFINED = ''; - const MODE_AJAX = 'ajax'; - const MODE_ADMIN = 'admin'; - const MODE_FRONTEND = 'frontend'; - - /** - * Get current plugin mode. - * - * Possible values are: - * - MODE_UNDEFINED before the main controller initialization is completed - * - MODE_AJAX when doing an AJAX request - * - MODE_ADMIN when showing a WP admin page - * - MODE_FRONTEND when rendering a frontend page - * - * @return string - * @since 2.1 - */ - public function get_plugin_mode() { - return $this->mode; - } - - - /** - * Set current plugin mode. - * - * @param string $new_mode the new plugin mode - * @return bool TRUE if set is succesfully done, FALSE otherwise - * @since 2.2 - */ - public function set_plugin_mode( $new_mode = self::MODE_UNDEFINED ) { - if ( !in_array( $new_mode, array( self::MODE_UNDEFINED, self::MODE_AJAX, self::MODE_ADMIN, self::MODE_FRONTEND ) ) ){ - return false; - } - $this->mode = $new_mode; - return true; - } - - - /** - * Determine whether a WP admin page is being loaded. - * - * Note that the behaviour differs from the native is_admin() which will return true also for AJAX requests. - * - * @return bool - * @since 2.1 - */ - public function is_admin() { - return ( $this->get_plugin_mode() == self::MODE_ADMIN ); - } - - - /** - * Early loading actions. - * - * @since 2.0 - */ - public function after_setup_theme() { - - // Initialize the Toolset Common library - Toolset_Common_Bootstrap::get_instance(); - - $this->setup_autoloader(); - - // If an AJAX callback handler needs other assets, it should initialize the asset manager by itself. - if( $this->get_plugin_mode() != self::MODE_AJAX ) { - Types_Assets::get_instance()->initialize_scripts_and_styles(); - } - - // Handle embedded plugin mode - Types_Embedded::initialize(); - - Types_Api::initialize(); - - Types_Interop_Mediator::initialize(); - } - - - private function setup_autoloader() { - - // It is possible to regenerate the classmap with Zend framework. - // - // See the "recreate_classmap.sh" script in the plugin root directory. - $classmap = include( TYPES_ABSPATH . '/application/autoload_classmap.php' ); - - // Use Toolset_Common_Autoloader - do_action( 'toolset_register_classmap', $classmap ); - - } - - - /** - * In some cases, it may not be clear what legacy files are includes and what aren't. - * - * This method should make sure all is covered (add files when needed). Use only when necessary. - * - * @since 2.0 - */ - public function require_legacy_functions() { - require_once WPCF_INC_ABSPATH . '/fields.php'; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/abstract.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/abstract.php deleted file mode 100644 index 6dc3c05..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/abstract.php +++ /dev/null @@ -1,84 +0,0 @@ -disable_heartbeat ) { - wp_deregister_script( 'heartbeat' ); - wp_register_script( 'heartbeat', false ); - } - } - - - /** - * Title to be displayed on the menu as well in the page title. - * - * @return string - * @since 2.0 - */ - abstract public function get_title(); - - - /** - * Callback for the page rendering action. - * - * @return callable - * @since 2.0 - */ - abstract public function get_render_callback(); - - - /** - * Callback for the page load action (load-{$hook}). - * - * @return null|callable Optional. - * @since 2.0 - */ - public function get_load_callback() { - return null; - } - - - /** - * Page name slug. - * - * Should be taken directly from constants in Types_Admin_Menu. - * - * @return string - * @since 2.0 - */ - abstract public function get_page_name(); - - - /** - * User capability required to display the submenu item and access the page. - * - * @return string - * @since 2.0 - */ - abstract public function get_required_capability(); - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/dashboard.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/dashboard.php deleted file mode 100644 index 0ac74a8..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/dashboard.php +++ /dev/null @@ -1,528 +0,0 @@ -help_information(); - } - - public function register_page_dashboard_in_menu( $pages ) { - array_unshift( $pages, array( - 'slug' => 'toolset-dashboard', - 'menu_title' => $this->get_menu_title(), - 'page_title' => $this->get_title(), - 'callback' => $this->get_render_callback() - ) ); - - return $pages; - } - - - /** - * @inheritdoc - * @return string - */ - public function get_title() { - return __( 'Toolset Dashboard', 'wpcf' ); - } - - /** - * @inheritdoc - * @return string - */ - public function get_menu_title() { - return __( 'Dashboard', 'wpcf' ); - } - - - /** - * @inheritdoc - * @return callable - */ - public function get_render_callback() { - return array( $this, 'render_page' ); - } - - - /** - * @inheritdoc - * @return string - */ - public function get_page_name() { - return Types_Admin_Menu::PAGE_NAME_DASHBOARD; - } - - - /** - * @inheritdoc - * @return string - */ - public function get_required_capability() { - return 'manage_options'; // todo better role/cap handling - } - - - /** - * @inheritdoc - * @return callable - */ - public function get_load_callback() { - return null; - } - - - public function on_admin_enqueue_scripts() { - $main_handle = 'types-page-dashboard-main'; - - // script - wp_enqueue_script( - $main_handle, - TYPES_RELPATH . '/public/js/information.js', - array( 'jquery-ui-dialog', 'wp-pointer' ), - TYPES_VERSION, - true - ); - - // style - wp_enqueue_style( - $main_handle, - TYPES_RELPATH . '/public/css/information.css', - array( 'wp-jquery-ui-dialog', 'wp-pointer' ), - TYPES_VERSION - ); - - // load icons - wp_enqueue_style( - 'onthegosystems-icons', - WPCF_EMBEDDED_TOOLSET_RELPATH . '/onthego-resources/onthegosystems-icons/css/onthegosystems-icons.css', - array(), - TYPES_VERSION - ); - } - - - private function get_twig() { - if( $this->twig == null ) - $this->twig = new Types_Helper_Twig(); - - return $this->twig; - } - - - /** - * @inheritdoc - * - * @since 2.1 - */ - public function render_page() { - - $context = $this->build_page_context(); - - echo $this->get_twig()->render( '/page/dashboard/main.twig', $context ); - } - - - /** - * Build the context for main page template. - * - * @return array Page context. See the main page template for details. - * @since 2.1 - */ - private function build_page_context() { - $this->get_dashboard(); - - $context = array( - 'page' => self::get_instance(), - 'table_toolset' => $this->table_toolset, - 'table_3rd' => $this->table_3rd, - 'table_wordpress' => $this->table_wordpress, - 'labels' => array( - 'create_type' => __( 'Add new post type', 'wpcf' ), - 'msg_no_custom_post_types' => - __( 'To get started, create your first custom type. Then, you will be able to add fields and taxonomy and design how it displays.', 'wpcf' ) - ) - - ); - - return $context; - } - - /** - * Types by Toolset - * - * @return array - */ - private function get_types_by_toolset() { - if( $this->types_by_toolset !== null ) - return $this->types_by_toolset; - - $post_type_option = new Types_Utils_Post_Type_Option(); - - $cpts_raw = ! isset( $_GET['toolset-dashboard-simulate-no-custom-post-types'] ) - ? $post_type_option->get_post_types() - : array(); - - // remove buildin types - $cpts_raw = array_diff_key( $cpts_raw, $this->get_types_by_wordpress() ); - - $cpts = array(); - - foreach( $cpts_raw as $cpt_raw ) { - $post_type = new Types_Post_Type( $cpt_raw['slug'] ); - // only use active post types - if( isset( $post_type->name ) ) - $cpts[$cpt_raw['slug']] = $post_type; - } - - uasort( $cpts, array( $this, 'sort_post_types_by_name' ) ); - - $this->types_by_toolset = $cpts; - return $this->types_by_toolset; - } - - /** - * Types by WordPress - * @return array - */ - private function get_types_by_wordpress() { - if( $this->types_by_wordpress !== null ) - return $this->types_by_wordpress; - - $cpts_raw = array( - 'post' => array( - 'slug' => 'post', - '_buildin' => 1 - ), - 'page' => array( - 'slug' => 'page', - '_buildin' => 1 - ), - 'attachment' => array( - 'slug' => 'attachment', - '_buildin' => 1 - ), - ); - - $cpts = array(); - foreach( $cpts_raw as $cpt_raw ) { - $post_type = new Types_Post_Type( $cpt_raw['slug'] ); - // only use active post types - if( isset( $post_type->name ) ) - $cpts[$cpt_raw['slug']] = $post_type; - } - - uasort( $cpts, array( $this, 'sort_post_types_by_name' ) ); - $this->types_by_wordpress = $cpts; - - return $this->types_by_wordpress; - } - - /** - * Types by 3rd (by themes/plugins) - * @return array - */ - private function get_types_by_3rd() { - if( $this->types_by_3rd !== null ) - return $this->types_by_3rd; - - $cpts_raw = get_post_types( array( 'public' => true ) ); - $cpts = array(); - foreach( $cpts_raw as $cpt_slug => $cpt_raw ) { - $post_type = new Types_Post_Type( $cpt_slug ); - // only use active post types - if( isset( $post_type->name ) ) - $cpts[$cpt_slug] = $post_type; - } - - $cpts = array_diff_key( $cpts, $this->get_types_by_wordpress(), $this->get_types_by_toolset() ); - - uasort( $cpts, array( $this, 'sort_post_types_by_name' ) ); - $this->types_by_3rd = $cpts; - - return $this->types_by_3rd; - } - - private function sort_post_types_by_name( $a, $b ) { - return strcasecmp( $a->name, $b->name ) > 0 ? true : false; - } - - private function get_post_types_filtered_by_screen_options( $cpts = false ) { - if( $cpts === false ) - $cpts = array_merge( $this->get_types_by_toolset(), $this->get_types_by_wordpress(), $this->get_types_by_3rd() ); - - $cpts_filtered = array(); - - $user = get_current_user_id(); - $user_settings = get_user_meta($user, 'toolset_dashboard_screen_post_types', true ); - - // no user settings yet - if( empty( $user_settings ) ) { - - // by default no media - if( isset( $cpts['attachment'] ) ) { - unset( $cpts['attachment'] ); - } - - - $cpts_filtered = $cpts; - } else { - foreach( $cpts as $post_type => $cpt ) { - // default for post/page/media is unchecked - if( ! isset( $user_settings[$post_type] ) - && ( $post_type == 'post' || $post_type == 'page' || $post_type == 'attachment' ) - ) continue; - - if( !empty( $user_settings ) ) { - - if( ! isset( $user_settings[$post_type] ) // default = checked - || $user_settings[$post_type] == 'on' ) // checked by user - $cpts_filtered[$post_type] = $cpt; - } - } - } - - return $cpts_filtered; - } - - private function get_dashboard() { - // Types by Toolset - $post_types = $this->get_post_types_filtered_by_screen_options( $this->get_types_by_toolset() ); - - if( ! empty( $post_types ) ) - $this->table_toolset = $this->get_dashboard_types_table( - $post_types, - __( 'Custom post types that you created with Toolset', 'wpcf' ) - ); - - - // Types by 3rd - $post_types = $this->get_post_types_filtered_by_screen_options( $this->get_types_by_3rd() ); - - if( ! empty( $post_types ) ) - $this->table_3rd = $this->get_dashboard_types_table( - $post_types, - __( 'Custom post types created by the theme and other plugins', 'wpcf' ), - false - ); - - - // Types by Wordpress - $post_types = $this->get_post_types_filtered_by_screen_options( $this->get_types_by_wordpress() ); - - if( ! empty( $post_types ) ) - $this->table_wordpress = $this->get_dashboard_types_table( - $post_types, - __( 'Built-in post types created by WordPress', 'wpcf' ), - false - ); - - } - - protected function load_data_to_table( $path, &$info ) { - $data = require( $path ); - - foreach( $data as $msg_id => $msg_data ) { - $msg = new Types_Information_Message(); - $msg_data['id'] = $msg_id; - $msg->data_import( $msg_data ); - $info->add_message( $msg ); - } - } - - public function screen_settings( $status, $args ) { - $return = $status; - - $cpts_filtered = $this->get_post_types_filtered_by_screen_options(); - - // Types by Toolset - $cpts = $this->get_types_by_toolset(); - if( ! empty( $cpts ) ) { - $string_legend = __( 'Custom post types that you created with Toolset', 'wpcf' ); - $return .= $this->screen_settings_fieldset( $cpts, $cpts_filtered, $string_legend ); - } - - // Types by 3rd - $cpts = $this->get_types_by_3rd(); - if( ! empty( $cpts ) ) { - $string_legend = __( 'Custom post types created by the theme and other plugins', 'wpcf' ); - $return .= $this->screen_settings_fieldset( $cpts, $cpts_filtered, $string_legend ); - } - - // Types by WordPress - $cpts = $this->get_types_by_wordpress(); - $string_legend = __( 'Built-in post types created by WordPress', 'wpcf' ); - $return .= $this->screen_settings_fieldset( $cpts, $cpts_filtered, $string_legend ); - - $return .= get_submit_button( __( 'Apply' ), 'button button-primary', 'screen-options-apply', false ); - return $return; - } - - private function screen_settings_fieldset( $cpts, $cpts_filtered, $legend ) { - $string = ' -
- ' . $legend . ' -
-
-
-
'; - foreach( $cpts as $cpt ) { - $checked = isset( $cpts_filtered[$cpt->get_name()] ) ? ' checked="checked" ' : ' '; - $string .= ''; - $string .= ''; - } - $string .= '
-
-
-
- '; - - return $string; - } - - public function screen_settings_save($status, $option, $value) { - if ( 'toolset_dashboard_screen_post_types' == $option ) { - if ( is_array( $_POST['toolset_dashboard_screen_post_types'] ) ) { - $toolset_dashboard_screen_post_types = array(); - foreach( $_POST['toolset_dashboard_screen_post_types'] as $tdspt_key => $tdspt_value ) { - $tdspt_key = sanitize_text_field( $tdspt_key ); - $tdspt_value = sanitize_text_field( $tdspt_value ); - $toolset_dashboard_screen_post_types[ $tdspt_key ] = $tdspt_value; - } - } else { - $toolset_dashboard_screen_post_types = sanitize_text_field( $_POST['toolset_dashboard_screen_post_types'] ); - } - $value = $toolset_dashboard_screen_post_types; - } - return $value; - } - - - private function help_information() { - $title = __('Toolset Dashboard', 'wpcf'); - $help_content = $this->get_twig()->render( - '/page/dashboard/help.twig', - array( 'title' => $title ) - ); - - $screen = get_current_screen(); - $screen->add_help_tab( - array( - 'id' => 'toolset-dashboard-information', - 'title' => $title, - 'content' => $help_content, - ) - ); - } - - /** - * @param $post_types - * @param $headline - * - * @return string - */ - private function get_dashboard_types_table( $post_types, $headline, $post_type_edit_link = true ) { - // documentation urls - $documentation_urls = include( TYPES_DATA . '/documentation-urls.php' ); - - // add links to use analytics - Types_Helper_Url::add_urls( $documentation_urls ); - - // set analytics medium - Types_Helper_Url::set_medium( 'dashboard' ); - - /* messages */ - $messages_files = array( - TYPES_DATA . '/dashboard/table/template.php', - TYPES_DATA . '/dashboard/table/archive.php', - TYPES_DATA . '/dashboard/table/views.php', - TYPES_DATA . '/dashboard/table/forms.php', - ); - - // add dashboard - $rows = ''; - - foreach( $post_types as $post_type ) { - $info_post_type = new Types_Information_Table( 'types-information-table' ); - Types_Helper_Condition::set_post_type( $post_type->get_name() ); - Types_Helper_Placeholder::set_post_type( $post_type->get_name() ); - - foreach( $messages_files as $message_file ) { - $this->load_data_to_table( $message_file, $info_post_type ); - } - - $row = $this->get_twig()->render( - '/page/dashboard/table/tbody-row.twig', - array( - 'labels' => array( - 'or' => __( 'Or...', 'wpcf' ), - 'create_taxonomy' => __( 'Create taxonomy', 'wpcf' ), - 'create_field_group' => __( 'Create field group', 'wpcf' ), - 'no_archive_for' => __( 'No archive available for %s', 'wpcf' ), - ), - 'admin_url' => admin_url(), - 'post_type' => $post_type, - 'table' => $info_post_type, - 'post_type_edit_link' => $post_type_edit_link - ) - ); - - Types_Helper_Placeholder::replace( $row ); - $rows .= $row; - } - - - // table view - $data_thead = require( TYPES_DATA . '/dashboard/table/head.php' ); - $table = $this->get_twig()->render( - '/page/dashboard/table.twig', - array( - 'labels' => array( - 'headline' => $headline, - 'admin' => __( 'WordPress admin', 'wpcf' ), - 'frontend' => __( 'Front-end', 'wpcf' ), - 'or' => __( 'Or...', 'wpcf' ), - ), - 'admin_url' => admin_url(), - 'thead' => $data_thead, - 'rows' => $rows - ) - ); - - return $table; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post.php deleted file mode 100644 index d98994f..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post.php +++ /dev/null @@ -1,63 +0,0 @@ -get_post_types(); - - // abort if also no custom post type of types - if( ! array_key_exists( $post_type, $custom_types ) ) - return false; - } - - $this->prepare(); - } - - private function __clone() { } - - - public function prepare() { - // documentation urls - Types_Helper_Url::load_documentation_urls(); - - // set analytics medium - Types_Helper_Url::set_medium( 'post_editor' ); - - // add information - $this->prepare_information(); - - // @todo load scripts - if( function_exists( 'wpcf_edit_post_screen_scripts' ) ) - wpcf_edit_post_screen_scripts(); - } - - private function prepare_information() { - $setting = new Types_Setting_Preset_Information_Table(); - - if( ! $setting->get_value( 'show-on-post' ) ) - return false; - - $information = new Types_Information_Controller; - $information->prepare(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post_fields.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post_fields.php deleted file mode 100644 index f13f5fe..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post_fields.php +++ /dev/null @@ -1,62 +0,0 @@ -prepare(); - } - - private function __clone() { } - - - public function prepare() { - // documentation urls - Types_Helper_Url::load_documentation_urls(); - - // set analytics medium - Types_Helper_Url::set_medium( 'field_group_editor' ); - - // add informations - $this->prepare_informations(); - - } - - private function prepare_informations() { - $setting = new Types_Setting_Preset_Information_Table(); - - if( ! $setting->get_value( 'show-on-field-group' ) ) - return false; - - $information = new Types_Information_Controller; - $information->prepare(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post_type.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post_type.php deleted file mode 100644 index 47ea644..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/edit_post_type.php +++ /dev/null @@ -1,55 +0,0 @@ -prepare(); - } - - private function __clone() { } - - - public function prepare() { - // documentation urls - Types_Helper_Url::load_documentation_urls(); - - // set analytics medium - Types_Helper_Url::set_medium( 'cpt_editor' ); - - // add informations - $this->prepare_informations(); - - } - - private function prepare_informations() { - $setting = new Types_Setting_Preset_Information_Table(); - - if( ! $setting->get_value( 'show-on-post-type' ) ) - return false; - - $information = new Types_Information_Controller; - $information->prepare(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/settings.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/settings.php deleted file mode 100644 index 70e0fe8..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/extension/settings.php +++ /dev/null @@ -1,86 +0,0 @@ -get_id()] = array( - 'slug' => $setting->get_id(), - 'title' => __( '"Front-end Display" table', 'wpcf' ), - 'content' => $view->render( - '/setting/checkbox.twig', - array( - 'description' => __( 'Show information about Template, Archive, Views and Forms on:', 'wpcf' ), - 'setting' => $setting, - ) - ) - ); - - return $sections; - } - - /** - * Admin Scripts - */ - public function on_admin_enqueue_scripts() { - // script - wp_enqueue_script( - 'types-toolset-settings', - TYPES_RELPATH . '/public/js/settings.js', - array(), - TYPES_VERSION, - true - ); - } - - public function print_admin_scripts() { - echo ''; - } - - /** - * Build data to be passed to JavaScript. - * - * @return array - * @since 2.1 - */ - private function build_js_data() { - - $types_settings_action = Types_Ajax::get_instance()->get_action_js_name( Types_Ajax::CALLBACK_SETTINGS_ACTION ); - - return array( - 'ajaxInfo' => array( - 'fieldAction' => array( - 'name' => $types_settings_action, - 'nonce' => wp_create_nonce( $types_settings_action ) - ) - ), - ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/field_control.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/field_control.php deleted file mode 100644 index 600ef39..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/field_control.php +++ /dev/null @@ -1,619 +0,0 @@ - Types_Admin_Menu::PAGE_NAME_FIELD_CONTROL, 'domain' => $domain ), - admin_url( 'admin.php' ) - ) - ); - } - - - /** - * @inheritdoc - * - * Validate field domain, which must be part of the GET request. - * - * @throws InvalidArgumentException when the domain is invalid. - * @since 2.0 - */ - public function prepare() { - - parent::prepare(); - - $current_domain = $this->get_current_domain(); - - // Fail on invalid domain. - if( null == $current_domain ) { - throw new InvalidArgumentException( - sprintf( - __( 'Invalid field domain provided. Expected one of those values: %s', 'wpcf' ), - implode( ', ', Types_Field_Utils::get_domains() ) - ) - ); - } - - add_action( 'admin_enqueue_scripts', array( $this, 'on_admin_enqueue_scripts' ) ); - - add_action( 'current_screen', array( $this, 'prepare_dialogs' ) ); - - } - - - /** - * @inheritdoc - * @return string - */ - public function get_title() { - - switch( $this->get_current_domain() ) { - case Types_Field_Utils::DOMAIN_POSTS: - return __( 'Post Field Control', 'wpcf' ); - case Types_Field_Utils::DOMAIN_USERS: - return __( 'User Field Control', 'wpcf' ); - case Types_Field_Utils::DOMAIN_TERMS: - return __( 'Term Field Control', 'wpcf' ); - default: - // will never happen - return ''; - } - } - - - /** - * @inheritdoc - * @return callable - */ - public function get_render_callback() { - return array( $this, 'render_page' ); - } - - - /** - * @inheritdoc - * @return string - */ - public function get_page_name() { - return Types_Admin_Menu::PAGE_NAME_FIELD_CONTROL; - } - - - /** - * @inheritdoc - * @return string - */ - public function get_required_capability() { - return 'manage_options'; // todo better role/cap handling - } - - - /** - * @inheritdoc - * @return callable - */ - public function get_load_callback() { - return array( $this, 'add_screen_options' ); - } - - - /** - * Current field domain. - * - * @return string|null - * @since 2.0 - */ - private function get_current_domain() { - if( null == $this->current_domain ) { - $this->current_domain = wpcf_getget( self::PARAM_DOMAIN, null, Types_Field_Utils::get_domains() ); - } - return $this->current_domain; - } - - - public function on_admin_enqueue_scripts() { - - $main_handle = 'types-page-field-control-main'; - - // Enqueuing with the wp-admin dependency because we need to override something !important. - Types_Asset_Manager::get_instance()->enqueue_styles( - array( - 'wp-admin', - 'common', - 'font-awesome', - 'wpcf-css-embedded', - 'wp-jquery-ui-dialog' - ) - ); - - wp_enqueue_style( - $main_handle, - TYPES_RELPATH . '/public/page/field_control/style.css' - ); - - wp_enqueue_script( - $main_handle, - TYPES_RELPATH . '/public/page/field_control/main.js', - array( - 'jquery', 'backbone', 'underscore', - Types_Asset_Manager::SCRIPT_HEADJS, - Types_Asset_Manager::SCRIPT_ADJUST_MENU_LINK, - Types_Asset_Manager::SCRIPT_KNOCKOUT, - Types_Asset_Manager::SCRIPT_UTILS - ), - TYPES_VERSION - ); - - } - - - private $twig = null; - - - private function get_twig() { - if( null == $this->twig ) { - $loader = new Twig_Loader_Filesystem(); - $loader->addPath( TYPES_ABSPATH . '/application/views/page', 'generic_page' ); - $loader->addPath( TYPES_ABSPATH . '/application/views/page/field_control', 'field_control' ); - $this->twig = new Twig_Environment( $loader ); - } - return $this->twig; - } - - - /** - * @inheritdoc - * - * @since 2.0 - */ - public function render_page() { - - $context = $this->build_page_context(); - - echo $this->get_twig()->render( '@field_control/main.twig', $context ); - } - - - /** - * Build the context for main poge template. - * - * That includes variables for the template as well as data to be passed to JavaScript. - * - * @return array Page context. See the main page template for details. - * @since 2.0 - */ - private function build_page_context() { - - $context = array( - 'strings' => $this->build_strings_for_twig(), - 'js_model_data' => base64_encode( wp_json_encode( $this->build_js_data() ) ), - 'assets' => array( - 'loaderOverlay' => Types_Assets::get_instance()->get_image_url( Types_Assets::IMG_AJAX_LOADER_OVERLAY ) - ) - ); - - return $context; - } - - - /** - * Build data to be passed to JavaScript. - * - * @return array - * @since 2.0 - */ - private function build_js_data() { - - $field_action_name = Types_Ajax::get_instance()->get_action_js_name( Types_Ajax::CALLBACK_FIELD_CONTROL_ACTION ); - - return array( - 'jsIncludePath' => TYPES_RELPATH . '/public/page/field_control', - 'fieldDefinitions' => $this->build_field_definitions(), - 'fieldTypeDefinitions' => Types_Field_Type_Definition_Factory::get_instance()->get_field_type_definitions(), - 'templates' => $this->build_templates(), - 'strings' => $this->build_strings_for_js(), - 'ajaxInfo' => array( - 'fieldAction' => array( - 'name' => $field_action_name, - 'nonce' => wp_create_nonce( $field_action_name ) - ) - ), - 'currentDomain' => $this->get_current_domain(), - 'groups' => $this->build_group_data(), - 'typeConversionMatrix' => Types_Field_Type_Converter::get_instance()->get_conversion_matrix(), - 'itemsPerPage' => $this->get_items_per_page_setting() - ); - - } - - - /** - * Prepare field definition data, depending on current field domain, for passing to JavaScript. - * - * @return array - * @since 2.0 - */ - private function build_field_definitions() { - - $query_args = array( - 'filter' => 'all', - 'orderby' => 'name', - 'order' => 'asc' - ); - - $definitions = array(); - switch( $this->get_current_domain() ) { - case Types_Field_Utils::DOMAIN_POSTS: - $definitions = WPCF_Field_Definition_Factory_Post::get_instance()->query_definitions( $query_args ); - break; - case Types_Field_Utils::DOMAIN_USERS: - $definitions = WPCF_Field_Definition_Factory_User::get_instance()->query_definitions( $query_args ); - break; - case Types_Field_Utils::DOMAIN_TERMS: - $definitions = WPCF_Field_Definition_Factory_Term::get_instance()->query_definitions( $query_args ); - break; - } - - - $definition_data = array(); - foreach( $definitions as $definition ) { - $definition_data[] = $definition->to_json(); - } - - return $definition_data; - } - - - /** - * Build array of templates that will be passed to JavaScript. - * - * If the template file does not exist or is not readable, it will be silently omitted. - * - * @return array - * @since 2.0 - */ - private function build_templates() { - - $template_sources = array( - 'messageDefinitionList' => 'field_control/message_definition_list.html', - 'messageMultiple' => 'field_control/message_multiple.html', - ); - - $templates = array(); - foreach( $template_sources as $template_name => $template_relpath ) { - - $template_path = TYPES_ABSPATH . '/application/views/page/' . $template_relpath; - - if( file_exists( $template_path ) ) { - $templates[ $template_name ] = file_get_contents( $template_path ); - } - } - - return $templates; - } - - - private function build_strings_for_twig() { - - return array( - 'column' => array( - 'name' => __( 'Field name', 'wpcf' ), - 'slug' => __( 'Slug', 'wpcf' ), - 'metaKey' => __( 'Meta key', 'wpcf' ), - 'groups' => __( 'Field groups', 'wpcf' ), - 'type' => __( 'Type' ) - ), - 'rowAction' => array( - 'changeAssignment' => __( 'Change assignment', 'wpcf' ), - 'changeType' => __( 'Change type', 'wpcf' ), - 'delete' => __( 'Delete', 'wpcf' ) - ), - 'misc' => array( - 'noItemsFound' => __( 'No field definitions found.', 'wpcf' ), - 'applyBulkAction' => __( 'Apply', 'wpcf' ), - 'searchPlaceholder' => __( 'Search', 'wpcf' ), - 'pageTitle' => $this->get_title(), - 'items' => __( 'items', 'wpcf' ), - 'of' => __( 'of', 'wpcf' ), - 'thisFieldIsRepeating' => __( 'This is a repeating field.', 'wpcf' ) - ), - 'bulkAction' => array( - 'select' => __( 'Bulk action', 'wpcf' ), - 'delete' => __( 'Delete', 'wpcf' ), - 'manageWithTypes' => __( 'Manage with Types', 'wpcf' ), - 'stopManagingWithTypes' => __( 'Stop managing with Types', 'wpcf' ) - ) - ); - } - - - - /** - * Prepare an array of strings used in JavaScript. - * - * @return array - * @since 2.0 - */ - private function build_strings_for_js() { - return array( - 'misc' => array( - 'notManagedByTypes' => __( 'Not managed by Types', 'wpcf'), - 'undefinedAjaxError' => __( 'The action was not successful, an unknown error has happened.', 'wpcf' ), - 'genericSuccess' => __( 'The action was completed successfully.', 'wpcf' ), - 'fieldsAlreadyManaged' => __( 'Some of the fields you selected are already managed by Types.', 'wpcf' ), - 'fieldsAlreadyUnmanaged' => __( 'Some of the fields you selected are already not managed by Types.', 'wpcf' ), - 'unselectAndRetry' => __( 'Please unselect them and try again.', 'wpcf' ), - 'changeAssignmentToGroups' => __( 'Change assignment to field groups for the field', 'wpcf' ), - 'deleteField' => __( 'Delete field', 'wpcf' ), - 'deleteFields' => __( 'Delete multiple fields', 'wpcf' ), - 'cannotDeleteUnmanagedFields' => __( 'Some fields cannot be deleted because they are not managed by Types.', 'wpcf' ), - 'changeFieldType' => __( 'Change field type for the field', 'wpcf' ), - 'startManagingFieldsWithTypes' => __( 'Start managing fields with Types', 'wpcf' ), - 'stopManagingFieldsWithTypes' => __( 'Stop managing fields with Types', 'wpcf' ) - ), - 'rowAction' => array( - 'manageByTypes' => array( - 'yes' => __( 'Manage with Types', 'wpcf' ), - 'no' => __( 'Stop managing with Types', 'wpcf' ) - ), - 'changeCardinality' => array( - 'makeRepetitive' => __( 'Turn into repetitive', 'wpcf' ), - 'makeSingle' => __( 'Turn into single-value', 'wpcf' ) - ) - ), - 'bulkAction' => array( - 'select' => __( 'Bulk action', 'wpcf' ), - 'delete' => __( 'Delete', 'wpcf' ), - 'manageWithTypes' => __( 'Manage with Types', 'wpcf' ), - 'stopManagingWithTypes' => __( 'Stop managing with Types', 'wpcf' ) - ), - 'button' => array( - 'apply' => __( 'Apply', 'wpcf' ), - 'cancel' => __( 'Cancel', 'wpcf' ), - 'delete' => __( 'Delete', 'wpcf' ) - ) - ); - } - - - /** - * Build an array describing existing field groups within the domain. - * - * @return array - * @since 2.0 - */ - private function build_group_data() { - $factory = Types_Field_Utils::get_group_factory_by_domain( $this->get_current_domain() ); - $groups = $factory->query_groups(); - - $group_data = array(); - foreach( $groups as $group ) { - $group_data[ $group->get_slug() ] = array( - 'slug' => $group->get_slug(), - 'displayName' => stripslashes( $group->get_display_name() ) - ); - } - - return $group_data; - } - - - /** - * Display screen options on the page. - * - * @since 2.0 - */ - public function add_screen_options() { - - $args = array( - 'label' => __( 'Number of displayed fields', 'wpcf' ), - 'default' => self::SCREEN_OPTION_PER_PAGE_DEFAULT_VALUE, - 'option' => self::SCREEN_OPTION_PER_PAGE_NAME, - ); - add_screen_option( 'per_page', $args ); - - add_filter( 'set-screen-option', array( $this, 'set_screen_option' ), 10, 3); - } - - - /** - * Update the "per page" screen option. - * - * @param $status - * @param string $option - * @param $value - * @return mixed - * @since 2.0 - */ - public function set_screen_option( $status, $option, $value ) { - - if ( self::SCREEN_OPTION_PER_PAGE_NAME == $option ) { - return $value; - } - - return $status; - - } - - - /** - * Value of the "items per page" setting for current page and current user. - * - * @return int - * @since 2.0 - */ - private function get_items_per_page_setting() { - $user = get_current_user_id(); - $screen = get_current_screen(); - $option = $screen->get_option( 'per_page', 'option' ); - $per_page = get_user_meta( $user, $option, true ); - if ( empty ( $per_page ) || $per_page < 1 ) { - $per_page = $screen->get_option( 'per_page', 'default' ); - } - - return (int) $per_page; - } - - - /** - * Prepare assets for all dialogs that are going to be used on the page. - * - * @since 2.0 - */ - public function prepare_dialogs() { - - new Types_Dialog_Box( - 'types-change-assignment-dialog', - $this->get_twig(), - array( - 'groups' => $this->build_group_data(), - 'strings' => array( - 'noFieldGroups' => __( 'No field groups exist yet. You have to create one first.', 'wpcf' ) - ) - ), - '@field_control/change_assignment_dialog.twig' - ); - - new Types_Dialog_Box( - 'types-delete-field-dialog', - $this->get_twig(), - array( - 'strings' => array( - 'deletingWillRemoveDefinitionAndData' => __( 'Deleting fields will remove them from all groups and delete the field data from the database as well.', 'wpcf' ), - 'cannotBeUndone' => __( 'This cannot be undone!', 'wpcf' ), - 'doYouReallyWantDelete' => __( 'Do you really want to delete?', 'wpcf' ) - ) - ), - '@field_control/delete_dialog.twig' - ); - - new Types_Dialog_Box( - 'types-change-field-type-dialog', - $this->get_twig(), - array( - 'fieldTypeDefinitions' => Types_Field_Type_Definition_Factory::get_instance()->get_field_type_definitions(), - 'strings' => array( - 'aboutFieldTypeChanging' => __( 'Select a new type for this field.', 'wpcf' ), - 'someTypesAreDisabled' => __( 'Note: Some of the field types are disabled for conversion because they\'re using a significantly different data format, which is not compatible with the current field type.', 'wpcf' ), - 'potentiallyRiskyOperation' => __( 'Changing field type is a potentially risky operation. Make sure you know what you are doing.', 'wpcf' ), - 'singleOrRepeatingField' => __( 'Single or repeating field', 'wpcf' ), - 'repetitiveField' => __( 'Allow multiple instances of this field', 'wpcf' ), - 'singleField' => __( 'This field can have only one value', 'wpcf' ), - 'targetSupportsSingleOnly' => __( 'Selected field type supports only single fields.', 'wpcf' ), - 'repetitiveToSingleWarning' => __( 'Changing from repeating to single field will cause partial data loss if there already are fields with multiple values stored in the database. In such case, only one of those value will be saved on update and some inconsistencies appear when displaying values of this field.', 'wpcf' ) - ) - ), - '@field_control/change_type_dialog.twig' - ); - - - new Types_Dialog_Box( - 'types-bulk-change-management-status-dialog', - $this->get_twig(), - array( - 'strings' => array( - 'youAreAboutToManageFields' => __( 'You are about to start managing these fields with Types:', 'wpcf' ), - 'youAreAboutToStopManagingFields' => __( 'You are about to stop managing these fields with Types:', 'wpcf' ), - 'confirmContinue' => __( 'Do you want to continue?', 'wpcf' ) - ) - ), - '@field_control/bulk_change_management_status_dialog.twig' - ); - } - - - /** - * Get help configuration for Types_Asset_Help_Tab_Loader. - * - * @return array - * @since 2.0 - */ - public function get_help_config() { - return array( - 'title' => $this->get_title(), - 'template' => '@help/basic.twig', - 'context' => array( - 'introductory_paragraphs' => array( - __( 'Types plugin provides you with a powerful way to control the Post/User/Term fields.', 'wpcf' ), - __( 'On this page you can see the list of all the custom fields present in your site. Some of them were created by Types and some were not.', 'wpcf' ), - __( 'When changing changing properties of existing fields, caution is strongly advised because wrong usage can cause issues with themes, plugins and functionality connected to the applied changes.', 'wpcf' ) - ), - 'your_options' => __( 'You have the following options:', 'wpcf' ), - 'options' => array( - array( - 'name' => __( 'Change assignment', 'wpcf' ), - 'explanation' => __( 'Change a group that the field belongs to.', 'wpcf' ) - ), - array( - 'name' => __( 'Change type', 'wpcf' ), - 'explanation' => __( 'Change the type of the field and change whether field can have a single value or multiple values (repetitive field).', 'wpcf' ) - ), - array( - 'name' => __( 'Manage with Types', 'wpcf' ), - 'explanation' => __( 'Select whether the field is under the control of Types plugin.', 'wpcf' ) - ), - array( - 'name' => __( 'Delete', 'wpcf' ), - 'explanation' => - __( 'Click to delete a field and all of its values from the database.', 'wpcf' ) - . ' ' . __( 'Warning: This cannot be undone.', 'wpcf' ) . '' - ) - ), - 'ending_paragraphs' => array( - __( 'Note: An asterisk (*) beside a field type marks a repeating field.', 'wpcf' ) - ) - ) - ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/page/hidden/helper.php b/backend/wordpress/wp-content/plugins/types/application/controllers/page/hidden/helper.php deleted file mode 100644 index 8d7f2e7..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/page/hidden/helper.php +++ /dev/null @@ -1,180 +0,0 @@ -add_sneaky_hidden_helper(); - } - } - - public function add_sneaky_hidden_helper() { - add_submenu_page( - 'options.php', // hidden - $this->get_title(), - $this->get_title(), - $this->get_required_capability(), - $this->get_page_name(), - array( $this, $this->get_load_callback() ) - ); - } - - public function get_title() { - return 'Loading...'; - } - - public function get_render_callback() { - return null; - } - - public function get_load_callback() { - return 'route'; - } - - public function get_page_name() { - return Types_Admin_Menu::PAGE_NAME_HELPER; - } - - public function get_required_capability() { - return 'manage_options'; - } - - public function route() { - - $this->redirect_url = false; - - if( isset( $_GET['action'] ) && isset( $_GET['type'] ) ) { - - $action = sanitize_text_field( $_GET['action'] ); - $type = sanitize_text_field( $_GET['type'] ); - - switch( $action ) { - case 'new-form': - $this->redirect_url = $this->new_form_action( $type ); - break; - case 'new-view': - $this->redirect_url = $this->new_view_action( $type ); - break; - case 'new-layout-template': - $this->redirect_url = $this->new_layout_template_action( $type ); - break; - case 'new-content-template': - $this->redirect_url = $this->new_content_template_action( $type ); - break; - case 'new-wordpress-archive': - $this->redirect_url = $this->new_wordpress_archive_action( $type ); - break; - case 'new-post-field-group': - $this->redirect_url = $this->new_post_field_group_action( $type ); - break; - } - - } - - $this->redirect_url = $this->add_params_to_url( $this->redirect_url ); - $this->redirect(); - } - - private function new_form_action( $type ) { - $new_form = new Types_Helper_Create_Form(); - - if( $id = $new_form->for_post( $type ) ) { - return get_edit_post_link( $id, 'Please WordPress, be so nice and do not encode &.' ); - } - - return false; - } - - private function new_view_action( $type ) { - $new_view = new Types_Helper_Create_View(); - - if( $id = $new_view->for_post( $type ) ) { - return admin_url() . 'admin.php?page=views-editor&view_id='.$id; - } - - return false; - } - - private function new_layout_template_action( $type ) { - $new_layout = new Types_Helper_Create_Layout(); - - if( $id = $new_layout->for_post( $type ) ) { - return admin_url() . 'admin.php?page=dd_layouts_edit&action=edit&layout_id='.$id; - } - - return false; - } - - private function new_content_template_action( $type ) { - $new_layout = new Types_Helper_Create_Content_Template(); - - if( $id = $new_layout->for_post( $type ) ) { - return admin_url() . 'admin.php?page=ct-editor&ct_id='.$id; - } - - return false; - } - - private function new_wordpress_archive_action( $type ) { - $new_wordpress_archive = new Types_Helper_Create_Wordpress_Archive(); - - if( $id = $new_wordpress_archive->for_post( $type ) ) { - return admin_url() . 'admin.php?page=view-archives-editor&view_id='.$id; - } - - return false; - } - - private function new_post_field_group_action( $type ) { - - $type_object = get_post_type_object( $type ); - $title = sprintf( __( 'Field Group for %s', 'wpcf' ), $type_object->labels->name ); - $name = sanitize_title( $title ); - - $new_post_field_group = Types_Field_Group_Post_Factory::get_instance()->create( $name, $title, 'publish' ); - - if( ! $new_post_field_group ) - return false; - - $new_post_field_group->assign_post_type( $type ); - - $url = isset( $_GET['ref'] ) - ? 'admin.php?page=wpcf-edit&group_id='.$new_post_field_group->get_id().'&ref='.sanitize_text_field( $_GET['ref'] ) - : 'admin.php?page=wpcf-edit&group_id='.$new_post_field_group->get_id(); - - return admin_url( $url ); - } - - private function add_params_to_url( $url ) { - // forward parameter toolset_help_video - if( isset( $_GET['toolset_help_video'] ) ) - $url = add_query_arg( 'toolset_help_video', sanitize_text_field( $_GET['toolset_help_video'] ), $url ); - - // forward parameter ref - if( isset( $_GET['ref'] ) ) - $url = add_query_arg( 'ref', sanitize_text_field( $_GET['ref'] ), $url ); - - return $url; - } - - /** - * hidden page, but only when redirect after doing what we have to do - */ - private function redirect() { - // shouldn't happen but if we have no redirect_url here: goto admin main page. - if( ! $this->redirect_url ) - $this->redirect_url = admin_url(); - - die( '' ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/twig_autoloader.php b/backend/wordpress/wp-content/plugins/types/application/controllers/twig_autoloader.php deleted file mode 100644 index 52a0acc..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/twig_autoloader.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * @since 2.0 - */ -class Types_Twig_Autoloader -{ - - /** - * Registers Types_Twig_Autoloader as an SPL autoloader if Twig_Autoloader isn't already registered. - * - * @param bool $prepend Whether to prepend the autoloader or not. - */ - public static function register($prepend = false) - { - $autoloaders = spl_autoload_functions(); - foreach( $autoloaders as $autoloader ) { - - // Resign if we detect Twig_Autoloader - if( is_array( $autoloader ) - && 2 == count( $autoloader ) - && is_string( $autoloader[0] ) - && 'Twig_Autoloader' == $autoloader[0] - && is_string( $autoloader[1] ) - && 'autoload' == $autoloader[1] - ) { - return; - } - } - - if (PHP_VERSION_ID < 50300) { - spl_autoload_register(array(__CLASS__, 'autoload')); - } else { - spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend); - } - - } - - - /** - * Handles autoloading of classes. - * - * @param string $class A class name. - */ - public static function autoload($class) - { - if (0 !== strpos($class, 'Twig')) { - return; - } - - // Modified path to Twig in Types. - $file = TYPES_ABSPATH . '/vendor/twig/twig/lib/' . str_replace( array( '_', "\0" ), array( '/', '' ), $class .'.php' ); - - if( is_file( $file ) ) { - /** @noinspection PhpIncludeInspection */ - require $file; - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/upgrade.php b/backend/wordpress/wp-content/plugins/types/application/controllers/upgrade.php deleted file mode 100644 index 55b442e..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/upgrade.php +++ /dev/null @@ -1,279 +0,0 @@ -check_upgrade(); - } - - - // Legacy option names used to store version string. - const TYPES_DATABASE_VERSION_OPTION_LEGACY1 = 'WPCF_VERSION'; - const TYPES_DATABASE_VERSION_OPTION_LEGACY2 = 'wpcf-version'; - - /** Name of the option used to store version number. */ - const TYPES_DATABASE_VERSION_OPTION = 'types_database_version'; - - - /** - * Check if an upgrade is needed, and if yes, perform it. - * - * @since 2.1 - */ - public function check_upgrade() { - - if( $this->is_upgrade_needed() ) { - $this->do_upgrade(); - } - - } - - - /** - * Returns true if an upgrade is needed. - * - * @return bool - * @since 2.1 - */ - private function is_upgrade_needed() { - return ( $this->get_database_version() < $this->get_plugin_version() ); - } - - - /** - * Get current plugin version number. - * - * @return int - * @since 2.1 - */ - private function get_plugin_version() { - return $this->convert_version_string_to_number( TYPES_VERSION ); - } - - - /** - * Get number of the version stored in the database. - * - * @return int - * @since 2.1 - */ - private function get_database_version() { - $version = (int) get_option( self::TYPES_DATABASE_VERSION_OPTION, 0 ); - - if( 0 === $version ) { - $version = get_option( self::TYPES_DATABASE_VERSION_OPTION_LEGACY1, 0 ); - - if( 0 === $version ) { - $version = get_option( self::TYPES_DATABASE_VERSION_OPTION_LEGACY2, 0 ); - } - - $version = $this->convert_version_string_to_number( $version ); - } - - return $version; - } - - - /** - * Transform a version string to a version number. - * - * The version string looks like this: "major.minor[.maintenance[.revision]]". We expect that all parts have - * two digits at most. - * - * Conversion to version number is done like this: - * $ver_num = MAJOR * 1000000 - * + MINOR * 10000 - * + MAINTENANCE * 100 - * + REVISION * 1 - * - * That means, for example "1.8.11.12" will be equal to: - * 1000000 - * + 80000 - * + 1100 - * + 12 - * --------- - * = 1081112 - * - * @param string $version_string - * @return int - * @since 2.1 - */ - private function convert_version_string_to_number( $version_string ) { - - if( 0 === $version_string ) { - return 0; - } - - $version_parts = explode( '.', $version_string ); - $multipliers = array( 1000000, 10000, 100, 1 ); - - $version_part_count = count( $version_parts ); - $version = 0; - for( $i = 0; $i < $version_part_count; ++$i ) { - $version_part = (int) $version_parts[ $i ]; - $multiplier = $multipliers[ $i ]; - - $version += $version_part * $multiplier; - } - - return $version; - } - - - /** - * Update the version number stored in the database. - * - * @param int $version_number - * @since 2.1 - */ - private function update_database_version( $version_number ) { - if( is_numeric( $version_number ) ) { - update_option( self::TYPES_DATABASE_VERSION_OPTION, (int) $version_number ); - } - } - - - /** - * Get an array of upgrade routines. - * - * Each routine is defined as an associative array with two elements: - * - 'version': int, which specifies the *target* version after the upgrade - * - 'callback': callable - * - * @return array - * @since 2.1 - */ - private function get_upgrade_routines() { - - $upgrade_routines = array( - array( - 'version' => 2010000, - 'callback' => array( $this, 'upgrade_db_to_2010000' ) - ), - array( - 'version' => 2021600, - 'callback' => array( $this, 'upgrade_db_to_2021600' ) - ) - ); - - return $upgrade_routines; - } - - - /** - * Perform the upgrade by calling the appropriate upgrade routines and updating the version number in the database. - * - * @since 2.1 - */ - private function do_upgrade() { - - $from_version = $this->get_database_version(); - $upgrade_routines = $this->get_upgrade_routines(); - $target_version = $this->get_plugin_version(); - - // Sort upgrade routines by their version. - $routines_by_version = array(); - foreach( $upgrade_routines as $key => $row ) { - $routines_by_version[ $key ] = $row['version']; - } - array_multisort( $routines_by_version, SORT_DESC, $upgrade_routines ); - - // Run all the routines necessary - foreach( $upgrade_routines as $routine ) { - $upgrade_version = (int) wpcf_getarr( $routine, 'version' ); - - if( $from_version < $upgrade_version && $upgrade_version <= $target_version ) { - $callback = wpcf_getarr( $routine, 'callback' ); - if( is_callable( $callback ) ) { - call_user_func( $callback ); - } - $this->update_database_version( $upgrade_version ); - } - } - - // Finally, update to current plugin version even if there are no other routines to run, so that - // this method is not called every time by check_upgrade(). - $this->update_database_version( $target_version ); - } - - - /** - * Upgrade database to 2010000 (Types 2.1) - * - * Batch fix types-768 for all non-superadmin users. - */ - function upgrade_db_to_2010000() { - - $roles_manager = WPCF_Roles::getInstance(); - - global $wpdb; - - // Will find users without the administrator roles but with one of the Types management roles. - // A sign of the types-768 bug. - $user_query = new WP_User_Query( - array( - 'meta_query' => array( - 'relation' => 'AND', - array( - 'key' => $wpdb->prefix . 'capabilities', - 'value' => '"administrator"', - 'compare' => 'NOT LIKE', - ), - array( - 'key' => $wpdb->prefix . 'capabilities', - 'value' => '"wpcf_custom_post_type_view"', - 'compare' => 'LIKE', - ), - ) - ) - ); - - $users = $user_query->get_results(); - - foreach( $users as $user ) { - $roles_manager->clean_the_mess_in_nonadmin_user_caps( $user ); - } - } - - /** - * Upgrade database to 2021600 (Types 2.2.16) - * - * Fix types-1142 for non admins with an 'admin' username. - */ - function upgrade_db_to_2021600() { - - $roles_manager = WPCF_Roles::getInstance(); - $roles_manager->clean_the_mess_in_nonadmin_user_caps( 'admin' ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/controllers/utils/post_type_option.php b/backend/wordpress/wp-content/plugins/types/application/controllers/utils/post_type_option.php deleted file mode 100644 index 6e74e1e..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/controllers/utils/post_type_option.php +++ /dev/null @@ -1,175 +0,0 @@ -get_raw_option(); - if ( is_string( $raw_value ) && ! empty( $raw_value ) ) { - // Now we know that something went seriously wrong AND we probably have post types to save. - $post_types = $this->try_fix_serialized_array( $raw_value ); - $post_types = maybe_unserialize( $post_types ); - $post_types = $this->try_fix_post_type_labels( $post_types ); - } - } - - if ( ! is_array( $post_types ) ) { - return array(); - } - - return $post_types; - } - - - /** - * Get the raw WPCF_OPTION_NAME_CUSTOM_TYPES option from the database. - * - * @return null|string - */ - private function get_raw_option() { - global $wpdb; - - $option_value = $wpdb->get_var( - $wpdb->prepare( - "SELECT option_value FROM {$wpdb->options} WHERE option_name = %s", - WPCF_OPTION_NAME_CUSTOM_TYPES - ) - ); - - return $option_value; - } - - - /** - * Restore a broken serialized array by fixing string lengths. - * - * @param $broken_serialized_array - * @return string - */ - private function try_fix_serialized_array( $broken_serialized_array ) { - $output = preg_replace_callback( - '!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!', - array( $this, 'preg_replace_callback' ), - $broken_serialized_array - ); - - return $output; - } - - - /** - * Fix a string length for a single occurence. - * - * @param array $matches - * @return string - */ - private function preg_replace_callback( $matches ) { - if ( count( $matches ) < 4 ) { - // empty string - return $matches[0]; - } - - $stored_string = $matches[3]; - $string_mysql_unescaped = $this->unescape_mysql( $stored_string ); - $string_length = strlen( $string_mysql_unescaped ); - $string_without_quotes = $this->unescape_quotes( $stored_string ); - - $replacement = 's:' . $string_length . ':"' . $string_without_quotes . '";'; - - return $replacement; - } - - - /** - * Update the post types option - * @param $post_types - */ - public function update_post_types( $post_types ) { - update_option( WPCF_OPTION_NAME_CUSTOM_TYPES, $post_types, true ); - } - - - /** - * Unescape to avoid dump-text issues. - * - * @param string $value - * @return string - */ - private function unescape_mysql( $value ) { - return str_replace( - array( "\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"' ), - array( "\\", "\0", "\n", "\r", "\x1a", "'", '"' ), - $value - ); - } - - - /** - * Fix strange behaviour if you have escaped quotes in your replacement - * - * @param string $value - * - * @return string - */ - private function unescape_quotes( $value ) { - return str_replace( '\"', '"', $value ); - } - - - /** - * @param array $post_types - * @return array - */ - private function try_fix_post_type_labels( $post_types ) { - foreach ( $post_types as $key => $post_type ) { - if ( ! array_key_exists( 'labels', $post_type ) ) { - continue; - } - - foreach ( $post_type['labels'] as $label_name => $label_value ) { - $fixed_label = preg_replace( '/\{[a-f0-9]{8,}\}s/', '%s', $label_value ); - $post_types[ $key ]['labels'][ $label_name ] = $fixed_label; - } - } - - return $post_types; - } - -} - diff --git a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/archive.php b/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/archive.php deleted file mode 100644 index 532f449..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/archive.php +++ /dev/null @@ -1,369 +0,0 @@ - array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Archive_No_Support' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The archive is disabled for this post type.', 'wpcf' ) - ), - array( - 'type' => 'paragraph', - 'content' => __( 'To enable, go to Options and mark "has_archive".', 'wpcf' ) - ), - ), - ), - - /* Layouts, integrated, Archive missing */ - 'layouts-integrated-archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Compatible', - 'Types_Helper_Condition_Layouts_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no layout for the %POST-LABEL-PLURAL% archive.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* Layouts, Archive */ - 'layouts-archive' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'link', - 'label' => '%POST-LAYOUT-ARCHIVE%', - 'target' => '%POST-EDIT-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* Views, archive */ - 'views-archive' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'link', - 'label' => '%POST-VIEWS-ARCHIVE%', - 'target' => '%POST-EDIT-VIEWS-ARCHIVE%', - ) - ), - ), - - /* For posts and pages we always show template file if it exists */ - 'archive-exists-for-posts-pages' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Type_Post_Or_Page', - 'Types_Helper_Condition_Archive_Exists', - 'Types_Helper_Condition_Archive_Has_Fields' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-ARCHIVE-FILE%', 'wpcf' ) - ), - ), - ), - - /* Layouts, has template with missing fields. */ - 'layouts-archive-fields-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Missing', - 'Types_Helper_Condition_Archive_No_Fields' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The %POST-LABEL-PLURAL% archive of your theme %POST-ARCHIVE-FILE% is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* Layouts, single.php exists, but layouts missing */ - 'layouts-php-archive-exists-layouts-archive-missing' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Missing', - 'Types_Helper_Condition_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-ARCHIVE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* Layouts, Archive missing */ - 'layouts-archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no layout for the %POST-LABEL-PLURAL% archive.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* No Views, No Layouts, Archive missing */ - 'archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme is missing the standard WordPress archive for %POST-LABEL-PLURAL%.', 'wpcf' ) - ), - array( - 'type' => 'dialog', - 'class' => 'button', - 'label' => __( 'Create archive', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-no-archive', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design archive pages without writing PHP. Your archives will include all - the fields that you need and your design.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating archives with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-archives-with-toolset', 'popup' ), - ), - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Archive without Fields */ - 'archive-fields-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Archive_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The %POST-LABEL-PLURAL% archive of your theme is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'dialog', - 'class' => 'button', - 'label' => __( 'Resolve', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-no-custom-fields', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design archives with custom fields, without writing PHP.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating archives with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-archives-with-toolset', 'popup' ), - ), - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Archive Fields */ - 'archive-fields' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Archive_Has_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-ARCHIVE-FILE%', 'wpcf' ) - ), - ), - ), - - /* Views, has template with missing fields. */ - 'views-archive-fields-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Missing', - 'Types_Helper_Condition_Archive_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The %POST-LABEL-PLURAL% archive of your theme %POST-ARCHIVE-FILE% is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button js-toolset-dashboard-create-archive', - 'target' => '%POST-CREATE-VIEWS-ARCHIVE%', - 'post_type' => '%POST-CREATE-VIEWS-ARCHIVE-TYPE%', - 'redirect_url' => '%POST-CREATE-VIEWS-ARCHIVE-REDIRECT-URL%', - 'forwhomtitle' => '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-TITLE%', - 'forwhomloop' => '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-LOOP%', - 'label' => __( 'Create archive', 'wpcf' ), - ), - ), - ), - - /* Views, archive.php exists, but views missing */ - 'views-php-archive-exists-views-archive-missing' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Missing', - 'Types_Helper_Condition_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-ARCHIVE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button js-toolset-dashboard-create-archive', - 'target' => '%POST-CREATE-VIEWS-ARCHIVE%', - 'post_type' => '%POST-CREATE-VIEWS-ARCHIVE-TYPE%', - 'redirect_url' => '%POST-CREATE-VIEWS-ARCHIVE-REDIRECT-URL%', - 'forwhomtitle' => '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-TITLE%', - 'forwhomloop' => '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-LOOP%', - 'label' => __( 'Create archive', 'wpcf' ), - ), - ), - - ), - - /* Views, template missing */ - 'views-archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no WordPress Archive for %POST-LABEL-PLURAL%.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button js-toolset-dashboard-create-archive', - 'target' => '%POST-CREATE-VIEWS-ARCHIVE%', - 'post_type' => '%POST-CREATE-VIEWS-ARCHIVE-TYPE%', - 'redirect_url' => '%POST-CREATE-VIEWS-ARCHIVE-REDIRECT-URL%', - 'forwhomtitle' => '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-TITLE%', - 'forwhomloop' => '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-LOOP%', - 'label' => __( 'Create archive', 'wpcf' ), - ), - ), - - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/forms.php b/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/forms.php deleted file mode 100644 index 7a2fc57..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/forms.php +++ /dev/null @@ -1,134 +0,0 @@ - array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Cred_Missing' - ), - - 'description' => array( - array( - 'type' => 'dialog', - 'class' => 'button', - 'label' => __( 'Create Form', 'wpcf' ), - 'dialog' => array( - 'id' => 'create-form', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'To create a form for front-end content submission and editing, you need to have CRED plugin installed. - CRED is part of the complete Toolset package for adding and displaying custom content.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn how CRED forms work', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'how-cred-work', 'popup' ) - ), - /* - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Free Toolset Trial', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'free-trial', 'popup' ) - ), - */ - ) - ) - ) - ), - ), - - /* CRED, forms missing */ - 'cred-forms-missing' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Cred_Forms_Missing' - ), - - 'description' => array( - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-FORM%', - 'label' => __( 'Create form', 'wpcf' ) - ) - ) - ), - - /* CRED, forms */ - 'cred-forms' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Cred_Active', - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Cred_Forms_Exist' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-FORMS-LIST%', - ), - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-FORM%', - 'label' => __( 'Create form', 'wpcf' ) - ) - ) - ), - - /* CRED & Layouts, forms missing */ - 'cred-layouts-forms-missing' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Cred_Forms_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( - 'You can create forms for front-end submission and editing of %POST-LABEL-PLURAL%.', 'wpcf' - ) - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-forms-to-layouts', 'table' ), - 'label' => __( 'Learn how', 'wpcf' ) - ), - ) - ), - - /* CRED & Layouts, forms exists */ - 'cred-layouts-forms' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Cred_Forms_Exist' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-FORMS-LIST%' - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-forms-to-layouts', 'table' ), - 'label' => __( 'How to add forms to layouts', 'wpcf' ) - ), - ) - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/head.php b/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/head.php deleted file mode 100644 index 602dca2..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/head.php +++ /dev/null @@ -1,129 +0,0 @@ - array( - 'id' => 'type', - 'title' => __( 'Post Type', 'wpcf' ), - ), - - 'fields' => array( - 'id' => 'fields', - 'title' => __( 'Fields', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'A list of all Post Fields and their attachment to the Post Types.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-fields', 'tooltip' ) - ), - ) - ), - - 'taxonomies' => array( - 'id' => 'taxonomies', - 'title' => __( 'Taxonomies', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'A list of all Taxonomies and their attachment to the Post Types.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-taxonomies', 'tooltip' ) - ), - ) - ), - - - - - - 'template' => array( - 'id' => 'template', - 'title' => __( 'Template', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'A template displays single-item pages with your design and fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-template', 'tooltip' ) - ), - ) - ), - - 'archive' => array( - 'id' => 'archive', - 'title' => __( 'Archive', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'An archive is the standard list that WordPress produces for content.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-archive', 'tooltip' ) - ), - ) - ), - - 'views' => array( - 'id' => 'views', - 'title' => __( 'Views', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Views are custom lists of content, which you can display anywhere in the site.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-views', 'tooltip' ) - ), - ) - ), - - 'forms' => array( - 'id' => 'forms', - 'title' => __( 'Forms', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Forms allow to create and edit content from the site’s front-end.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-forms', 'tooltip' ) - ), - ) - ) -); - -// Visual Composer -if( defined( 'WPB_VC_VERSION' ) ) { - $question_marks['template']['description'][1]['label'] = __( 'Creating templates with Visual Composer', 'wpcf' ); -} -// Beaver Builder -else if( class_exists( 'FLBuilderLoader' ) ) { - $question_marks['template']['description'][1]['label'] = __( 'Creating templates with Beaver Builder', 'wpcf' ); -} -// Layouts -else if( defined( 'WPDDL_DEVELOPMENT' ) || defined( 'WPDDL_PRODUCTION' ) ) { - $question_marks['template']['description'][1]['label'] = __( 'Creating templates with Layouts', 'wpcf' ); -} - -return $question_marks; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/template.php b/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/template.php deleted file mode 100644 index a997daa..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/template.php +++ /dev/null @@ -1,336 +0,0 @@ - array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Compatible', - 'Types_Helper_Condition_Layouts_Template_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no template layout for %POST-LABEL-SINGULAR% items.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - ), - - /* Layouts, template */ - 'layouts-template' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Exists' - ), - - 'description' => array( - array( - 'type' => 'link', - 'label' => '%POST-LAYOUT-TEMPLATE%', - 'target' => '%POST-EDIT-LAYOUT-TEMPLATE%' - ), - ), - ), - - /* Views, template */ - 'views-template' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Exists' - ), - - 'description' => array( - array( - 'type' => 'link', - 'label' => '%POST-CONTENT-TEMPLATE-NAME%', - 'target' => '%POST-EDIT-CONTENT-TEMPLATE%' - ), - ), - ), - - /* For posts and pages we always show template file if it exists */ - 'single-exists-for-posts-pages' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Type_Post_Or_Page', - 'Types_Helper_Condition_Single_Exists', - 'Types_Helper_Condition_Single_Has_Fields' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-TEMPLATE-FILE%', 'wpcf' ) - ), - ), - ), - - /* Layouts, has template with missing fields. */ - 'layouts-single-fields-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Missing', - 'Types_Helper_Condition_Single_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme’s template file %POST-TEMPLATE-FILE% for displaying %POST-LABEL-SINGULAR% items is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - ), - - /* Layouts, single.php exists, but layouts missing */ - 'layouts-php-template-exists-layouts-template-missing' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Missing', - 'Types_Helper_Condition_Single_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-TEMPLATE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - - ), - - /* Layouts, template missing*/ - 'layouts-template-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no template layout for %POST-LABEL-SINGULAR% items.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - ), - - /* No Views, No Layouts, Single Missing */ - 'single-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Single_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme doesn’t have a template to display %POST-LABEL-PLURAL%.', 'wpcf' ) - ), - array( - 'type' => 'dialog', - 'class' => 'button', - 'label' => __( 'Create template', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-single-no-template', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design templates for single items (%POST-LABEL-SINGULAR% pages) without - writing PHP. Your templates will include all the fields that you need and your design.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating templates with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-templates-with-toolset', 'popup' ), - ), - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Single, without Fields */ - 'single-fields-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Single_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme’s template file for displaying %POST-LABEL-SINGULAR% items is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'dialog', - 'class' => 'button-primary types-button', - 'label' => __( 'Resolve', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-single-no-fields', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design templates for single items (%POST-LABEL-SINGULAR% pages), - with all the fields that you need to display.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating templates with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-templates-with-toolset', 'popup' ), - ), - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Single with Fields */ - 'single-fields' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Single_Has_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-TEMPLATE-FILE%', 'wpcf' ) - ), - ), - ), - - /* Views, has template with missing fields. */ - 'views-single-fields-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Missing', - 'Types_Helper_Condition_Single_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme’s template file %POST-TEMPLATE-FILE% for displaying %POST-LABEL-SINGULAR% items is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-CONTENT-TEMPLATE%', - 'label' => __( 'Create Content Template', 'wpcf' ) - ) - ), - ), - - /* Views, single.php exists, but views missing */ - 'views-php-template-exists-views-template-missing' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Missing', - 'Types_Helper_Condition_Single_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( '%POST-TEMPLATE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-CONTENT-TEMPLATE%', - 'label' => __( 'Create Content Template', 'wpcf' ) - ) - ), - ), - - /* Views, template missing */ - 'views-template-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no Content Template for %POST-LABEL-SINGULAR% items.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-CONTENT-TEMPLATE%', - 'label' => __( 'Create template', 'wpcf' ) - ) - ), - - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/views.php b/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/views.php deleted file mode 100644 index a05a97b..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/dashboard/table/views.php +++ /dev/null @@ -1,138 +0,0 @@ - array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Views_Missing' - ), - - 'description' => array( - array( - 'type' => 'dialog', - 'class' => 'button', - 'label' => __( 'Create View', 'wpcf' ), - 'dialog' => array( - 'id' => 'create-view', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'To create a View for this content type, you need to have Views plugin installed. Views is part of the - complete Toolset package for adding and displaying custom content.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn how Views work', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'how-views-work', 'popup' ) - ), - /* - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Free Toolset Trial', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'free-trial', 'popup' ) - ) - */ - ) - ) - ) - ), - - ), - - /* Views, views missing */ - 'views-views-missing' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Views_Missing', - ), - - 'description' => array( - array( - 'type' => 'link', - 'class' => 'button js-toolset-dashboard-create-view', - 'target' => '%POST-CREATE-VIEW%', - 'post_type' => '%POST-CREATE-VIEW-TYPE%', - 'redirect_url' => '%POST-CREATE-VIEW-REDIRECT-URL%', - 'label' => __( 'Create View', 'wpcf' ), - ), - ) - ), - - /* Views, views */ - 'views-views' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Views_Exist', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-VIEWS-LIST%', - ), - array( - 'type' => 'link', - 'class' => 'button js-toolset-dashboard-create-view', - 'target' => '%POST-CREATE-VIEW%', - 'post_type' => '%POST-CREATE-VIEW-TYPE%', - 'redirect_url' => '%POST-CREATE-VIEW-REDIRECT-URL%', - 'label' => __( 'Create View', 'wpcf' ), - ), - ) - ), - - /* Views Layouts, views missing */ - 'views-layouts-views-missing' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Views_Views_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( - 'Edit any layout and add a View cell to it, to display lists of %POST-LABEL-PLURAL%.', 'wpcf' - ) - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-views-to-layouts', 'table' ), - 'label' => __( 'Learn how', 'wpcf' ) - ), - ) - ), - - /* Views Layouts, views */ - 'views-layouts-views' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Views_Views_Exist' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-VIEWS-LIST%' - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-views-to-layouts', 'table' ), - 'label' => __( 'How to add Views to layouts', 'wpcf' ) - ), - ) - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/documentation-urls.php b/backend/wordpress/wp-content/plugins/types/application/data/documentation-urls.php deleted file mode 100644 index 3a7cdfa..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/documentation-urls.php +++ /dev/null @@ -1,71 +0,0 @@ - 'https://wp-types.com/documentation/user-guides/benefits-of-templates-for-custom-types/', - 'learn-how-archive' => 'https://wp-types.com/documentation/user-guides/what-archives-are-and-why-they-are-so-important/', - 'learn-how-views' => 'https://wp-types.com/documentation/user-guides/learn-what-you-can-do-with-views/', - 'learn-how-forms' => 'https://wp-types.com/home/cred/', - 'learn-how-post-types' => 'https://wp-types.com/documentation/user-guides/create-a-custom-post-type/', - 'learn-how-fields' => 'https://wp-types.com/documentation/user-guides/using-custom-fields/', - 'learn-how-taxonomies' => 'https://wp-types.com/documentation/user-guides/create-custom-taxonomies/', - 'creating-templates-with-toolset' => 'https://wp-types.com/documentation/user-guides/learn-about-creating-templates-with-toolset/', - 'creating-templates-with-php' => 'https://wp-types.com/documentation/customizing-sites-using-php/creating-templates-single-custom-posts/', - 'creating-archives-with-toolset' => 'https://wp-types.com/documentation/user-guides/learn-about-creating-archives-with-toolset/', - 'creating-archives-with-php' => 'https://wp-types.com/documentation/customizing-sites-using-php/creating-templates-custom-post-type-archives/', - 'how-views-work' => 'https://wp-types.com/documentation/user-guides/learn-what-you-can-do-with-views/', - 'how-to-add-views-to-layouts' => 'https://wp-types.com/documentation/getting-started-with-toolset/adding-lists-of-contents/', - 'learn-views' => 'https://wp-types.com/documentation/user-guides/learn-what-you-can-do-with-views/', - 'how-cred-work' => 'https://wp-types.com/documentation/user-guides/learn-what-you-can-do-with-cred/', - 'how-to-add-forms-to-layouts' => 'https://wp-types.com/documentation/user-guides/creating-cred-forms/', - 'learn-cred' => 'https://wp-types.com/documentation/user-guides/learn-what-you-can-do-with-cred/', - 'free-trial' => 'https://wp-types.com/?add-to-cart=363363&buy_now=1', - 'adding-custom-fields-with-php' => 'https://wp-types.com/documentation/getting-started-with-toolset/creating-templates-for-displaying-post-types/', - 'themes-compatible-with-layouts' => 'https://wp-types.com/documentation/user-guides/layouts-theme-integration/#popular-integrated-themes', - 'layouts-integration-instructions' => 'https://wp-types.com/documentation/user-guides/layouts-theme-integration/#replacing-wp-loop-with-layouts', - 'adding-views-to-layouts' => 'https://wp-types.com/documentation/getting-started-with-toolset/adding-lists-of-contents/', - 'adding-forms-to-layouts' => 'https://wp-types.com/documentation/user-guides/adding-cred-forms-to-layouts/', - 'using-post-fields' => 'https://wp-types.com/user-guides/using-custom-fields/', - 'adding-fields' => 'https://wp-types.com/documentation/user-guides/using-custom-fields/#introduction-to-wordpress-custom-fields', - 'displaying-fields' => 'https://wp-types.com/documentation/getting-started-with-toolset/creating-templates-for-displaying-post-types/', - 'adding-user-fields' => 'https://wp-types.com/documentation/user-guides/user-fields/', - 'displaying-user-fields' => 'https://wp-types.com/documentation/user-guides/displaying-wordpress-user-fields/', - 'adding-term-fields' => 'https://wp-types.com/documentation/user-guides/term-fields/', - 'displaying-term-fields' => 'https://wp-types.com/documentation/user-guides/displaying-wordpress-term-fields/', - 'custom-post-types' => 'https://wp-types.com/documentation/user-guides/create-a-custom-post-type/', - 'custom-taxonomy' => 'https://wp-types.com/documentation/user-guides/create-custom-taxonomies/', - 'post-relationship' => 'https://wp-types.com/documentation/user-guides/creating-post-type-relationships/', - 'compare-toolset-php' => 'https://wp-types.com/landing/toolset-vs-php/', - 'types-fields-api' => 'https://wp-types.com/documentation/functions/', - 'parent-child' => 'https://wp-types.com/documentation/user-guides/many-to-many-post-relationship/', - 'custom-post-archives' => 'https://wp-types.com/documentation/user-guides/creating-wordpress-custom-post-archives/', - 'using-taxonomy' => 'https://wp-types.com/documentation/user-guides/create-custom-taxonomies/', - 'custom-taxonomy-archives' => 'https://wp-types.com/documentation/user-guides/creating-wordpress-custom-taxonomy-archives/', - 'repeating-fields-group' => 'https://wp-types.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/', - 'single-pages' => 'https://wp-types.com/documentation/user-guides/view-templates/', - 'content-templates' => 'https://wp-types.com/documentation/user-guides/view-templates/', - 'views-user-guide' => 'https://wp-types.com/documentation/getting-started-with-toolset/adding-lists-of-contents/', - 'wp-types' => 'https://wp-types.com/', - 'date-filters' => 'http://wp-types.com/documentation/user-guides/date-filters/', - 'getting-started-types' => 'https://wp-types.com/documentation/user-guides/getting-starting-with-types/', -); - -// Visual Composer -if( defined( 'WPB_VC_VERSION' ) ) { - $urls['learn-how-template'] = 'https://wp-types.com/documentation/user-guides/benefits-of-templates-for-custom-types-vc/'; - $urls['creating-templates-with-toolset'] = 'https://wp-types.com/documentation/user-guides/benefits-of-templates-for-custom-types-vc/'; -} -// Beaver Builder -else if( class_exists( 'FLBuilderLoader' ) ) { - $urls['learn-how-template'] = 'https://wp-types.com/documentation/user-guides/benefits-of-templates-for-custom-types-bb/'; - $urls['creating-templates-with-toolset'] = 'https://wp-types.com/documentation/user-guides/benefits-of-templates-for-custom-types-bb/'; -} -// Layouts -else if( defined( 'WPDDL_DEVELOPMENT' ) || defined( 'WPDDL_PRODUCTION' ) ) { - $urls['learn-how-template'] = 'https://wp-types.com/documentation/user-guides/benefits-of-templates-for-custom-types-layouts/'; - $urls['creating-templates-with-toolset'] = 'https://wp-types.com/documentation/user-guides/benefits-of-templates-for-custom-types-layouts/'; -} - -return $urls; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/information/table/archive.php b/backend/wordpress/wp-content/plugins/types/application/data/information/table/archive.php deleted file mode 100644 index 80942a0..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/information/table/archive.php +++ /dev/null @@ -1,451 +0,0 @@ - array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Archive_No_Support' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The archive is disabled for this post type.', 'wpcf' ) - ), - array( - 'type' => 'paragraph', - 'content' => __( 'To enable, go to Options and mark "has_archive".', 'wpcf' ) - ), - ), - ), - - /* Layouts, integrated, Archive missing */ - 'layouts-integrated-archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Compatible', - 'Types_Helper_Condition_Layouts_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no layout for the %POST-LABEL-PLURAL% archive.', 'wpcf' ) - ), - - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* Layouts, Archive */ - 'layouts-archive' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The layout for the %POST-LABEL-PLURAL% archive is "%POST-LAYOUT-ARCHIVE%".', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Edit layout', 'wpcf' ), - 'target' => '%POST-EDIT-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* For posts and pages we always show template file if it exists */ - 'archive-exists-for-posts-pages' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Type_Post_Or_Page', - 'Types_Helper_Condition_Archive_Exists', - 'Types_Helper_Condition_Archive_Has_Fields' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays the %POST-LABEL-SINGULAR% archive using the file: %POST-ARCHIVE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - ), - ), - - /* Layouts, has template with missing fields. */ - 'layouts-archive-fields-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Missing', - 'Types_Helper_Condition_Archive_No_Fields' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The %POST-LABEL-PLURAL% archive of your theme %POST-ARCHIVE-FILE% is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* Layouts, single.php exists, but layouts missing */ - 'layouts-php-archive-exists-layouts-archive-missing' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Missing', - 'Types_Helper_Condition_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays the %POST-LABEL-SINGULAR% archive using the file: %POST-ARCHIVE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* Layouts, Archive missing */ - 'layouts-archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no layout for the %POST-LABEL-PLURAL% archive.', 'wpcf' ) - ), - - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create archive', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-ARCHIVE%', - ) - ), - ), - - /* No Views, No Layouts, Archive missing */ - 'archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme is missing the standard WordPress archive for %POST-LABEL-PLURAL%.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - array( - 'type' => 'dialog', - 'class' => 'button-primary types-button', - 'label' => __( 'Resolve', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-no-archive', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design archive pages without writing PHP. Your archives will include all - the fields that you need and your design.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating archives with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-archives-with-toolset', 'popup' ), - ), - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Archive without Fields */ - 'archive-fields-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Archive_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The %POST-LABEL-PLURAL% archive of your theme is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - array( - 'type' => 'dialog', - 'class' => 'button-primary types-button', - 'label' => __( 'Resolve', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-no-custom-fields', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design archives with custom fields, without writing PHP.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating archives with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-archives-with-toolset', 'popup' ), - ) - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Archive Fields */ - 'archive-fields' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Archive_Has_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays the %POST-LABEL-SINGULAR% archive using the file: %POST-ARCHIVE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - ), - ), - - /* Views, has template with missing fields. */ - 'views-archive-fields-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Missing', - 'Types_Helper_Condition_Archive_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The %POST-LABEL-PLURAL% archive of your theme %POST-ARCHIVE-FILE% is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'target' => '%POST-CREATE-VIEWS-ARCHIVE%', - 'label' => __( 'Create archive', 'wpcf' ) - ) - ), - ), - - /* Views, archive.php exists, but views missing */ - 'views-php-archive-exists-views-archive-missing' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Missing', - 'Types_Helper_Condition_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays the %POST-LABEL-SINGULAR% archive using the file: %POST-ARCHIVE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'target' => '%POST-CREATE-VIEWS-ARCHIVE%', - 'label' => __( 'Create archive', 'wpcf' ) - ) - ), - - ), - - /* Views, template missing */ - 'views-archive-missing' => array( - 'type' => 'archive', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no WordPress Archive for %POST-LABEL-PLURAL%.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'target' => '%POST-CREATE-VIEWS-ARCHIVE%', - 'label' => __( 'Create archive', 'wpcf' ) - ) - - ), - ), - - /* Views, archive */ - 'views-archive' => array( - 'type' => 'archive', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Archive_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The WordPress Archive for %POST-LABEL-PLURAL% is "%POST-VIEWS-ARCHIVE%"', 'wpcf' ) - ), - - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit the %POST-LABEL-PLURAL% archive', 'wpcf' ), - 'target' => '%POST-ARCHIVE-PERMALINK%' - ), - - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Edit WordPress Archive', 'wpcf' ), - 'target' => '%POST-EDIT-VIEWS-ARCHIVE%', - ) - ), - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/information/table/forms.php b/backend/wordpress/wp-content/plugins/types/application/data/information/table/forms.php deleted file mode 100644 index f2261c1..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/information/table/forms.php +++ /dev/null @@ -1,134 +0,0 @@ - array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Cred_Missing' - ), - - 'description' => array( - array( - 'type' => 'dialog', - 'class' => 'button', - 'label' => __( 'Create Form', 'wpcf' ), - 'dialog' => array( - 'id' => 'create-form', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'To create a form for front-end content submission and editing, you need to have CRED plugin installed. - CRED is part of the complete Toolset package for adding and displaying custom content.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn how CRED forms work', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'how-cred-work', 'popup' ) - ), - /* - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Free Toolset Trial', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'free-trial', 'popup' ) - ), - */ - ) - ) - ) - ), - ), - - /* CRED, forms missing */ - 'cred-forms-missing' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Cred_Forms_Missing' - ), - - 'description' => array( - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-FORM%', - 'label' => __( 'Create form', 'wpcf' ) - ) - ) - ), - - /* CRED, forms */ - 'cred-forms' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Cred_Active', - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Cred_Forms_Exist' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-FORMS-LIST%' - ), - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-FORM%', - 'label' => __( 'Create form', 'wpcf' ) - ) - ) - ), - - /* CRED & Layouts, forms missing */ - 'cred-layouts-forms-missing' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Cred_Forms_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( - 'You can create forms for front-end submission and editing of %POST-LABEL-PLURAL%.', 'wpcf' - ) - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-forms-to-layouts', 'table' ), - 'label' => __( 'Learn how', 'wpcf' ) - ), - ) - ), - - /* CRED & Layouts, forms exists */ - 'cred-layouts-forms' => array( - 'type' => 'forms', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Cred_Forms_Exist' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-FORMS-LIST%' - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-forms-to-layouts', 'table' ), - 'label' => __( 'How to add forms to layouts', 'wpcf' ) - ), - ) - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/information/table/question-marks.php b/backend/wordpress/wp-content/plugins/types/application/data/information/table/question-marks.php deleted file mode 100644 index a07799d..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/information/table/question-marks.php +++ /dev/null @@ -1,85 +0,0 @@ - array( - 'id' => 'template', - 'title' => __( 'Template', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'A template displays single-item pages with your design and fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-template', 'tooltip' ) - ), - ) - ), - - 'archive' => array( - 'id' => 'archive', - 'title' => __( 'Archive', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'An archive is the standard list that WordPress produces for content.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-archive', 'tooltip' ) - ), - ) - ), - - 'views' => array( - 'id' => 'views', - 'title' => __( 'Views', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Views are custom lists of content, which you can display anywhere in the site.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-views', 'tooltip' ) - ), - ) - ), - - 'forms' => array( - 'id' => 'forms', - 'title' => __( 'Forms', 'wpcf' ), - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Forms allow to create and edit content from the site’s front-end.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn more', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'learn-how-forms', 'tooltip' ) - ), - ) - ) -); - -// Visual Composer -if( defined( 'WPB_VC_VERSION' ) ) { - $question_marks['template']['description'][1]['label'] = __( 'Creating templates with Visual Composer', 'wpcf' ); -} -// Beaver Builder -else if( class_exists( 'FLBuilderLoader' ) ) { - $question_marks['template']['description'][1]['label'] = __( 'Creating templates with Beaver Builder', 'wpcf' ); -} -// Layouts -else if( defined( 'WPDDL_DEVELOPMENT' ) || defined( 'WPDDL_PRODUCTION' ) ) { - $question_marks['template']['description'][1]['label'] = __( 'Creating templates with Layouts', 'wpcf' ); -} - -return $question_marks; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/information/table/template.php b/backend/wordpress/wp-content/plugins/types/application/data/information/table/template.php deleted file mode 100644 index 55fb638..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/information/table/template.php +++ /dev/null @@ -1,432 +0,0 @@ - array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Compatible', - 'Types_Helper_Condition_Layouts_Template_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no template layout for %POST-LABEL-SINGULAR% items.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - ), - - /* Layouts, template */ - 'layouts-template' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The template layout for %POST-LABEL-SINGULAR% items is "%POST-LAYOUT-TEMPLATE%".', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Edit template', 'wpcf' ), - 'target' => '%POST-EDIT-LAYOUT-TEMPLATE%' - ), - ), - ), - - /* For posts and pages we always show template file if it exists */ - 'single-exists-for-posts-pages' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Type_Post_Or_Page', - 'Types_Helper_Condition_Single_Exists', - 'Types_Helper_Condition_Single_Has_Fields' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays single %POST-LABEL-SINGULAR% pages using the template file: %POST-TEMPLATE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - ), - ), - - /* Layouts, has template with missing fields. */ - 'layouts-single-fields-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Missing', - 'Types_Helper_Condition_Single_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme’s template file %POST-TEMPLATE-FILE% for displaying %POST-LABEL-SINGULAR% items is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - ), - - /* Layouts, single.php exists, but layouts missing */ - 'layouts-php-template-exists-layouts-template-missing' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Missing', - 'Types_Helper_Condition_Single_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays single %POST-LABEL-SINGULAR% pages using the template file: %POST-TEMPLATE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - - ), - - /* Layouts, template missing*/ - 'layouts-template-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Layouts_Template_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no template layout for %POST-LABEL-SINGULAR% items.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'label' => __( 'Create template', 'wpcf' ), - 'target' => '%POST-CREATE-LAYOUT-TEMPLATE%', - ) - ), - ), - - /* No Views, No Layouts, Single Missing */ - 'single-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Single_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme doesn’t have a template to display %POST-LABEL-PLURAL%.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'dialog', - 'class' => 'button-primary types-button', - 'label' => __( 'Resolve', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-single-no-template', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design templates for single items (%POST-LABEL-SINGULAR% pages) without - writing PHP. Your templates will include all the fields that you need and your design.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating templates with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-templates-with-toolset', 'popup' ), - ), - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Single, without Fields */ - 'single-fields-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Single_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme’s template file for displaying %POST-LABEL-SINGULAR% items is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => array( - 'default' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'post-edit' => __( 'Visit this %POST-LABEL-SINGULAR%', 'wpcf' ), - ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'dialog', - 'class' => 'button-primary types-button', - 'label' => __( 'Resolve', 'wpcf' ), - 'dialog' => array( - 'id' => 'resolve-single-no-fields', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Toolset plugins let you design templates for single items (%POST-LABEL-SINGULAR% pages), - with all the fields that you need to display.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'external' => true, - 'label' => __( 'Learn about creating templates with Toolset', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'creating-templates-with-toolset', 'popup' ), - ), - ) - ) - ) - ), - ), - - /* No Views, No Layouts, Single with Fields */ - 'single-fields' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Missing', - 'Types_Helper_Condition_Single_Has_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays single %POST-LABEL-SINGULAR% pages using the template file: %POST-TEMPLATE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - ), - ), - - /* Views, has template with missing fields. */ - 'views-single-fields-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Missing', - 'Types_Helper_Condition_Single_No_Fields', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme’s template file %POST-TEMPLATE-FILE% for displaying %POST-LABEL-SINGULAR% items is missing custom fields.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'target' => '%POST-CREATE-CONTENT-TEMPLATE%', - 'label' => __( 'Create Content Template', 'wpcf' ) - ) - ), - ), - - /* Views, single.php exists, but views missing */ - 'views-php-template-exists-views-template-missing' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Missing', - 'Types_Helper_Condition_Single_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'Your theme displays single %POST-LABEL-SINGULAR% pages using the template file: %POST-TEMPLATE-FILE%', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'target' => '%POST-CREATE-CONTENT-TEMPLATE%', - 'label' => __( 'Create Content Template', 'wpcf' ) - ) - ), - - ), - - /* Views, template missing */ - 'views-template-missing' => array( - 'type' => 'template', - - 'priority' => 'important', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'There is no Content Template for %POST-LABEL-SINGULAR% items.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button-primary types-button', - 'target' => '%POST-CREATE-CONTENT-TEMPLATE%', - 'label' => __( 'Create Content Template', 'wpcf' ) - ) - ), - - ), - - /* Views, template */ - 'views-template' => array( - 'type' => 'template', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Template_Exists' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'The Content Template for %POST-LABEL-PLURAL% is "%POST-CONTENT-TEMPLATE-NAME%"', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => array( - 'default' => __( 'Visit example %POST-LABEL-SINGULAR%', 'wpcf' ), - 'post-edit' => __( 'Visit this %POST-LABEL-SINGULAR%', 'wpcf' ), - ), - 'target' => '%POST-PERMALINK%' - ), - array( - 'type' => 'link', - 'class' => 'button', - 'label' => __( 'Edit Content Template', 'wpcf' ), - 'target' => '%POST-EDIT-CONTENT-TEMPLATE%' - ), - ), - - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/data/information/table/views.php b/backend/wordpress/wp-content/plugins/types/application/data/information/table/views.php deleted file mode 100644 index 51fcd8d..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/data/information/table/views.php +++ /dev/null @@ -1,134 +0,0 @@ - array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Views_Missing' - ), - - 'description' => array( - array( - 'type' => 'dialog', - 'class' => 'button', - 'label' => __( 'Create View', 'wpcf' ), - 'dialog' => array( - 'id' => 'create-view', - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( 'To create a View for this content type, you need to have Views plugin installed. Views is part of the - complete Toolset package for adding and displaying custom content.', 'wpcf' ) - ), - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Learn how Views work', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'how-views-work', 'popup' ) - ), - /* - array( - 'type' => 'link', - 'external' => true, - 'label' => __( 'Free Toolset Trial', 'wpcf' ), - 'target' => Types_Helper_Url::get_url( 'free-trial', 'popup' ) - ) - */ - ) - ) - ) - ), - - ), - - /* Views, views missing */ - 'views-views-missing' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Views_Missing', - ), - - 'description' => array( - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-VIEW%', - 'label' => __( 'Create View', 'wpcf' ) - ) - ) - ), - - /* Views, views */ - 'views-views' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Missing', - 'Types_Helper_Condition_Views_Views_Exist', - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-VIEWS-LIST%' - ), - array( - 'type' => 'link', - 'class' => 'button', - 'target' => '%POST-CREATE-VIEW%', - 'label' => __( 'Create View', 'wpcf' ) - ) - ) - ), - - /* Views Layouts, views missing */ - 'views-layouts-views-missing' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Views_Views_Missing' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => __( - 'Edit any layout and add a View cell to it, to display lists of %POST-LABEL-PLURAL%.', 'wpcf' - ) - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-views-to-layouts', 'table' ), - 'label' => __( 'Learn how', 'wpcf' ) - ), - ) - ), - - /* Views Layouts, views */ - 'views-layouts-views' => array( - 'type' => 'views', - - 'conditions'=> array( - 'Types_Helper_Condition_Layouts_Active', - 'Types_Helper_Condition_Views_Views_Exist' - ), - - 'description' => array( - array( - 'type' => 'paragraph', - 'content' => '%POST-VIEWS-LIST%' - ), - array( - 'type' => 'link', - 'external' => true, - 'target' => Types_Helper_Url::get_url( 'adding-views-to-layouts', 'table' ), - 'label' => __( 'How to add Views to layouts', 'wpcf' ) - ), - ) - ), -); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/functions.php b/backend/wordpress/wp-content/plugins/types/application/functions.php deleted file mode 100644 index b548019..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/functions.php +++ /dev/null @@ -1,171 +0,0 @@ - array( 'b' => array( 'c' => 'my_value' ) ) ) and want to reach 'my_value', - * you need to write: $my_value = wpcf_getnest( $source, array( 'a', 'b', 'c' ) ); - * - * @param mixed|array $source The source array. - * @param string[] $keys Keys which will be used to access the final value. - * @param null|mixed $default Default value to return when the keys cannot be followed. - * - * @return mixed|null Value in the nested structure defined by keys or default value. - * - * @since 1.9 - */ - function wpcf_getnest( &$source, $keys = array(), $default = null ) { - - $current_value = $source; - - // For detecting if a value is missing in a sub-array, we'll use this temporary object. - // We cannot just use $default on every level of the nesting, because if $default is an - // (possibly nested) array itself, it might mess with the value retrieval in an unexpected way. - $missing_value = new stdClass(); - - while( ! empty( $keys ) ) { - $current_key = array_shift( $keys ); - $is_last_key = empty( $keys ); - - $current_value = wpcf_getarr( $current_value, $current_key, $missing_value ); - - if ( $is_last_key ) { - // Apply given default value. - if( $missing_value === $current_value ) { - return $default; - } else { - return $current_value; - } - } elseif ( ! is_array( $current_value ) ) { - return $default; - } - } - - return $default; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/checkbox.php b/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/checkbox.php deleted file mode 100644 index 96bdc03..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/checkbox.php +++ /dev/null @@ -1,47 +0,0 @@ -sanitize_element_isset( $definition_array, 'display', 'db', array( 'db', 'value' ), 'data' ); - $definition_array = $this->sanitize_element_isset( $definition_array, 'display_value_selected', '', null, 'data' ); - $definition_array = $this->sanitize_element_isset( $definition_array, 'display_value_not_selected', '', null, 'data' ); - $definition_array = $this->sanitize_element_isset( $definition_array, 'save_empty', 'no', array( 'yes', 'no' ), 'data' ); - - $set_value = wpcf_getnest( $definition_array, array( 'data', 'set_value' ) ); - if( !is_string( $set_value ) && !is_numeric( $set_value ) ) { - $set_value = '1'; - } - $definition_array['data']['set_value'] = $set_value; - - return $definition_array; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/checkboxes.php b/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/checkboxes.php deleted file mode 100644 index 856a1be..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/checkboxes.php +++ /dev/null @@ -1,50 +0,0 @@ -sanitize_element_isset( $definition_array, 'save_empty', 'no', array( 'yes', 'no' ), 'data' ); - - $options = wpcf_ensarr( wpcf_getnest( $definition_array, array( 'data', 'options' ) ) ); - - foreach( $options as $key => $option ) { - $options[ $key ] = $this->sanitize_single_option( $option ); - } - - $definition_array['data']['options'] = $options; - - return $definition_array; - } - - - /** - * Sanitize single checkboxes option definition. - * - * @param array $option - * @return array Sanitized option. - * @since 2.1 - */ - private function sanitize_single_option( $option ) { - $option = $this->sanitize_element_isset( wpcf_ensarr( $option ), 'set_value' ); - $option = $this->sanitize_element_isset( $option, 'title', $option['set_value'] ); - $option = $this->sanitize_element_isset( $option, 'display', 'db', array( 'db', 'value' ) ); - $option = $this->sanitize_element_isset( $option, 'display_value_selected' ); - $option = $this->sanitize_element_isset( $option, 'display_value_not_selected' ); - return $option; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/date.php b/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/date.php deleted file mode 100644 index d4dafb9..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/date.php +++ /dev/null @@ -1,30 +0,0 @@ -sanitize_element_isset( $definition_array, 'date_and_time', 'date', array( 'date', 'and_time' ), 'data' ); - - return $definition_array; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/numeric.php b/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/numeric.php deleted file mode 100644 index ffeeda6..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/numeric.php +++ /dev/null @@ -1,59 +0,0 @@ - true, 'message' => __( 'Please enter numeric data', 'wpcf' ) ) - ); - - // Force the activation of this validation. - $validation_setting['active'] = true; - - // Store the setting. - $definition_array['data']['validate']['number'] = $validation_setting; - - return $definition_array; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/radio.php b/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/radio.php deleted file mode 100644 index 5ff54f0..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/radio.php +++ /dev/null @@ -1,57 +0,0 @@ - $option ) { - if( 'default' == $key ) { - continue; - } - - $options[ $key ] = $this->sanitize_single_option( $option ); - } - - $default_option = wpcf_getarr( $options, 'default' ); - if( !is_string( $default_option ) || !array_key_exists( $default_option, $options ) ) { - $default_option = 'no-default'; - } - $options['default'] = $default_option; - - $definition_array['data']['options'] = $options; - - return $definition_array; - } - - - /** - * Sanitize single checkboxes option definition. - * - * @param array $option - * @return array Sanitized option. - * @since 2.1 - */ - private function sanitize_single_option( $option ) { - $option = $this->sanitize_element_isset( wpcf_ensarr( $option ), 'value' ); - $option = $this->sanitize_element_isset( $option, 'title', $option['value'] ); - $option = $this->sanitize_element_isset( $option, 'display_value', $option['value'] ); - return $option; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/select.php b/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/select.php deleted file mode 100644 index e57a6d4..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/select.php +++ /dev/null @@ -1,56 +0,0 @@ - $option ) { - if( 'default' == $key ) { - continue; - } - - $options[ $key ] = $this->sanitize_single_option( $option ); - } - - $default_option = wpcf_getarr( $options, 'default' ); - if( !is_string( $default_option ) || !array_key_exists( $default_option, $options ) ) { - $default_option = 'no-default'; - } - $options['default'] = $default_option; - - $definition_array['data']['options'] = $options; - - return $definition_array; - } - - - /** - * Sanitize single checkboxes option definition. - * - * @param array $option - * @return array Sanitized option. - * @since 2.1 - */ - private function sanitize_single_option( $option ) { - $option = $this->sanitize_element_isset( wpcf_ensarr( $option ), 'value' ); - $option = $this->sanitize_element_isset( $option, 'title', $option['value'] ); - return $option; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/singular.php b/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/singular.php deleted file mode 100644 index bbc3e83..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/gateway/singular.php +++ /dev/null @@ -1,18 +0,0 @@ -post = $field_group_post; - } - - - /** - * @return WPCF_Field_Definition_Factory Field definition factory of the correct type. - */ - protected abstract function get_field_definition_factory(); - - - /** - * @return WP_Post Post object representing the field group. - */ - protected function get_post() { - return $this->post; - } - - - /** - * @return int ID of the field group. - */ - public function get_id() { - return $this->get_post()->ID; - } - - - /** - * @return string Unique name (post slug) of the field group. - */ - public function get_slug() { - return sanitize_title( $this->get_post()->post_name ); - } - - - /** - * @return string Field group description. Sanitized as a text field. - */ - public function get_description() { - return sanitize_text_field( $this->get_post()->post_content ); - } - - - /** - * Note that for displaying group name to the user you should use get_display_name() instead. - * - * @return string Field group title. - */ - public function get_name() { - return sanitize_text_field( $this->get_post()->post_title ); - } - - - /** - * Get group name as it should be displayed to the user. - * - * Handles string translation if applicable. - */ - public function get_display_name() { - return wpcf_translate( - sprintf( 'group %d name', $this->get_id() ), - $this->get_name() - ); - } - - - /** - * @param null|bool $value If boolean value is provided, the group will be activated or deactivated accordingly. - * For null, nothing happens. - * @return bool True if the field group is active, false if deactivated. - * @since 1.9 - */ - public function is_active( $value = null ) { - - if( null !== $value ) { - $this->update_post( array( 'post_status' => ( $value ? 'publish' : 'draft' ) ) ); - } - - $post = $this->get_post(); - return ( $post->post_status == 'publish' ? true : false ); - } - - - /** - * @return string Status of the underlying post. Limited to 'publish'|'draft' (default). - */ - public function get_post_status() { - return ( $this->is_active() ? 'publish' : 'draft' ); - } - - - /** - * @return int ID of the user who edited the field group last. - */ - public function get_author() { - $post = $this->get_post(); - return (int) $post->post_author; - } - - - /* - * $group['meta_box_context'] = 'normal'; - $group['meta_box_priority'] = 'high'; - $group['filters_association'] = get_post_meta( $post->ID, '_wp_types_group_filters_association', true ); - */ - - - /** - * Change name of the field group. - * - * Do not confuse with the title. *All* changes of the name must happen through this method, otherwise - * unexpected behaviour of the Types_Field_Group_Factory can occur. - * - * @param string $value New value of the post name. Note that it may be further modified by WordPress before saving. - */ - public function set_name( $value ) { - $result = $this->update_post( array( 'post_name' => sanitize_title( $value ) ) ); - if( true == $result ) { - do_action( 'wpcf_field_group_renamed', $value, $this ); - } - } - - - /** - * Update the underlying post object. - * - * Also refreshes the stored post object and fires an action notifying about the change. - * - * @param array $args Arguments for wp_update_post(). ID doesn't have to be provided, it will be added automatically. - * @return bool True on success, false otherwise. - * @since 2.1 - */ - private function update_post( $args ) { - - $args = array_merge( array( 'ID' => $this->get_id() ), $args ); - - $updated_post_id = wp_update_post( $args ); - - if( 0 !== $updated_post_id ) { - // Refresh the post object - $this->post = WP_Post::get_instance( $updated_post_id ); - - $this->execute_group_updated_action(); - return true; - } else { - return false; - } - } - - - /** - * @return string The underlying post type of the post representing the field group. - */ - public function get_post_type() { - $post = $this->get_post(); - return $post->post_type; - } - - - /** - * @var null|array Array of field slugs that belong to this field group, or null if it was not loaded from database yet. - */ - private $field_slugs = null; - - - /** - * Check if a field slug is valid and can be stored in the database. - * - * @param string $field_slug - * @return bool True if the slug is valid. - */ - public function is_valid_field_slug( $field_slug ) { - return !empty( $field_slug ) && is_string( $field_slug ) && ( sanitize_title( $field_slug ) == $field_slug ); - } - - - /** - * Check if an array of field slugs is valid. - * - * @param array|mixed $field_slugs - * @return bool True if an array of valid field slugs was provided. - */ - protected function validate_field_slugs( $field_slugs ) { - if( !is_array( $field_slugs ) ) { - return false; - } - - // Every element needs to be valid - if( count( $field_slugs ) != count ( array_filter( $field_slugs, array( $this, 'is_valid_field_slug' ) ) ) ) { - return false; - } - - return true; - } - - - /** - * @return array Slugs of fields that belong to this field group, or empty array when database doesn't contain - * valid data. - * - * Consider using get_field_definitions() instead. - */ - public function get_field_slugs() { - if( null == $this->field_slugs ) { - $field_slug_list = get_post_meta( $this->get_id(), self::POSTMETA_FIELD_SLUGS_LIST, true ); - - if( !is_string( $field_slug_list ) ) { - $field_slug_list = ''; - } - - $field_slugs = explode( self::FIELD_SLUG_DELIMITER, $field_slug_list ); - - // Remove empty slugs - foreach( $field_slugs as $key => $slug ) { - if( empty( $slug ) ) { - unset( $field_slugs[ $key ] ); - } - } - - $this->field_slugs = $this->validate_field_slugs( $field_slugs ) ? $field_slugs : array(); - } - return $this->field_slugs; - } - - - /** - * Get all existing definitions of fields that belong to this group. - * - * @return WPCF_Field_Definition[] - */ - public function get_field_definitions() { - $slugs = $this->get_field_slugs(); - $field_definitions = array(); - $factory = $this->get_field_definition_factory(); - foreach( $slugs as $slug ) { - $field_definition = $factory->load_field_definition( $slug ); - if( null != $field_definition && $field_definition->is_under_types_control() ) { - $field_definitions[] = $field_definition; - } - } - return $field_definitions; - } - - - /** - * Update the set of field slugs that belong to this field group. - * - * @param array $field_slugs Array of valid field slugs. - * @return bool True if the database was updated successfully, false otherwise. - */ - protected function set_field_slugs( $field_slugs ) { - if( !$this->validate_field_slugs( $field_slugs ) ) { - return false; - } - - $this->field_slugs = $field_slugs; - - $field_slug_list = implode( self::FIELD_SLUG_DELIMITER, $field_slugs ); - - $updated = update_post_meta( $this->get_id(), self::POSTMETA_FIELD_SLUGS_LIST, $field_slug_list ); - - $this->execute_group_updated_action(); - - return ( $updated != false ); - } - - - /** - * Remove field definition from this group. - * - * @param WPCF_Field_Definition $field_definition - * @return bool - */ - public function remove_field_definition( $field_definition ) { - - if( ! ( $field_definition instanceof WPCF_Field_Definition ) ) { - return false; - } - - $field_slugs = $this->get_field_slugs(); - - $slug_to_remove = $field_definition->get_slug(); - $key = array_search( $slug_to_remove, $field_slugs ); - if( $key !== false ) { - unset( $field_slugs[ $key ] ); - $is_success = $this->set_field_slugs( $field_slugs ); - } else { - $is_success = true; - } - - return $is_success; - } - - - /** - * Associate a field definition with this group. - * - * @param WPCF_Field_Definition $field_definition - * @return bool True on success, false otherwise. - * @since 2.0 - */ - public function add_field_definition( $field_definition ) { - - if( ! ( $field_definition instanceof WPCF_Field_Definition ) ) { - return false; - } - - $field_slugs = $this->get_field_slugs(); - - $slug_to_add = $field_definition->get_slug(); - if( !in_array( $slug_to_add, $field_slugs ) ) { - $field_slugs[] = $slug_to_add; - $is_success = $this->set_field_slugs( $field_slugs ); - } else { - $is_success = true; - } - - return $is_success; - } - - - /** - * Check if a string is contained within the field group definition. - * - * Searches in ID, slug, title and description. Case insensitive. - * - * @param string $search_string String to look for. - * @return bool True if found. - */ - public function is_match( $search_string ) { - return ( - Types_Utils::is_string_match( $search_string, $this->get_id() ) - || Types_Utils::is_string_match( $search_string, $this->get_slug() ) - || Types_Utils::is_string_match( $search_string, $this->get_name() ) - || Types_Utils::is_string_match( $search_string, $this->get_display_name() ) - || Types_Utils::is_string_match( $search_string, $this->get_description() ) - ); - } - - - public function contains_field_definition( $field_definition ) { - if( $field_definition instanceof WPCF_Field_Definition ) { - return in_array( $field_definition, $this->get_field_definitions() ); - } elseif( is_string( $field_definition ) ) { - return in_array( $field_definition, $this->get_field_slugs() ); - } else { - return false; - } - } - - - /** - * Execute the wpcf_group_updated action. - * - * Needs to be called after each (permanent) change to a group. - */ - public function execute_group_updated_action() { - - /** - * Executed after a group has been updated in the database. - * - * @param int $id Group ID. - * @param Types_Field_Group $group The group object. - * - * @since 1.9 - */ - do_action( 'wpcf_group_updated', $this->get_id(), $this ); - } - - - /** - * @var null|false|string[] Cache for get_assigned_to_types(). - * - * @since 2.1 - */ - private $assigned_to_types = null; - - - /** - * Fetch all post types assigned to this group from the database. - * - * @return false|string[] Array of post type slugs (empty array meaning "all post types") or false if not applicable. - * @since 2.1 - */ - protected function fetch_assigned_to_types() { - return false; - } - - - /** - * Get all post types assigned to this group from the database. - * - * Cached. - * - * @return false|string[] Array of post type slugs (empty array meaning "all post types") or false if not applicable. - * @since 2.1 - */ - public function get_assigned_to_types() { - if( null === $this->assigned_to_types ) { - $this->assigned_to_types = $this->fetch_assigned_to_types(); - } - - return $this->assigned_to_types; - } - - - private $assigned_to_items = null; - - - /** - * Fetch all items that are using this group. - * - * @return array|false Array of items (whose type varies upon the field domain) or false if not applicable. - * @since 2.1 - */ - protected function fetch_assigned_to_items() { - return false; - } - - - /** - * Get all items that are using this group. - * - * Cached. - * - * @return array|false Array of items (whose type varies upon the field domain) or false if not applicable. - * @since 2.1 - */ - public function get_assigned_to_items() { - if( null === $this->assigned_to_items ) { - $this->fetch_assigned_to_items(); - } - - return $this->assigned_to_items; - } - - /** - * Keys in the group export object. - * - * @since 2.1 - */ - const XML_ID = 'ID'; - const XML_SLUG = 'slug'; - const XML_NAME = 'post_title'; - const XML_TYPE = 'post_type'; - const XML_DESCRIPTION = 'post_content'; - const XML_IS_ACTIVE = 'is_active'; - const XML_LEGACY_EXCERPT = 'post_excerpt'; - const XML_LEGACY_POST_STATUS = 'post_status'; - const XML_META_SECTION = 'meta'; - - - /** - * Get raw data of this field group to be exported. - * - * @return array - * @since 2.1 - */ - protected function get_export_fields() { - - $field_slugs = $this->get_field_slugs(); - $field_slugs = implode( ',', $field_slugs ); - - $result = array( - self::XML_ID => $this->get_id(), - self::XML_SLUG => $this->get_slug(), - self::XML_NAME => $this->get_name(), - self::XML_TYPE => $this->get_post_type(), - self::XML_IS_ACTIVE => $this->is_active(), - self::XML_LEGACY_EXCERPT => '', - self::XML_LEGACY_POST_STATUS => $this->get_post_status(), - self::XML_META_SECTION => array( - self::POSTMETA_FIELD_SLUGS_LIST => $field_slugs - ), - WPCF_AUTHOR => $this->get_author() - ); - - return $result; - } - - - /** - * Get array of keys that should be used for generating field group checksum. - * - * @return string[] - * @since 2.1 - */ - protected function get_keys_for_export_checksum() { - return array( - self::XML_NAME, self::XML_TYPE, self::XML_LEGACY_EXCERPT, self::XML_LEGACY_POST_STATUS, self::XML_IS_ACTIVE, - WPCF_AUTHOR, self::XML_META_SECTION - ); - } - - - /** - * Create an export object for this group, containing complete information including checksum and annotation. - * - * @return array - * @since 2.1 - */ - public function get_export_object() { - - $data = $this->get_export_fields(); - - $ie_controller = Types_Import_Export::get_instance(); - - $data = $ie_controller->add_checksum_to_object( $data, $this->get_keys_for_export_checksum() ); - - $data = $ie_controller->annotate_object( $data, $this->get_name(), $this->get_slug() ); - - return $data; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/group/factory.php b/backend/wordpress/wp-content/plugins/types/application/models/field/group/factory.php deleted file mode 100644 index d74e5b7..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/group/factory.php +++ /dev/null @@ -1,325 +0,0 @@ - 0 ) ) { - $fg_post = WP_Post::get_instance( $field_group ); - } else if ( is_string( $field_group ) ) { - $query = new WP_Query( array( 'post_type' => $this->get_post_type(), 'name' => $field_group, 'posts_per_page' => 1 ) ); - if( $query->have_posts() ) { - $fg_post = $query->get_posts(); - $fg_post = $fg_post[0]; - } - } else { - $fg_post = $field_group; - } - - if( $fg_post instanceof WP_Post && $this->get_post_type() == $fg_post->post_type ) { - return $fg_post; - } else { - return null; - } - } - - - /** - * @var array Array of field group instances for this post type, indexed by names (post slugs). - */ - private $field_groups = array(); - - - /** - * @param string $field_group_name Name of the field group. - * - * @return null|Types_Field_Group Field group instance or null if it's not cached. - */ - private function get_from_cache( $field_group_name ) { - if( defined( 'TYPES_DISABLE_CACHE' ) && TYPES_DISABLE_CACHE ) { - // disable caching - return null; - } - return wpcf_getarr( $this->field_groups, $field_group_name, null ); - } - - - /** - * Save a field group instance to cache. - * - * @param Types_Field_Group $field_group - */ - private function save_to_cache( $field_group ) { - if( defined( 'TYPES_DISABLE_CACHE' ) && TYPES_DISABLE_CACHE ) { - // disable caching - return; - } - $this->field_groups[ $field_group->get_slug() ] = $field_group; - } - - - /** - * Remove field group instance from cache. - * @param string $field_group_name - */ - private function clear_from_cache( $field_group_name ) { - unset( $this->field_groups[ $field_group_name ] ); - } - - - /** - * Load a field group instance. - * - * @param int|string|WP_Post $field_group_source Post ID of the field group, it's name or a WP_Post object. - * - * @return null|Types_Field_Group Field group or null if it can't be loaded. - */ - final public function load_field_group( $field_group_source ) { - - $post = null; - - // If we didn't get a field group name, we first need to get the post so we can look into the cache. - if( !is_string( $field_group_source ) ) { - $post = $this->get_post( $field_group_source ); - if( null == $post ) { - // There is no such post (or has wrong type). - return null; - } - $field_group_name = $post->post_name; - } else { - $field_group_name = $field_group_source; - } - - // Try to get an existing instance. - $field_group = $this->get_from_cache( $field_group_name ); - if( null != $field_group ) { - return $field_group; - } - - // We might already have the post by now. - if( null == $post ) { - $post = $this->get_post( $field_group_source ); - } - - // There is no such post (or has wrong type). - if( null == $post ) { - return null; - } - - // Create new field group instance - try { - $class_name = $this->get_field_group_class_name(); - $field_group = new $class_name( $post ); - } catch( Exception $e ) { - return null; - } - - $this->save_to_cache( $field_group ); - return $field_group; - } - - - /** - * Update cache after a field group is renamed. - * - * @param string $original_name The old name of the field group. - * @param Types_Field_Group $field_group The field group involved, with already updated name. - */ - public function field_group_renamed( $original_name, $field_group ) { - if( $field_group->get_post_type() == $this->get_post_type() ) { - $this->clear_from_cache( $original_name ); - $this->save_to_cache( $field_group ); - } - } - - - /** - * Create new field group. - * - * @param string $name Sanitized field group name. Note that the final name may change when new post is inserted. - * @param string $title Field group title. - * @param string $status Only 'draft'|'publish' are expected. Groups with the 'draft' status will appear as deactivated. - * - * @return null|Types_Field_Group The new field group or null on error. - */ - final public function create_field_group( $name, $title = '', $status = 'draft' ) { - - if( sanitize_title( $name ) != $name ) { - return null; - } - - $title = wp_strip_all_tags( $title ); - - $post_id = wp_insert_post( array( - 'post_type' => $this->get_post_type(), - 'post_name' => $name, - 'post_title' => empty( $title ) ? $name : $title, - 'post_status' => $status, - ) ); - - if( 0 == $post_id ) { - return null; - } - - // Store the mandatory postmeta, just to be safe. I'm not sure about invariants here. - update_post_meta( $post_id, Types_Field_Group::POSTMETA_FIELD_SLUGS_LIST, '' ); - - $field_group = $this->load_field_group( $post_id ); - - $field_group->execute_group_updated_action(); - - return $field_group; - } - - - /** - * Get field groups based on query arguments. - * - * @param array $query_args Optional. Arguments for the WP_Query that will be applied on the underlying posts. - * Post type query is added automatically. - * Additional arguments are allowed: - * - 'types_search': String for extended search. See WPCF_Field_Group::is_match() for details. - * - 'is_active' bool: If defined, only active/inactive field groups will be returned. - * - * @return Types_Field_Group[] - * @since 1.9 - */ - public function query_groups( $query_args = array() ) { - - // Read specific arguments - $search_string = wpcf_getarr( $query_args, 'types_search' ); - $is_active = wpcf_getarr( $query_args, 'is_active', null ); - - // Query posts - $query_args = array_merge( $query_args, array( 'post_type' => $this->get_post_type(), 'posts_per_page' => -1 ) ); - - // Group's "activeness" is defined by the post status. - if( null !== $is_active ) { - unset( $query_args['is_active'] ); - $query_args['post_status'] = ( $is_active ? 'publish' : 'draft' ); - } - - $query = new WP_Query( $query_args ); - $posts = $query->get_posts(); - - // Transform posts into Types_Field_Group - $all_groups = array(); - foreach( $posts as $post ) { - $field_group = $this->load_field_group( $post ); - if( null != $field_group ) { - $all_groups[] = $field_group; - } - } - - // Filter groups by the search string. - $selected_groups = array(); - if( empty( $search_string ) ) { - $selected_groups = $all_groups; - } else { - /** @var Types_Field_Group $group */ - foreach ( $all_groups as $group ) { - if ( $group->is_match( $search_string ) ) { - $selected_groups[] = $group; - } - } - } - - return $selected_groups; - } - - - /** - * Get a map of all field group slugs to their display names. - * - * @return string[] - * @since 2.0 - */ - public function get_group_slug_to_displayname_map() { - $groups = $this->query_groups(); - $group_names = array(); - foreach( $groups as $group ) { - $group_names[ $group->get_slug() ] = $group->get_display_name(); - } - return $group_names; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/group/post.php b/backend/wordpress/wp-content/plugins/types/application/models/field/group/post.php deleted file mode 100644 index 51e92f2..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/group/post.php +++ /dev/null @@ -1,138 +0,0 @@ -post_type ) { - throw new InvalidArgumentException( 'incorrect post type' ); - } - } - - - /** - * @return WPCF_Field_Definition_Factory Field definition factory of the correct type. - */ - protected function get_field_definition_factory() { - return WPCF_Field_Definition_Factory_Post::get_instance(); - } - - /** - * Assign a post type to the group - * @param $post_type - */ - public function assign_post_type( $post_type ) { - $post_types = $this->get_assigned_to_types(); - $post_types[] = $post_type; - - $this->store_post_types( $post_types ); - } - - /** - * Stores an array of post types as list in database - * - * @param array $post_types - */ - protected function store_post_types( $post_types ) { - // validate post types - foreach( $post_types as $type ) { - if( empty( $type ) || ! get_post_type( $type ) ) - unset( $post_types[$type] ); - } - - $post_types = empty( $post_types ) - ? '' - : implode( ',', $post_types ); - - update_post_meta( $this->get_id(), self::POSTMETA_POST_TYPE_LIST, $post_types ); - } - - - /** - * @inheritdoc - * - * @return array - * @since 2.1 - */ - protected function fetch_assigned_to_types() { - $db_assigned_to = get_post_meta( $this->get_id(), self::POSTMETA_POST_TYPE_LIST, true ); - - // in old types version we store "all" - if ( 'all' == $db_assigned_to ) { - return array(); - } - - // Keep your eyes open on storing values, - // This is needed because legacy code produces values like ,,,,a-post-type,, - $db_assigned_to = trim( $db_assigned_to, ',' ); - - // empty means all post types are selected - if ( empty( $db_assigned_to ) ) { - return array(); - } - - // we have selected post types - return explode( ',', $db_assigned_to ); - - } - - - /** - * @inheritdoc - * @return WP_Post[] Individual posts using this group. - * @since 2.1 - */ - protected function fetch_assigned_to_items() { - $assigned_posts = $this->get_assigned_to_types(); - - if( empty( $assigned_posts ) ) { - $assigned_posts = array( 'all' ); - } - - $items = get_posts( - array( - 'post_type' => $assigned_posts, - 'post_status' => 'any', - 'posts_per_page' => -1, - ) - ); - - return $items; - } - - - /** - * Get the backend edit link. - * - * @return string - * @since 2.1 - */ - public function get_edit_link() { - return admin_url() . '/admin.php?page=wpcf-edit&group_id=' . $this->get_id(); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/group/post_factory.php b/backend/wordpress/wp-content/plugins/types/application/models/field/group/post_factory.php deleted file mode 100644 index 3f14d4a..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/group/post_factory.php +++ /dev/null @@ -1,68 +0,0 @@ -load_field_group( $field_group ); - } - - - /** - * Create new field group. - * - * @param string $name Sanitized field group name. Note that the final name may change when new post is inserted. - * @param string $title Field group title. - * - * @return null|Types_Field_Group The new field group or null on error. - */ - public static function create( $name, $title = '', $status = 'draft' ) { - // we cannot use self::get_instance here, because of low PHP requirements and missing get_called_class function - // we have a fallback class for get_called_class but that scans files by debug_backtrace and return 'self' - // instead of Types_Field_Group_Term_Factory like the original get_called_class() function does - // ends in an error because of parents (abstract) $var = new self(); - return Types_Field_Group_Post_Factory::get_instance()->create_field_group( $name, $title, $status ); - } - - - public function get_post_type() { - return Types_Field_Group_Post::POST_TYPE; - } - - - protected function get_field_group_class_name() { - return 'Types_Field_Group_Post'; - } - - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/group/term.php b/backend/wordpress/wp-content/plugins/types/application/models/field/group/term.php deleted file mode 100644 index 4fb6ae3..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/group/term.php +++ /dev/null @@ -1,151 +0,0 @@ -post_type ) { - throw new InvalidArgumentException( 'incorrect post type' ); - } - } - - - /** - * @return WPCF_Field_Definition_Factory Field definition factory of the correct type. - */ - protected function get_field_definition_factory() { - return WPCF_Field_Definition_Factory_Term::get_instance(); - } - - - /** - * Get taxonomies that are associated with this field group. - * - * @return string[] Taxonomy slugs. Empty array means that this group should be displayed with all taxonomies. - */ - public function get_associated_taxonomies() { - $postmeta = get_post_meta( $this->get_id(), self::POSTMETA_ASSOCIATED_TAXONOMY, false ); - - // Survive empty or whitespace taxonomy slugs (skip them). They are invalid values but - // if we have only them, we need to return an empty array to keep the group displayed everywhere. - foreach( $postmeta as $index => $taxonomy_slug ) { - $taxonomy_slug = trim( $taxonomy_slug ); - if( empty( $taxonomy_slug ) ) { - unset( $postmeta[ $index ] ); - } - } - - return wpcf_ensarr( $postmeta ); - } - - - /** - * Quickly determine whether given taxonomy is associated with this group. - * - * @param string $taxonomy_slug - * @return bool - */ - public function has_associated_taxonomy( $taxonomy_slug ) { - $taxonomies = $this->get_associated_taxonomies(); - return ( empty( $taxonomies ) || in_array( $taxonomy_slug, $taxonomies ) ); - } - - - /** - * Remove association with a single taxonomy from the database. - * - * @param string $taxonomy_slug Slug of the taxonomy. - */ - private function remove_associated_taxonomy( $taxonomy_slug ) { - if( empty( $taxonomy_slug ) ) { - return; - } - delete_post_meta( $this->get_id(), self::POSTMETA_ASSOCIATED_TAXONOMY, $taxonomy_slug ); - $this->execute_group_updated_action(); - } - - - /** - * Add an association with a single taxonomy to the database. - * - * @param string $taxonomy_slug Slug of the taxonomy. If empty or not sanitized, the function does nothing. - */ - private function add_associated_taxonomy( $taxonomy_slug ) { - if( empty( $taxonomy_slug ) || $taxonomy_slug != sanitize_title( $taxonomy_slug )) { - return; - } - add_post_meta( $this->get_id(), self::POSTMETA_ASSOCIATED_TAXONOMY, $taxonomy_slug ); - $this->execute_group_updated_action(); - } - - - /** - * Update the set of taxonomies associated with this field group. - * - * @param string[] $taxonomy_slugs Array of (sanitized) taxonomy slugs. - */ - public function update_associated_taxonomies( $taxonomy_slugs ) { - $current_taxonomies = $this->get_associated_taxonomies(); - - // Remove taxonomies that are associated but shouldn't be. - $to_remove = array_diff( $current_taxonomies, $taxonomy_slugs ); - foreach( $to_remove as $taxonomy_slug ) { - $this->remove_associated_taxonomy( $taxonomy_slug ); - } - - // Add taxonomies that aren't associated but should be. - $to_add = array_diff( $taxonomy_slugs, $current_taxonomies ); - foreach( $to_add as $taxonomy_slug ) { - $this->add_associated_taxonomy( $taxonomy_slug ); - } - } - - - /** Element name for a single associated taxonomy. */ - const XML_ASSOCIATED_TAXONOMY = 'taxonomy'; - - - /** - * @inheritdoc - * - * Add term field group-specific information to the export object. - * - * @return array - * @since 2.1 - */ - protected function get_export_fields() { - - $data = parent::get_export_fields(); - - // Array of slugs of associated taxonomies. - $associated_taxonomy_data = implode( ',', $this->get_associated_taxonomies() ); - - // parent::XML_META_SECTION is ensured by the parent method - $data[ parent::XML_META_SECTION ][ self::POSTMETA_ASSOCIATED_TAXONOMY ] = $associated_taxonomy_data; - - return $data; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/group/term_factory.php b/backend/wordpress/wp-content/plugins/types/application/models/field/group/term_factory.php deleted file mode 100644 index ff305d2..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/group/term_factory.php +++ /dev/null @@ -1,149 +0,0 @@ -load_field_group( $field_group ); - } - - - /** - * Create new field group. - * - * @param string $name Sanitized field group name. Note that the final name may change when new post is inserted. - * @param string $title Field group title. - * - * @return null|Types_Field_Group The new field group or null on error. - */ - public static function create( $name, $title = '' ) { - // we cannot use self::get_instance here, because of low PHP requirements and missing get_called_class function - // we have a fallback class for get_called_class but that scans files by debug_backtrace and return 'self' - // instead of Types_Field_Group_Term_Factory like the original get_called_class() function does - // ends in an error because of parents (abstract) $var = new self(); - return Types_Field_Group_Term_Factory::get_instance()->create_field_group( $name, $title ); - } - - - public function get_post_type() { - return Types_Field_Group_Term::POST_TYPE; - } - - - protected function get_field_group_class_name() { - return 'Types_Field_Group_Term'; - } - - - /** - * @var null|Types_Field_Group_Term[][] Cache for the get_groups_by_taxonomies() method. - */ - private $taxonomy_assignment_cache = null; - - - /** - * Clears the cache for taxonomy assignemnts. - * It is only used for testing purposes. - * - * @since 2.2 - * @deprecated deprecated since version 2.2 - */ - public function clear_taxonomy_assignment_cache() { - $this->taxonomy_assignment_cache = null; - } - - - /** - * Produce a list of all taxonomies with groups that belong to them. - * - * @return Types_Field_Group_Term[][] Associative array where keys are taxonomy slugs and values are arrays of field - * groups that are associated with those taxonomies. - */ - public function get_groups_by_taxonomies() { - if( null == $this->taxonomy_assignment_cache ) { - $groups = $this->query_groups(); - $taxonomies = get_taxonomies(); - - $this->taxonomy_assignment_cache = array(); - foreach( $taxonomies as $taxonomy ) { - $taxonomy_slug = $taxonomy; - $groups_for_taxonomy = array(); - - foreach( $groups as $group ) { - if( $group instanceof Types_Field_Group_Term - && $group->is_active() - && $group->has_associated_taxonomy( $taxonomy_slug ) - ) { - $groups_for_taxonomy[] = $group; - } - } - - $this->taxonomy_assignment_cache[ $taxonomy_slug ] = $groups_for_taxonomy; - } - } - - return $this->taxonomy_assignment_cache; - } - - - /** - * Get array of groups that are associated with given taxonomy. - * - * @param string $taxonomy_slug Slug of the taxonomy - * - * @return Types_Field_Group_Term[] Associated term field groups. - */ - public function get_groups_by_taxonomy( $taxonomy_slug ) { - $groups_by_taxonomies = $this->get_groups_by_taxonomies(); - return wpcf_ensarr( wpcf_getarr( $groups_by_taxonomies, $taxonomy_slug ) ); - } - - - /** - * This needs to be executed whenever a term group is updated. - * - * Hooked into the wpcf_group_updated action. - * Erases cache for the get_groups_by_taxonomies() method. - * - * @param int $group_id Ignored - * @param Types_Field_Group $group Field group that has been just updated. - */ - public function on_group_updated( /** @noinspection PhpUnusedParameterInspection */ $group_id, $group ) { - if( $group instanceof Types_Field_Group_Term ) { - $this->taxonomy_assignment_cache = null; - } - } - - - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/group/user.php b/backend/wordpress/wp-content/plugins/types/application/models/field/group/user.php deleted file mode 100644 index fe3e0ff..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/group/user.php +++ /dev/null @@ -1,34 +0,0 @@ -post_type ) { - throw new InvalidArgumentException( 'incorrect post type' ); - } - } - - - /** - * @return WPCF_Field_Definition_Factory Field definition factory of the correct type. - */ - protected function get_field_definition_factory() { - return WPCF_Field_Definition_Factory_User::get_instance(); - } - - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/group/user_factory.php b/backend/wordpress/wp-content/plugins/types/application/models/field/group/user_factory.php deleted file mode 100644 index 55035ea..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/group/user_factory.php +++ /dev/null @@ -1,68 +0,0 @@ -load_field_group( $field_group ); - } - - - /** - * Create new field group. - * - * @param string $name Sanitized field group name. Note that the final name may change when new post is inserted. - * @param string $title Field group title. - * - * @return null|Types_Field_Group The new field group or null on error. - */ - public static function create( $name, $title = '' ) { - // we cannot use self::get_instance here, because of low PHP requirements and missing get_called_class function - // we have a fallback class for get_called_class but that scans files by debug_backtrace and return 'self' - // instead of Types_Field_Group_Term_Factory like the original get_called_class() function does - // ends in an error because of parents (abstract) $var = new self(); - return Types_Field_Group_User_Factory::get_instance()->create_field_group( $name, $title ); - } - - - public function get_post_type() { - return Types_Field_Group_User::POST_TYPE; - } - - - protected function get_field_group_class_name() { - return 'Types_Field_Group_User'; - } - - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/type/definition.php b/backend/wordpress/wp-content/plugins/types/application/models/field/type/definition.php deleted file mode 100644 index ed2a295..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/type/definition.php +++ /dev/null @@ -1,262 +0,0 @@ -field_type_slug = $field_type_slug; - - // Try to fall back to legacy "title", and if even that fails, use id instead. - $this->display_name = sanitize_text_field( wpcf_getarr( $args, 'display_name', wpcf_getarr( $args, 'title', $field_type_slug ) ) ); - - $this->description = wpcf_getarr( $args, 'description', '' ); - $this->args = $args; - } - - - public function get_slug() { return $this->field_type_slug; } - - public function get_display_name() { return $this->display_name; } - - public function get_description() { return $this->description; } - - - /** - * Determine if the fields of this type can be repetitive. - * - * @return bool - * @since 2.0 - */ - public function can_be_repetitive() { return true; } - - - /** - * Direct access to the field type configuration. - * - * It is strongly encouraged to write custom (and safe) getters for anything you need to get from it. - * - * @param null|string $argument_name Specific argument name or null to return all arguments. - * @param string $default Default value when a specific argument is not set. - * @return array|mixed - * @since 2.0 - */ - public function get_args( $argument_name = null, $default = '' ) { - if( null == $argument_name ) { - return $this->args; - } else { - return wpcf_getarr( $this->args, $argument_name, $default ); - } - } - - - /** - * Retrieve CSS classes for a field type icon. - * - * To be placed in the i tag. - * - * @return string One or more CSS classes separated by spaces. - * @since 2.0 - */ - public function get_icon_classes() { - $fa_class = $this->get_args( 'font-awesome', null ); - if( null != $fa_class ) { - return sprintf( 'fa fa-%s', esc_attr( $fa_class ) ); - } - - $types_class = $this->get_args( 'types-field-image', null ); - if( null != $types_class ) { - return sprintf( 'types-field-icon types-field-icon-%s', esc_attr( $types_class ) ); - } - - return ''; - } - - - /** - * Perform field type-specific sanitization of the field definition array. - * - * @link https://git.onthegosystems.com/toolset/types/wikis/database-layer/field-definition-arrays - * @param $definition_array - * @return array Sanitized definition array - * @since 2.1 - */ - protected function sanitize_field_definition_array_type_specific( $definition_array ) { - return $definition_array; - } - - - /** - * Perform a very generic sanitization of the field definition array. - * - * Should be used only by sanitize_field_definition_array(). - * - * @param array $definition_array - * @return array - * @since 2.1 - */ - private function sanitize_field_definition_array_generic( $definition_array ) { - // slug: sanitize_title - $definition_array['slug'] = sanitize_title( wpcf_getarr( $definition_array, 'slug' ) ); - - // type: default to textfield - $definition_array['type'] = wpcf_getarr( $definition_array, 'type', Types_Field_Type_Definition_Factory::TEXTFIELD ); - - // name: sanitize_text_field - $definition_array['name'] = sanitize_text_field( wpcf_getarr( $definition_array, 'name' ) ); - - // description: ensure it is set - $definition_array['description'] = wpcf_getarr( $definition_array, 'description' ); - - // meta_key: default to wpcf-{$slug} - $definition_array['meta_key'] = wpcf_getarr( $definition_array, 'meta_key', WPCF_Field_Definition::FIELD_META_KEY_PREFIX . $definition_array['slug'] ); - - // data: must be an array - $definition_array['data'] = wpcf_ensarr( wpcf_getarr( $definition_array, 'data' ) ); - - // data[conditional_display]: must be an array - $definition_array['data']['conditional_display'] = wpcf_ensarr( wpcf_getarr( $definition_array['data'], 'conditional_display' ) ); - - // data[validate]: must be an array - $definition_array['data']['validate'] = wpcf_ensarr( wpcf_getarr( $definition_array['data'], 'validate' ) ); - - return $definition_array; - } - - - /** - * Make sure that the field definition array contains all necessary information. - * - * Note: This is a WIP, currently it sanitizes only very specific cases. It should be extended in the future. - * - * @link https://git.onthegosystems.com/toolset/types/wikis/database-layer/field-definition-arrays - * @param array $definition_array Field definition array - * @return array Field definition array that is safe to be used even with legacy code. - * @since 2.0 - */ - public final function sanitize_field_definition_array( $definition_array ) { - - /** - * types_pre_sanitize_field_definition_array - * - * Allow for additional field definition array sanitization before the standard one runs. - * - * @param mixed $definition_array - * @return array - * @since 2.1 - */ - $definition_array = wpcf_ensarr( apply_filters( 'types_pre_sanitize_field_definition_array', $definition_array ) ); - - $definition_array = $this->sanitize_field_definition_array_generic( $definition_array ); - - $definition_array = $this->sanitize_numeric_validation( $definition_array ); - - $definition_array = $this->sanitize_field_definition_array_type_specific( $definition_array ); - - /** - * types_post_sanitize_field_definition_array - * - * Allow for additional field definition array sanitization after the standard one runs. - * - * @param array $definition_array - * @return array - * @since 2.1 - */ - $definition_array = wpcf_ensarr( apply_filters( 'types_post_sanitize_field_definition_array', $definition_array ) ); - - return $definition_array; - } - - - /** - * For all fields, remove the "number" validation option. - * - * Numeric field will override this and do the opposite instead. - * - * @param array $definition_array - * @return array - * @since 2.0 - */ - protected function sanitize_numeric_validation( $definition_array ) { - - // This is what wpcf_admin_custom_fields_change_type() was doing. - if( isset( $definition_array['data']['validate']['number'] ) ) { - unset( $definition_array['data']['validate']['number'] ); - } - - return $definition_array; - } - - - /** - * Perform a basic "isset" sanitization of an array element. - * - * @param array $source - * @param string $element_name Name of the element to sanitize. - * @param string $default Default value for the element if not set or invalid. - * @param null|array $allowed If an array, defines the set of allowed values for the element. - * @param null|string $nested_key If not null, the element will be taken from $source[$nested_key][$element_name]. - * @return array Updated source array. - * @since 2.1 - */ - protected function sanitize_element_isset( $source, $element_name, $default = '', $allowed = null, $nested_key = null ) { - $src_array = ( null == $nested_key ? $source : $source[ $nested_key ] ); - $value = wpcf_getarr( $src_array, $element_name, $default, $allowed ); - - if( null == $nested_key ) { - $source[ $element_name ] = $value; - } else { - $source[ $nested_key ][ $element_name ] = $value; - } - - return $source; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/field/type/definition_factory.php b/backend/wordpress/wp-content/plugins/types/application/models/field/type/definition_factory.php deleted file mode 100644 index 43dce2f..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/field/type/definition_factory.php +++ /dev/null @@ -1,246 +0,0 @@ -legacy_field_types ) { - $this->legacy_field_types = WPCF_Fields::getFieldsTypes(); - } - return $this->legacy_field_types; - } - - - /** - * Load a field type definition. - * - * @param string $field_type_slug Slug of the field type. If the function fails to find the field type and the slug - * starts with a "wpcf-" prefix, it attempts to remove it and search again. This way, passing a field type ID, - * which usually has this form, is also supported. - * @return null|Types_Field_Type_Definition Field type definition or null if it can't be loaded. - */ - public function load_field_type_definition( $field_type_slug ) { - - if( !is_string( $field_type_slug ) ) { - return null; - } - - // Check if we can use cached version. - if( !array_key_exists( $field_type_slug, $this->field_type_definitions ) ) { - - // now it gets hacky - $field_types = $this->get_legacy_field_types(); - if( !array_key_exists( $field_type_slug, $field_types ) ) { - // Field slug not recognized. Maybe we got a field identifier instead. Check if we can remove - // the wpcf- prefix and try again. - $prefix = 'wpcf-'; - if( substr( $field_type_slug, 0, strlen( $prefix ) ) == $prefix ) { - $field_type_slug = substr( $field_type_slug, strlen( $prefix ) ); - if( !array_key_exists( $field_type_slug, $field_types ) ) { - // Removing prefix didn't help - return null; - } - // Check the cache again (now with correct slug). - if( array_key_exists( $field_type_slug, $this->field_type_definitions ) ) { - return $this->field_type_definitions[ $field_type_slug ]; - } - } else { - // There was no prefix to remove. - return null; - } - } - - // Not using getFieldTypeData() directly to avoid unnecessary getFieldsTypes() and filter applying. - $field_type_configuration_path = $field_types[ $field_type_slug ]; - $field_type_configuration = WPCF_Fields::getFieldTypeConfig( $field_type_configuration_path ); - - $field_type_id = wpcf_getarr( $field_type_configuration, 'id', null ); - if( null == $field_type_id ) { - return null; - } - - try { - $field_type_definition = $this->create_definition_instance( $field_type_slug, $field_type_configuration ); - } catch( Exception $e ) { - return null; - } - - // Save new instance to cache. - $this->field_type_definitions[ $field_type_slug ] = $field_type_definition; - } - - // Use cache. - return $this->field_type_definitions[ $field_type_slug ]; - } - - - /** - * Create the proper instance of a type definition class, based on the type slug. - * - * @param string $field_type_slug - * @param array $field_type_configuration Legacy configuration array - * @return Types_Field_Type_Definition - * @since 2.0 - * @throws Exception - */ - private function create_definition_instance( $field_type_slug, $field_type_configuration ) { - switch( $field_type_slug ) { - case self::DATE: - return new Types_Field_Type_Definition_Date( $field_type_configuration ); - case self::CHECKBOX: - return new Types_Field_Type_Definition_Checkbox( $field_type_configuration ); - case self::CHECKBOXES: - return new Types_Field_Type_Definition_Checkboxes( $field_type_configuration ); - case self::NUMERIC: - return new Types_Field_Type_Definition_Numeric( $field_type_configuration ); - case self::RADIO: - return new Types_Field_Type_Definition_Radio( $field_type_configuration ); - case self::SELECT: - return new Types_Field_Type_Definition_Select( $field_type_configuration ); - case self::WYSIWYG: - return new Types_Field_Type_Definition_Singular( $field_type_slug, $field_type_configuration ); - default: - return new Types_Field_Type_Definition( $field_type_slug, $field_type_configuration ); - } - } - - - /** - * Get field type definitions from an array of slugs. - * - * If a definition cannot be loaded for a given slug, the slug is skipped without reporting an error in any other way. - * - * @param string[] $field_type_slugs - * @return Types_Field_Type_Definition[] - * @since 2.0 - */ - public function load_multiple_definitions( $field_type_slugs ) { - $results = array(); - $field_type_slugs = wpcf_ensarr( $field_type_slugs ); - foreach( $field_type_slugs as $field_type_slug ) { - $type_definition = $this->load_field_type_definition( $field_type_slug ); - if( null != $type_definition ) { - $results[ $field_type_slug ] = $type_definition; - } - } - return $results; - } - - - /** - * Get all field type definitions available. - * - * @return Types_Field_Type_Definition[] - * @since 2.0 - */ - public function get_all_definitions() { - $legacy_types = $this->get_legacy_field_types(); - $definitions = array(); - foreach( $legacy_types as $type_slug => $ignored ) { - $defintion = $this->load_field_type_definition( $type_slug ); - if( null != $defintion ) { - $definitions[] = $defintion; - } - } - return $definitions; - } - - - /** - * Get a map of all field definition slugs to their properties. - * - * @return string[] - * @since 2.0 - */ - public function get_field_type_definitions() { - $field_types = $this->get_all_definitions(); - $field_type_names = array(); - foreach( $field_types as $field_type ) { - $field_type_names[ $field_type->get_slug() ] = array( - 'slug' => $field_type->get_slug(), - 'displayName' => stripslashes( $field_type->get_display_name() ), - 'canBeRepetitive' => $field_type->can_be_repetitive(), - 'iconClasses' => $field_type->get_icon_classes() - ); - } - - return $field_type_names; - } - - - /** - * Static shortcut to load_field_type_definition. - * - * @param string $field_type_slug - * @return null|Types_Field_Type_Definition - */ - public static function load( $field_type_slug ) { - // we cannot use self::get_instance here, because of low PHP requirements and missing get_called_class function - // we have a fallback class for get_called_class but that scans files by debug_backtrace and return 'self' - // instead of Types_Field_Type_Definition_Factory like the original get_called_class() function does - // ends in an error because of parents (abstract) $var = new self(); - return Types_Field_Type_Definition_Factory::get_instance()->load_field_type_definition( $field_type_slug ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition.php deleted file mode 100644 index 38c8c72..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition.php +++ /dev/null @@ -1,49 +0,0 @@ -name; - } - - public function set_condition( $value ) { - $this->condition = $value; - } - - public function valid() {} - - public static function set_post_type( $posttype = false ) { - if( ! $posttype ) { - global $typenow; - - $posttype = isset( $typenow ) && ! empty( $typenow ) ? $typenow : false; - } - - if( $posttype ) - self::$post_type = get_post_type_object( $posttype ); - } - - public static function get_post_type() { - if( self::$post_type === null ) - self::set_post_type(); - - return self::$post_type; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/exists.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/exists.php deleted file mode 100644 index 5054051..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/exists.php +++ /dev/null @@ -1,35 +0,0 @@ -templates = array( - 'archive-' . $cpt->name . '.php', - 'archive.php' - ); - } - - protected function has_archive() { - $cpt = Types_Helper_Condition::get_post_type(); - if( ! get_post_type_archive_link( $cpt->name ) ) - return false; - - return true; - } - - - public function valid() { - if( ! $this->has_archive() ) - return false; - - return parent::valid(); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/has_fields.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/has_fields.php deleted file mode 100644 index 289a213..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/has_fields.php +++ /dev/null @@ -1,23 +0,0 @@ -has_archive() ) - return false; - - $template = $this->find_template(); - - // no template available - if( empty( $template ) ) - return false; - - // opposite of parents "No Fields". - return ! parent::valid(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/missing.php deleted file mode 100644 index 1f18e0f..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/missing.php +++ /dev/null @@ -1,17 +0,0 @@ -has_archive() ) - return false; - - // opposite of parents "Archive Exists" - return ! parent::valid(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/no_fields.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/no_fields.php deleted file mode 100644 index 966be41..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/no_fields.php +++ /dev/null @@ -1,38 +0,0 @@ -has_archive() ) - return false; - - $template = $this->find_template(); - - // no template available - if( empty( $template ) ) - return false; - - // do not check if there are no fields assigned to current post - // this check is not placed very well as it's out of class scope - $check_fields_assigned = new Types_Helper_Condition_Type_Fields_Assigned(); - if( ! $check_fields_assigned->valid() ) - return false; - - $file = new Toolset_Filesystem_File(); - - // abort if file can't be found - if( ! $file->open( $template ) ) - return false; - - // check for fields, abort if there results in true - if( $file->search( array( 'types_render_field', 'wpcf-' ) ) ) - return false; - - return true; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/no_support.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/no_support.php deleted file mode 100644 index ff51c6e..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/archive/no_support.php +++ /dev/null @@ -1,16 +0,0 @@ -has_archive && $cpt->name != 'post' ) - return false; - - return true; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/cred/active.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/cred/active.php deleted file mode 100644 index 53a04f8..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/cred/active.php +++ /dev/null @@ -1,18 +0,0 @@ -name] ) ) - return true; - - // @todo check with Francesco if CRED has a get_forms_of_post_type() function - $forms_settings = $wpdb->get_results( "SELECT meta_value, post_id FROM $wpdb->postmeta WHERE meta_key = '_cred_form_settings'" ); - - foreach( $forms_settings as $setting ) { - $post_type = false; - $setting->meta_value = unserialize( $setting->meta_value ); - - // post type - if( isset( $setting->meta_value->post['post_type'] ) ) - $post_type = $setting->meta_value->post['post_type']; - - // different structure created by CredFormCreator - // (surely old style, but compatible with new and restructured after first form save) - if( ! $post_type && is_array( $setting->meta_value ) && isset( $setting->meta_value['post_type'] ) ) - $post_type = $setting->meta_value['post_type']; - - // another structure... - if( ! $post_type && is_object( $setting->meta_value ) && isset( $setting->meta_value->post_type ) ) - $post_type = $setting->meta_value->post_type; - - if( $post_type && $cpt->name == $post_type ) { - $title = get_the_title( $setting->post_id ); - - self::$forms_per_post_type[$cpt->name][] = array( - 'id' => $setting->post_id, - 'name' => $title - ); - } - } - - if( isset( self::$forms_per_post_type[$cpt->name] ) ) - return true; - - return false; - } - - public static function get_forms_of_post_type() { - $cpt = Types_Helper_Condition::get_post_type(); - - if( isset( self::$forms_per_post_type[$cpt->name] ) ) - return self::$forms_per_post_type[$cpt->name]; - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/cred/forms_missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/cred/forms_missing.php deleted file mode 100644 index 36cf1c9..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/cred/forms_missing.php +++ /dev/null @@ -1,19 +0,0 @@ -valid(); - } - - return self::$layout_id[$type]; - } - - public static function get_layout_name() { - $type = self::get_type_name(); - - if( !isset( self::$layout_name[$type] ) ) - self::$layout_name[$type] = get_the_title( self::get_layout_id() ); - - return self::$layout_name[$type]; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/archive_missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/archive_missing.php deleted file mode 100644 index fc2c999..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/archive_missing.php +++ /dev/null @@ -1,18 +0,0 @@ -templates = array( - 'single-' . $cpt->name . '.php', - 'archive-' . $cpt->name . '.php', - 'single.php', - 'archive.php', - 'index.php' - ); - } - - public function valid() { - // theme + theme integration running - if ( defined( 'LAYOUTS_INTEGRATION_THEME_NAME' ) ) { - return true; - } - - $filesystem = new Toolset_Filesystem_File(); - foreach ( $this->templates as $name => $file ) { - // file exists - if ( $filesystem->open( get_template_directory() . '/' . $file ) - || $filesystem->open( get_stylesheet_directory() . '/' . $file ) - ) { - // supports layouts - if ( $filesystem->search( 'the_ddlayout' ) ) { - return true; - } - - // if for example single.php exists and it does not support Layouts we don't need to look at index.php - return false; - } - } - - // no file exists - return false; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/missing.php deleted file mode 100644 index dbd038f..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/missing.php +++ /dev/null @@ -1,14 +0,0 @@ -get_results( "SELECT meta_value, post_id FROM $wpdb->postmeta WHERE meta_key = '_ddl_post_types_was_batched'" ); - - foreach( $layouts_per_post_type as $setting ) { - - $setting->meta_value = unserialize( $setting->meta_value ); - - if( is_array( $setting->meta_value ) - && in_array( $type, $setting->meta_value ) ) { - - if( get_post_status( $setting->post_id) == 'trash' ) - continue; - - $title = get_the_title( $setting->post_id ); - self::$layout_id[$type] = $setting->post_id; - self::$layout_name[$type] = $title; - return true; - } - } - - self::$layout_id[$type] = false; - self::$layout_name[$type] = false; - return false; - - } - - public static function get_layout_id() { - $type = self::get_type_name(); - - if( ! isset( self::$layout_id[$type] ) ) { - $self = new Types_Helper_Condition_Layouts_Template_Exists(); - $self->valid(); - } - - return self::$layout_id[$type]; - } - - public static function get_layout_name() { - $type = self::get_type_name(); - - if( ! isset( self::$layout_name[$type] ) ) - self::$layout_name[$type] = get_the_title( self::get_layout_id() ); - - return self::$layout_name[$type]; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/template_missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/template_missing.php deleted file mode 100644 index 564eb08..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/layouts/template_missing.php +++ /dev/null @@ -1,22 +0,0 @@ -condition == $pagenow ) - return true; - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/exists.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/exists.php deleted file mode 100644 index 39f5042..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/exists.php +++ /dev/null @@ -1,18 +0,0 @@ -templates = array( - 'single-' . $cpt->name . '.php', - 'single.php' - ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/has_fields.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/has_fields.php deleted file mode 100644 index 5013a7b..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/has_fields.php +++ /dev/null @@ -1,21 +0,0 @@ -find_template(); - - // no template available - if( empty( $template ) ) - return false; - - // opposite of parents "No Fields". - return ! parent::valid(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/missing.php deleted file mode 100644 index 1ae6f77..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/single/missing.php +++ /dev/null @@ -1,14 +0,0 @@ -find_template(); - - // no template available - if( empty( $template ) ) - return false; - - // do not check if there are no fields assigned to current post - // this check is not placed very well as it's out of class scope - $check_fields_assigned = new Types_Helper_Condition_Type_Fields_Assigned(); - if( ! $check_fields_assigned->valid() ) - return false; - - $file = new Toolset_Filesystem_File(); - - // abort if file can't be found - if( ! $file->open( $template ) ) - return false; - - // check for fields, abort if there results in true - if( $file->search( array( 'types_render_field', 'wpcf-' ) ) ) - return false; - - return true; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/template.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/template.php deleted file mode 100644 index 2f0c364..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/template.php +++ /dev/null @@ -1,27 +0,0 @@ -templates ) ; - - return $template; - } - - // check if current screen is screen - public function valid() { - $template = $this->find_template(); - - if( empty( $template ) ) - return false; - - return true; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/type/fields_assigned.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/type/fields_assigned.php deleted file mode 100644 index c1f9150..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/type/fields_assigned.php +++ /dev/null @@ -1,38 +0,0 @@ -name ) ) - return false; - - // query a post - $query = new WP_Query( 'post_type=' . $post_type->name . '&posts_per_page=1' ); - - if( $query->have_posts() ) { - $post = $query->posts[0]; - - // for the case no post created yet (post fields group edit page / post type edit page) - } else { - $post = new stdClass(); - $post->ID = -1; - $post->post_type = $post_type->name; - } - - if( !function_exists( 'wpcf_admin_post_get_post_groups_fields') ) - include_once( WPCF_EMBEDDED_ABSPATH . '/includes/fields-post.php' ); - - $fields = wpcf_admin_post_get_post_groups_fields( $post ); - - if( - isset( $fields ) - && is_array( $fields ) - && !empty( $fields ) - ) return true; - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/type/no_post_or_page.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/type/no_post_or_page.php deleted file mode 100644 index d9523b5..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/type/no_post_or_page.php +++ /dev/null @@ -1,8 +0,0 @@ -valid(); - } - - return self::$template_id[$type]; - } - - public static function get_template_name() { - $type = self::get_type_name(); - - if( ! isset( self::$template_name[$type] ) ) - self::$template_name[$type] = get_the_title( self::get_template_id() ); - - return self::$template_name[$type]; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/archive_missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/archive_missing.php deleted file mode 100644 index cb57516..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/archive_missing.php +++ /dev/null @@ -1,19 +0,0 @@ -valid() ) - return self::get_template_id(); - } - - public static function get_template_name() { - $type = self::get_type_name(); - - if( ! isset( self::$template_name[$type] ) ) - self::$template_name[$type] = get_the_title( self::get_template_id() ); - - return self::$template_name[$type]; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/template_missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/template_missing.php deleted file mode 100644 index 240a5f4..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/template_missing.php +++ /dev/null @@ -1,19 +0,0 @@ -name] ) ) - return true; - - // @todo check with Juan if views has a get_views_of_post_type() function - $views_settings = $wpdb->get_results( "SELECT meta_value, post_id FROM $wpdb->postmeta WHERE meta_key = '_wpv_settings'" ); - - foreach( $views_settings as $setting ) { - $setting->meta_value = unserialize( $setting->meta_value ); - if( ! isset( $setting->meta_value['view-query-mode'] ) - || $setting->meta_value['view-query-mode'] != 'normal' ) { - // no "View" - continue; - } - - if( isset( $setting->meta_value['post_type'] ) - && in_array( $cpt->name, $setting->meta_value['post_type'] ) ) { - - if( get_post_status( $setting->post_id) == 'trash' ) - continue; - - $title = get_the_title( $setting->post_id ); - self::$views_per_post_type[$cpt->name][] = array( - 'id' => $setting->post_id, - 'name' => $title - ); - } - } - - if( isset( self::$views_per_post_type[$cpt->name] ) ) - return true; - - return false; - } - - public static function get_views_of_post_type() { - $cpt = Types_Helper_Condition::get_post_type(); - - if( isset( self::$views_per_post_type[$cpt->name] ) ) - return self::$views_per_post_type[$cpt->name]; - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/views_missing.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/views_missing.php deleted file mode 100644 index e402ea9..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/condition/views/views_missing.php +++ /dev/null @@ -1,19 +0,0 @@ -needed_components_loaded() ) - return false; - - global $WPV_settings; - - // option key for Views Content Templates is "views_template_for_{post-type-name}" - $option = sanitize_text_field( sprintf( 'views_template_for_%s', $type ) ); - - // already has an content template - if( isset( $WPV_settings[$option] ) && is_numeric( $WPV_settings[$option] ) && $WPV_settings[$option] > 0 ) - return $WPV_settings[$option]; - - // create name if not given - if( ! $name ) { - $type_object = get_post_type_object( $type ); - $name = sprintf( __( 'Template for %s', 'wpcf' ), $type_object->labels->name ); - } - - $name = $this->validate_name( $name ); - - // abort if name not valid (shouldn't happen, see validate_name()) - if( ! $name ) - return false; - - // create template - $ct = WPV_Content_Template::create( $name ); - $ct_post = get_post( $ct->id ); - - if( $ct_post === null ) - return false; - - $WPV_settings[$option] = $ct_post->ID; - $WPV_settings->save(); - - // get all posts of post type to assign the new content template - $posts = get_posts( 'post_type=' . $type . '&post_status=any&posts_per_page=-1&fields=ids' ); - - foreach( $posts as $id ) { - $ct = get_post_meta( $id, '_views_template', true ); - - // only assign if there is not already an assigned content template - if( empty( $ct ) ) - update_post_meta( $id, '_views_template', $ct_post->ID ); - - } - - return $ct_post->ID; - } - - /** - * Checks all dependencies - * - * @return bool - * @since 2.0 - */ - private function needed_components_loaded( ) { - global $WPV_settings; - if( - ! is_object( $WPV_settings ) - || ! class_exists( 'WPV_Content_Template' ) - || ! method_exists( 'WPV_Content_Template', 'create' ) - ) return false; - - return true; - } - - - /** - * Will proof if given name is already in use. - * If so it adds an running number until name is available - * - * @param $name - * @param int $id | should not manually added - * - * @return string - * @since 2.0 - */ - private function validate_name( $name, $id = 1 ) { - $name_exists = get_page_by_title( html_entity_decode( $name ), OBJECT, 'view-template' ); - - if( $name_exists ) { - $name = $id > 1 ? rtrim( rtrim( $name, $id - 1 ) ) : $name; - return $this->validate_name( $name . ' ' . $id, $id + 1 ); - } - - return $name; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/form.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/create/form.php deleted file mode 100644 index bf6f30a..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/form.php +++ /dev/null @@ -1,70 +0,0 @@ -labels->name ); - } - - $name = $this->validate_name( $name ); - - $id = CredFormCreator::cred_create_form( $name, 'new', $type ); - return $id; - } - - /** - * Will proof if given name is already in use. - * If so it adds an running number until name is available - * - * @param $name - * @param int $id - * - * @return string - * @since 2.0 - */ - private function validate_name( $name, $id = 1 ) { - $name_exists = get_page_by_title( html_entity_decode( $name ), OBJECT, CRED_FORMS_CUSTOM_POST_NAME ); - - if( $name_exists !== null ) { - $name = $id > 1 ? rtrim( rtrim( $name, $id - 1 ) ) : $name; - return $this->validate_name( $name . ' ' . $id, $id + 1 ); - } - - return $name; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/layout.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/create/layout.php deleted file mode 100644 index 561d69b..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/layout.php +++ /dev/null @@ -1,164 +0,0 @@ -labels->name ); - } - - $name = $this->validate_name( $name ); - - if( ! $name ) - return false; - - // create layout - $layout_id = $this->create_layout( $name ); - - if( ! $layout_id ) - return false; - - // get all items of post type - $posts = get_posts( 'post_type=' . $type . '&post_status=any&posts_per_page=-1&fields=ids' ); - - // store layout assignments before assign new - $post_has_layout = array(); - foreach( $posts as $id ) { - $layout = get_post_meta( $id, WPDDL_LAYOUTS_META_KEY, true ); - if( !empty( $layout ) ) { - $post_has_layout[] = array( - 'id' => $id, - 'layout-slug' => $layout - ); - } - } - - // assign the new layout to all post types - global $wpddlayout; - $wpddlayout->post_types_manager->handle_set_option_and_bulk_at_once( $layout_id, array( $type ), array( $type ) ); - - // restore previously assigned layouts - if( !empty( $post_has_layout ) ) { - foreach( $post_has_layout as $post ) { - update_post_meta( $post['id'], WPDDL_LAYOUTS_META_KEY, $post['layout-slug'] ); - } - } - - return $layout_id; - } - - /** - * Checks all dependencies - * - * @return bool - * @since 2.0 - */ - private function needed_components_loaded( ) { - global $wpddlayout; - if( - ! is_object( $wpddlayout ) - || ! class_exists( 'WPDD_Layouts' ) - || ! class_exists( 'WPDDL_Options' ) - || ! class_exists( 'WPDD_Layouts_Users_Profiles' ) - || ! method_exists( 'WPDD_Layouts', 'create_layout' ) - || ! method_exists( 'WPDD_Layouts', 'save_layout_settings' ) - || ! method_exists( 'WPDD_Layouts_Users_Profiles', 'user_can_create' ) - || ! method_exists( 'WPDD_Layouts_Users_Profiles', 'user_can_assign' ) - || ! method_exists( 'WPDD_Layouts_Cache_Singleton', 'get_name_by_id' ) - || ! method_exists( $wpddlayout, 'get_css_framework' ) - ) return false; - - return true; - } - - /** - * Create a layout with given name - * - * @param $name - * - * @return bool|int|WP_Error - * @since 2.0 - */ - private function create_layout( $name ) { - // todo check with Ric to get a more handy class to create a new layout. - // currently there is only (which I found) - // - create_layout_auto(), which has a redirect - // - create_layout_callback() for ajax only -> uses die() - global $wpddlayout; - - if( ! $this->needed_components_loaded() ) - return false; - - // permissions - if( ! current_user_can( 'manage_options' ) && WPDD_Layouts_Users_Profiles::user_can_create() && WPDD_Layouts_Users_Profiles::user_can_assign() ) - return false; - - $layout = WPDD_Layouts::create_layout( 12, 'fluid' ); - - $parent_post_name = ''; - $parent_ID = apply_filters('ddl-get-default-' . WPDDL_Options::PARENTS_OPTIONS, 0, WPDDL_Options::PARENTS_OPTIONS); - if ($parent_ID) { - $parent_post_name = WPDD_Layouts_Cache_Singleton::get_name_by_id($parent_ID); - } - - // Define layout parameters - $layout['type'] = 'fluid'; // layout_type - $layout['cssframework'] = $wpddlayout->get_css_framework(); - $layout['template'] = ''; - $layout['parent'] = $parent_post_name; - $layout['name'] = $name; - - $args = array( - 'post_title' => $name, - 'post_content' => '', - 'post_status' => 'publish', - 'post_type' => WPDDL_LAYOUTS_POST_TYPE - ); - $layout_id = wp_insert_post( $args ); - - // force layout object to take right ID - // @see WPDD_Layouts::create_layout_callback() @ wpddl.class.php - $layout_post = get_post( $layout_id ); - $layout['id'] = $layout_id; - $layout['slug'] = $layout_post->post_name; - - // update changes - WPDD_Layouts::save_layout_settings( $layout_id, $layout ); - - return $layout_id; - } - - /** - * Will proof if given name is already in use. - * If so it adds an running number until name is available - * - * @param $name - * @param int $id | should not manually added - * - * @return string - * @since 2.0 - */ - private function validate_name( $name, $id = 1 ) { - $name_exists = get_page_by_title( html_entity_decode( $name ), OBJECT, WPDDL_LAYOUTS_POST_TYPE ); - - if( $name_exists ) { - $name = $id > 1 ? rtrim( rtrim( $name, $id - 1 ) ) : $name; - return $this->validate_name( $name . ' ' . $id, $id + 1 ); - } - - return $name; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/view.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/create/view.php deleted file mode 100644 index 2bab548..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/view.php +++ /dev/null @@ -1,60 +0,0 @@ -labels->name ); - } - - $name = $this->validate_name( $name ); - - $args = array( - 'view_settings' => array( - 'view-query-mode' => 'normal', - 'view_purpose' => 'all', - 'post_type' => array( $type ) - ) - ); - - $view = WPV_View::create( $name, $args ); - return $view->id; - } - - /** - * Will proof if given name is already in use. - * If so it adds an running number until name is available - * - * @param $name - * @param int $id | should not manually added - * - * @return string - * @since 2.0 - */ - private function validate_name( $name, $id = 1 ) { - $name_exists = get_page_by_title( html_entity_decode( $name ), OBJECT, 'view' ); - if( $name_exists !== null ) { - $name = $id > 1 ? rtrim( rtrim( $name, $id - 1 ) ) : $name; - return $this->validate_name( $name . ' ' . $id, $id + 1 ); - } - - return $name; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/wordpress_archive.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/create/wordpress_archive.php deleted file mode 100644 index 18bedd4..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/create/wordpress_archive.php +++ /dev/null @@ -1,94 +0,0 @@ -needed_components_loaded() ) - return false; - - global $WPV_settings; - $option = sanitize_text_field( sprintf( 'view_cpt_%s', $type ) ); - - // for type 'post' - if( $type == 'post' ) { - $name = __( 'Archive for Home/Blog', 'wpcf' ); - $option = 'view_home-blog-page'; - } - - // already has an archive - if( isset( $WPV_settings[$option] ) && is_numeric( $WPV_settings[$option] ) && $WPV_settings[$option] > 0 ) - return $WPV_settings[$option]; - - // set name if not given - if( ! $name ) { - $type_object = get_post_type_object( $type ); - $name = sprintf( __( 'Archive for %s', 'wpcf' ), $type_object->labels->name ); - } - - $name = $this->validate_name( $name ); - - if( ! $name ) - return false; - - $archive = WPV_WordPress_Archive::create( $name, array() ); - $archive_post = get_post( $archive->id ); - - if( $archive_post === null ) - return false; - - $WPV_settings[$option] = $archive_post->ID; - $WPV_settings->save(); - - return $archive_post->ID; - } - - /** - * Checks all dependencies - * - * @return bool - * @since 2.0 - */ - private function needed_components_loaded( ) { - global $WPV_settings; - if( - ! is_object( $WPV_settings ) - || ! class_exists( 'WPV_WordPress_Archive' ) - || ! method_exists( 'WPV_WordPress_Archive', 'create' ) - ) return false; - - return true; - } - - /** - * Will proof if given name is already in use. - * If so it adds an running number until name is available - * - * @param $name - * @param int $id | should not manually added - * - * @return string - * @since 2.0 - */ - private function validate_name( $name, $id = 1 ) { - $name_exists = get_page_by_title( html_entity_decode( $name ), OBJECT, 'view' ); - - if( $name_exists ) { - $name = $id > 1 ? rtrim( rtrim( $name, $id - 1 ) ) : $name; - return $this->validate_name( $name . ' ' . $id, $id + 1 ); - } - - return $name; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/output/interface.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/output/interface.php deleted file mode 100644 index c10e700..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/output/interface.php +++ /dev/null @@ -1,11 +0,0 @@ -set_id( $id ); - } - - public function set_id( $id ) { - $this->id = $id; - } - - public function set_title( $string ) { - $this->title = $string; - } - - public function set_css_class( $string ) { - $this->css_class = $string; - } - - public function set_context( $context ) { - switch( $context ) { - case 'normal': - case 'side': - case 'advanced': - $this->context = $context; - break; - } - } - - public function set_content( $content ){ - $this->output = $content; - } - - public function meta_box_output() { - echo $this->output; - } - - public function add_css_class( $classes ) { - $classes[] = $this->css_class; - return $classes; - } - - public function output() { - add_meta_box( - $this->id, - $this->title, - array( $this, 'meta_box_output' ), - $this->screen, - $this->context, - $this->priority - ); - - if( $this->css_class ) { - $screen = get_current_screen(); - add_action( 'postbox_classes_'.$screen->id.'_'. $this->id, array( $this, 'add_css_class' ) ); - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/placeholder.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/placeholder.php deleted file mode 100644 index c5201a9..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/placeholder.php +++ /dev/null @@ -1,246 +0,0 @@ - self::$post_type->labels->name, - '%POST-PERMALINK%' => self::get_permalink(), - '%POST-ARCHIVE-PERMALINK%' => self::get_archive_permalink(), - '%POST-LABEL-SINGULAR%' => self::$post_type->labels->singular_name, - '%POST-TYPE-NAME%' => self::$post_type->name, - '%THEME-NAME%' => wp_get_theme(), - '%POST-TEMPLATE-FILE%' => '' . self::get_post_template_file() . '', - '%POST-ARCHIVE-FILE%' => '' . self::get_post_archive_file() . '', - '%POST-FORMS-LIST%' => self::get_post_type_forms_list(), - '%POST-CREATE-FORM%' => self::add_referer( $admin_url . 'admin.php?page=types-helper&action=new-form&type=' . self::$post_type->name.'&toolset_help_video=cred_form' ), - '%POST-TYPE-EDIT-HAS-ARCHIVE%' => self::add_referer( $admin_url . 'admin.php?page=wpcf-edit-type&wpcf-post-type=' . self::$post_type->name . '#types_options' ), - ); - - // Views specifics - if( defined( 'WPV_VERSION' ) ) { - $placeholders = array_merge( $placeholders, array( - //'%POST-CREATE-LAYOUT-TEMPLATE%' => self::get_post_create_layout_template(), - '%POST-CONTENT-TEMPLATE-NAME%' => Types_Helper_Condition_Views_Template_Exists::get_template_name(), - '%POST-VIEWS-ARCHIVE%' => Types_Helper_Condition_Views_Archive_Exists::get_template_name(), - '%POST-EDIT-VIEWS-ARCHIVE%' => self::get_post_edit_views_archive(), - '%POST-EDIT-CONTENT-TEMPLATE%' => self::get_post_edit_views_template(), - '%POST-CREATE-CONTENT-TEMPLATE%' => self::add_referer( $admin_url . 'admin.php?page=types-helper&action=new-content-template&type='.self::$post_type->name.'&toolset_help_video=views_template' ), - '%POST-CREATE-VIEWS-ARCHIVE%' => self::add_referer( $admin_url . 'admin.php?page=types-helper&action=new-wordpress-archive&type='.self::$post_type->name.'&toolset_help_video=views_archives' ), - '%POST-CREATE-VIEWS-ARCHIVE-TYPE%' => self::$post_type->name, - '%POST-CREATE-VIEWS-ARCHIVE-REDIRECT-URL%' => '&' . self::add_referer( 'toolset_help_video=views_archives' ), - '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-TITLE%' => self::$post_type->label, - '%POST-CREATE-VIEWS-ARCHIVE-FOR-WHOM-LOOP%' => esc_attr( 'wpv-view-loop-cpt_' . self::$post_type->name ), - //'%POST-CREATE-VIEWS-ARCHIVE%' => self::get_post_create_views_archive(), - '%POST-VIEWS-LIST%' => self::get_post_type_views_list(), - '%POST-CREATE-VIEW%' => self::add_referer( $admin_url . 'admin.php?page=types-helper&action=new-view&type=' . self::$post_type->name . '&toolset_help_video=views_view' ), - '%POST-CREATE-VIEW-TYPE%' => self::$post_type->name, - '%POST-CREATE-VIEW-REDIRECT-URL%' => '&' . self::add_referer( 'toolset_help_video=views_view' ), - ) ); - - } - - // Layouts specifics - if( defined( 'WPDDL_DEVELOPMENT' ) || defined( 'WPDDL_PRODUCTION' ) ) { - $placeholders = array_merge( $placeholders, array( - //'%POST-CREATE-LAYOUT-TEMPLATE%' => self::get_post_create_layout_template(), - '%POST-CREATE-LAYOUT-TEMPLATE%' => self::add_referer( $admin_url . 'admin.php?page=types-helper&action=new-layout-template&type='.self::$post_type->name.'&toolset_help_video=layouts_template' ), - '%POST-CREATE-LAYOUT-ARCHIVE%' => self::add_referer( self::get_post_create_layout_archive() . '&toolset_help_video=layouts_archive' ), - '%POST-EDIT-LAYOUT-TEMPLATE%' => self::get_post_edit_layout_template(), - '%POST-EDIT-LAYOUT-ARCHIVE%' => self::get_post_edit_layout_archive(), - '%POST-LAYOUT-TEMPLATE%' => Types_Helper_Condition_Layouts_Template_Exists::get_layout_name(), - '%POST-LAYOUT-ARCHIVE%' => Types_Helper_Condition_Layouts_Archive_Exists::get_layout_name(), - ) ); - } - - $original = strtr( $original, $placeholders ); - } - - private static function get_post_create_views_archive() { - $tool_admin_bar = Toolset_Admin_Bar_Menu::get_instance(); - - $post_type = self::$post_type->name == 'post' ? 'home-blog' : self::$post_type->name; - return $tool_admin_bar->get_edit_link( 'views', true, $post_type, 'archive', 0 ); - } - - private static function get_post_edit_views_template() { - $url = admin_url() . 'admin.php?page=ct-editor&ct_id=' - . Types_Helper_Condition_Views_Template_Exists::get_template_id(); - - return self::add_referer( $url ); - } - - private static function get_post_edit_views_archive() { - $url = admin_url() . 'admin.php?page=view-archives-editor&view_id=' - . Types_Helper_Condition_Views_Archive_Exists::get_template_id(); - - return self::add_referer( $url ); - } - - private static function get_post_create_layout_archive() { - $tool_admin_bar = Toolset_Admin_Bar_Menu::get_instance(); - - // change name to 'home-blog' for build-in "Posts" - $post_type = self::$post_type->name == 'post' - ? 'home-blog' - : self::$post_type->name; - - return $tool_admin_bar->get_edit_link( 'layouts', true, $post_type, 'archive', 0 ); - } - - private static function get_post_edit_layout_archive() { - $url = admin_url() . 'admin.php?page=dd_layouts_edit&action=edit&layout_id=' - . Types_Helper_Condition_Layouts_Archive_Exists::get_layout_id(); - - return self::add_referer( $url ); - } - - private static function get_post_edit_layout_template() { - $url = admin_url() . 'admin.php?page=dd_layouts_edit&action=edit&layout_id=' - . Types_Helper_Condition_Layouts_Template_Exists::get_layout_id(); - return self::add_referer( $url ); - } - - private static function add_referer( $url ) { - if( isset( $_GET['page'] ) && $_GET['page'] == 'toolset-dashboard' ) - $url = add_query_arg( 'ref', 'dashboard', $url ); - - return $url; - } - - private static function get_post_template_file() { - $helper = new Types_Helper_Condition_Single_Exists(); - return basename( $helper->find_template() ); - } - - private static function get_post_archive_file() { - $helper = new Types_Helper_Condition_Archive_Exists(); - return basename( $helper->find_template() ); - } - - public static function get_permalink( $id = 0 ) { - $permalink = get_permalink( $id ); - - if( $permalink ) { - $query_args['preview'] = 'true'; - $permalink = add_query_arg( $query_args, $permalink ); - return $permalink; - } - - if( isset( $_GET['post'] ) && $id != $_GET['post'] ) { - $get_permalink_id = (int) $_GET['post']; - return self::get_permalink( $get_permalink_id ); - } - - // cpt edit page - if( isset( $_GET['wpcf-post-type'] ) && $id == 0 ) { - $get_permalink_post_type = sanitize_text_field( $_GET['wpcf-post-type'] ); - $query = new WP_Query( 'post_type=' . $get_permalink_post_type . '&posts_per_page=1' ); - if( $query->have_posts() ) - return self::get_permalink( $query->posts[0]->ID ); - } - - // fields edit page - if( is_object( self::$post_type ) && $id == 0 ){ - $query = new WP_Query( 'post_type=' . self::$post_type->name . '&posts_per_page=1' ); - if( $query->have_posts() ) - return self::get_permalink( $query->posts[0]->ID ); - } - - return false; - } - - public static function get_archive_permalink() { - if( array_key_exists( 'wpcf-post-type', $_GET ) ) { - $post_type = sanitize_text_field( $_GET['wpcf-post-type'] ); - } else { - if( ! is_object( self::$post_type ) ) - self::set_post_type(); - - $post_type = self::$post_type->name; - } - - // check cache - if( array_key_exists( $post_type, self::$cache ) && array_key_exists( 'archive_permalink', self::$cache[$post_type] ) ) - return self::$cache[$post_type]['archive_permalink']; - - // get new - $query = new WP_Query( 'post_type=' . $post_type . '&post_status=publish&posts_per_page=1' ); - - self::$cache[$post_type]['archive_permalink'] = $query->have_posts() - ? get_post_type_archive_link( $post_type ) - : false; - - return self::$cache[$post_type]['archive_permalink']; - } - - private static function get_post_type_views_list() { - // @todo use twig - if( $views = Types_Helper_Condition_Views_Views_Exist::get_views_of_post_type() ) { - $output = ''; - - return $output; - } - - return __( 'No Views', 'wpcf' ); - } - - private static function get_post_type_forms_list() { - // @todo use twig - if( $forms = Types_Helper_Condition_Cred_Forms_Exist::get_forms_of_post_type() ) { - $output = ''; - - return $output; - } - - return __( 'No Forms', 'wpcf' ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/twig.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/twig.php deleted file mode 100644 index 2319256..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/twig.php +++ /dev/null @@ -1,45 +0,0 @@ -filesystem = new Twig_Loader_Filesystem(); - $this->filesystem->addPath( TYPES_ABSPATH . '/application/views' ); - $this->twig = new Twig_Environment( $this->filesystem ); - $this->twig->addFunction( new Twig_SimpleFunction( '__', array( $this, 'translate' ) ) ); - } - - /** - * This allows to use __( 'Text to translate', 'wpcf' ) in twig templates - * - * @param $text - * @param string $domain - * - * @return mixed - */ - public function translate( $text, $domain = 'wpcf' ) { - return __( $text, $domain ); - } - - public function render( $file, $data ) { - if( $this->filesystem->exists( $file ) ) - return $this->twig->render( $file, $data ); - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/helper/url.php b/backend/wordpress/wp-content/plugins/types/application/models/helper/url.php deleted file mode 100644 index 96618ec..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/helper/url.php +++ /dev/null @@ -1,165 +0,0 @@ - self::UTM_SOURCE, - 'utm_campaign' => self::UTM_CAMPAIGN, - 'utm_medium' => self::$utm_medium, - 'utm_term' => self::$utm_term - ); - - // This can === true, in which case we'll skip it, see self::get_url(). - if( is_string( self::$utm_content ) ) { - $args['utm_content'] = self::$utm_content; - } - - return add_query_arg( - $args, - $url - ); - - } - - /** - * Determines whether an URL points to the wp-types.com domain. - * - * @param string $url - * @return bool - * @since 2.1 - */ - private static function is_link_to_wptypes( $url ) { - $url_parts = parse_url( $url ); - return ( wpcf_getarr( $url_parts, 'host') == self::WP_TYPES_DOMAIN ); - } - - - /** - * Retrieve the URL with additional arguments. - * - * @param string $key URL key as defined in self::add_urls(). - * @param bool|string $utm_content This is a bit more complex than we wanted: - * - false will skip *all* analytics arguments (default). - * - true will continue with adding the analytics arguments but omit the utm_content one - * - If a string is provided, it will be added as utm_content. - * @param bool|string $utm_term utm_term argument or false if $key should be used instead. - * @param bool|string $utm_medium utm_medium (to be set globally) or false to use a previously set value. - * @param bool $add_site_url If this is true and the URL points to wp-types.com, an additional argument with current - * site's URL will be added. - * - * @return mixed|string The URL or an empty string if the key was invalid. - * @since 2.0 - */ - public static function get_url( $key, $utm_content = false, $utm_term = false, $utm_medium = false, $add_site_url = true ) { - if( !isset( self::$urls[ $key ] ) ) { - return ''; - } - - $url = self::$urls[ $key ]; - - // return url if no arguments - if( ! $utm_content ) { - return $url; - } - - // add utm content - self::$utm_content = $utm_content; - - // use key for term, if no term isset - if( ! $utm_term ) { - $utm_term = $key; - } - - self::$utm_term = $utm_term; - - // apply medium only if medium isset - if( $utm_medium ) { - self::set_medium( $utm_medium ); - } - - // apply arguments - $url = self::apply_analytics_arguments_to_url( $url ); - - return $url; - - } - - - private static $documentation_urls_loaded = false; - - - /** - * Load URLs to documentation links so they can be obtained via get_url(). - * - * @since 2.1 - */ - public static function load_documentation_urls() { - if( ! self::$documentation_urls_loaded ) { - $documentation_urls = include( TYPES_DATA . '/documentation-urls.php' ); - Types_Helper_Url::add_urls( $documentation_urls ); - self::$documentation_urls_loaded = true; - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/information/container.php b/backend/wordpress/wp-content/plugins/types/application/models/information/container.php deleted file mode 100644 index 9e1ef4b..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/information/container.php +++ /dev/null @@ -1,167 +0,0 @@ -id = $id; - } - - // get id - public function get_id() { - return $this->id; - } - - // add message - public function add_message( Types_Information_Message $message ) { - $this->messages[] = $message; - } - - public function get_messages() { - return $this->messages; - } - - /** - * @return array|bool - */ - public function get_descriptions() { - if( empty( $this->messages ) ) - return false; - - // check if descriptions were already filtered - if( isset( $this->messages_filtered['descriptions'] ) ) - return $this->messages_filtered['descriptions']; - - $descriptions = array(); - - foreach( $this->messages as $message ){ - $descriptions[] = $message->get_description(); - } - - Types_Helper_Placeholder::replace( $descriptions ); - $this->messages_filtered['descriptions'] = $descriptions; - return $descriptions; - } - - - /** - * - * @return bool - */ - public function get_examples() { - if( empty( $this->messages ) ) - return false; - - // check if descriptions were already filtered - if( isset( $this->messages_filtered['view_example'] ) ) - return $this->messages_filtered['view_example']; - - $examples = array(); - - foreach( $this->messages as $message ) { - if( !empty( $examples ) ) { - $current_example = $message->get_example(); - - // check if the view example is already applied - foreach( $examples as $view ) { - // skip to next message - if( $view['label'] == $current_example['label'] ) - continue 2; - } - - // no duplication, add view example - $examples[] = $current_example; - continue; - } - - // view example has no value yet - $examples[] = $message->get_example(); - } - - Types_Helper_Placeholder::replace( $examples ); - $this->messages_filtered['view_example'] = $examples; - return $examples; - } - - /** - * @param bool|string $output e.g., a rendered Twig template - * - * @return bool|string - */ - public function render( $output = false ) { - - $output = $output ? $output : ''; - - if( $this->cached && !$this->is_cached() ) - return false; - - // use message render function if no output is set - if( empty( $output ) && ! empty( $this->messages ) ) { - foreach( $this->messages as $message ) { - $output .= $message->render(); - } - } - - // send output to container (e.g., meta-box) and return full container output - if( $this->output_container ) { - $this->output_container->set_content( $output ); - return $this->output_container->output(); - } - - return $output; - } - - // set output container - public function set_output_container( $output ) { - // @todo type hinting Types_Helper_Output_Meta_Box - $this->output_container = $output; - } - - - // cache on hook - public function cache_on_hook( $hook ) { - $this->cached = true; - add_action( $hook, array( $this, 'cache' ) ); - } - - public function cache() { - $this->cached = true; - - if( ! $this->id ) - return false; - - $db_messages = get_option( 'types_messages', array() ); - $db_messages[$this->id] = 1; - - update_option( 'types_messages', $db_messages ); - } - - /** - * Check if cached - * - * @return bool - */ - private function is_cached() { - $db_messages = get_option( 'types_messages', array() ); - - if( ! isset( $db_messages[$this->id] ) || empty( $db_messages[$this->id] ) ) - return false; - - // disable message again - $db_messages[$this->id] = 0; - update_option( 'types_messages', $db_messages ); - - return true; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/information/message.php b/backend/wordpress/wp-content/plugins/types/application/models/information/message.php deleted file mode 100644 index e4c596e..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/information/message.php +++ /dev/null @@ -1,221 +0,0 @@ -id = $id; - } - - public function get_id() { - return $this->id; - } - - /** - * Type Set & Get - * @param $type - */ - public function set_type( $type ) { - switch( $type ) { - case 'information': - case 'template': - case 'archive': - case 'views': - case 'forms': - case 'type': - case 'fields': - case 'taxonomies': - $this->type = $type; - break; - } - } - - public function get_type() { - return $this->type; - } - - /** - * Use this to add multiple conditions at ounce. - * - * @param $conditions - * - * @return bool - */ - public function add_conditions( $conditions ) { - if( $conditions === false ) - return false; - - if( is_array( $conditions ) ) { - foreach( $conditions as $condition ) { - $condition = new $condition(); - $this->add_condition( $condition ); - } - } else { - $this->add_condition( $conditions ); - } - } - - - /** - * Add a condition to show the message. - * - * @param Types_Helper_Condition $condition - * - * @return bool - */ - public function add_condition( Types_Helper_Condition $condition ) { - $this->conditions[] = $condition; - - return $this; - } - - /** - * Check if all assigned conditions match - * - * @return bool - */ - public function valid() { - - foreach( $this->conditions as $condition ) { - if( ! $condition->valid() ) - return false; - } - - return true; - } - - /** - * Title Set & Get - * @param $title - */ - public function set_title( $title ) { - $this->title = $title; - } - - public function get_title() { - return $this->title; - } - - /** - * Description Set & Get - * @param $description - */ - public function set_description( $description ) { - if( !is_array( $description ) ) { - $this->description = array( - array( - 'type' => 'paragraph', - 'content' => $description - ) - ); - - return; - } - - $on_post_edit_screen = isset( $_GET['post'] ) ? true : false; - - foreach( $description as &$element ) { - // apply correct label - if( isset( $element['label'] ) - && is_array( $element['label'] ) - && array_key_exists( 'default', $element['label'] ) - && array_key_exists( 'post-edit', $element['label'] ) - ) { - $element['label'] = $on_post_edit_screen - ? $element['label']['post-edit'] - : $element['label']['default']; - } - } - - $this->description = $description; - } - - public function get_description() { - return $this->description; - } - - - /** - * Import data - * see /application/data/information - * - * @param array $data - * - * @return bool - */ - public function data_import( $data ) { - if( ! is_array( $data ) ) - return false; - - $default = array( - 'id' => false, - 'type' => false, - 'conditions' => false, - 'title' => false, - 'description' => false, - 'priority' => false - ); - - $cfg = array_replace_recursive( $default, $data ); - - $this->set_id( $cfg['id'] ); - $this->set_type( $cfg['type'] ); - $this->add_conditions( $cfg['conditions'] ); - $this->set_title( $cfg['title'] ); - $this->set_description( $cfg['description'] ); - $this->priority = $cfg['priority']; - } - - - /** - * Add link, used for example, documentation and how to resolve links - * - * @param $target - * @param $link - * @param bool $in_array - * false for $target = $link - * true for $target[] = $link - */ - protected function add_link( &$target, $link, $in_array = false ) { - if( isset( $link['label'] ) && isset( $link['link'] ) ) { - $add = array( - 'label' => $link['label'], - 'link' => $link['link'] - ); - } elseif( isset( $link['label'] ) && isset( $link['dialog'] ) ) { - $add = array( - 'label' => $link['label'], - 'dialog' => $link['dialog'] - ); - } elseif( count( $link, COUNT_RECURSIVE ) == 2 ) { - $add = array( - 'label' => $link[0], - 'link' => $link[1] - ); - } - - if( isset( $link['class'] ) ) - $add['class'] = $link['class']; - - if( isset( $add ) ) { - if( $in_array ) { - $target[] = $add; - } else { - $target = $add; - } - } - - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/information/message/post_type.php b/backend/wordpress/wp-content/plugins/types/application/models/information/message/post_type.php deleted file mode 100644 index 28cf305..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/information/message/post_type.php +++ /dev/null @@ -1,15 +0,0 @@ -post_type = $post_type; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/information/table.php b/backend/wordpress/wp-content/plugins/types/application/models/information/table.php deleted file mode 100644 index 1f6030d..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/information/table.php +++ /dev/null @@ -1,72 +0,0 @@ -get_type() ) - switch( $message->get_type() ) { - case 'template': - if( $this->template === null && $message->valid() ) - $this->template[] = $message; - break; - case 'archive': - if( $this->archive === null && $message->valid() ) - $this->archive[] = $message; - break; - case 'views': - if( $this->views === null && $message->valid() ) - $this->views[] = $message; - break; - case 'forms': - if( $this->forms === null && $message->valid() ) - $this->forms[] = $message; - break; - } - } - - public function get_template( $force = false ) { - $post_type = Types_Helper_Condition::get_post_type(); - - if( ! $force ) { - $allowed_columns = apply_filters( 'types_information_table_columns', array_fill_keys( array( 'template', 'archive', 'views', 'forms' ), '' ), $post_type->name ); - - if( ! isset( $allowed_columns['template'] ) ) - return false; - } - - return $this->template; - } - - public function get_archive( $force = false ) { - $post_type = Types_Helper_Condition::get_post_type(); - - if( ! $force ) { - $allowed_columns = apply_filters( 'types_information_table_columns', array_fill_keys( array( 'template', 'archive', 'views', 'forms' ), '' ), $post_type->name ); - - if( ! isset( $allowed_columns['archive'] ) ) - return false; - } - - return $this->archive; - } - - public function get_views() { - return $this->views; - } - - public function get_forms() { - return $this->forms; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/post_type.php b/backend/wordpress/wp-content/plugins/types/application/models/post_type.php deleted file mode 100644 index 2dde792..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/post_type.php +++ /dev/null @@ -1,132 +0,0 @@ -name ) ) { - $this->wp_post_type = $post_type; - $this->name = $post_type->name; - } else { - $this->name = $post_type; - $registered = get_post_type_object( $post_type ); - - if( $registered ) { - $this->wp_post_type = $registered; - } - } - } - - public function __isset( $property ) { - if( $this->wp_post_type === null ) - return false; - - if( ! property_exists( $this->wp_post_type, 'labels' ) ) - return false; - - if( ! property_exists( $this->wp_post_type->labels, $property ) ) - return false; - - return true; - } - - public function __get( $property ) { - if( ! $this->__isset( $property ) ) - return false; - - return $this->wp_post_type->labels->$property; - } - - public function get_name() { - return $this->name; - } - - /** - * Get the backend edit link. - * - * @return string - * @since 2.1 - */ - public function get_edit_link() { - return admin_url() . 'admin.php?page=wpcf-edit-type&wpcf-post-type=' . $this->get_name(); - } - - /** - * Register Post Type - */ - - /** - * Assigned Field Groups - */ - private function fetch_field_groups() { - global $wpdb; - $sql = 'SELECT post_id FROM ' .$wpdb->postmeta . ' - WHERE meta_key="_wp_types_group_post_types" - AND (meta_value LIKE "%' . $this->name . '%" OR meta_value="all" OR meta_value REGEXP "^[,]+$") - ORDER BY post_id ASC'; - $post_ids = $wpdb->get_col( $sql ); - - $this->field_groups = array(); - foreach( $post_ids as $id ) { - $field_group = Types_Field_Group_Post_Factory::load( $id ); - - if( $field_group ) - $this->field_groups[] = $field_group; - } - } - - public function get_field_groups() { - if( $this->field_groups == null ) - $this->fetch_field_groups(); - - return $this->field_groups; - } - - /** - * Assigned Taxonomies - */ - private function fetch_taxonomies() { - $taxonomies = array(); - $all_taxonomies = get_taxonomies( '', 'objects' ); - - foreach( $all_taxonomies as $tax ) { - if( in_array( $this->get_name(), $tax->object_type ) ) - $taxonomies[] = new Types_Taxonomy( $tax ); - } - - $this->taxonomies = $taxonomies; - } - - public function get_taxonomies() { - if( $this->taxonomies == null ) - $this->fetch_taxonomies(); - - return $this->taxonomies; - } - - /** - * Assigned Templates - */ - - /** - * Assigned Archives - */ - - /** - * Assigned Views - */ - - /** - * Assigned Forms - */ -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/setting.php b/backend/wordpress/wp-content/plugins/types/application/models/setting.php deleted file mode 100644 index b2943a3..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/setting.php +++ /dev/null @@ -1,36 +0,0 @@ -id = $id; - } - - public function get_id() { - return $this->id; - } - - public function add_option( Types_Setting_Option_Interface $option ) { - $this->options[$option->get_id()] = $option; - } - - public function get_options() { - return $this->options; - } - - public function get_value( $option_id ) { - return $this->options[$option_id]->get_stored_value( $this ); - } - - public function checked( $value, $option_id ) { - return checked( $value == $this->get_value( $option_id ), true, false ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/setting/boolean.php b/backend/wordpress/wp-content/plugins/types/application/models/setting/boolean.php deleted file mode 100644 index 7c6228d..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/setting/boolean.php +++ /dev/null @@ -1,24 +0,0 @@ -id = $id; - } - - public function get_id() { - return $this->id; - } - - public function set_default( $default ) { - $this->default = $default; - } - - public function get_value() { - if( $this->value === null ) - $this->value = 1; - - return $this->value; - } - - public function get_stored_value( Types_Setting_Interface $setting ) { - if( $this->stored_value === null ) { - if( class_exists( 'Toolset_Settings' ) - && method_exists( 'Toolset_Settings', 'get_instance' ) - ) { - $toolset_settings = Toolset_Settings::get_instance(); - $full_setting = $toolset_settings->get( $setting->get_id() ); - } else { - $full_setting = get_option( $setting->get_id() ); - } - - $value = isset( $full_setting[$this->get_id()] ) - ? $full_setting[$this->get_id()] - : $this->default; - - $this->stored_value = $value; - } - - return $this->stored_value; - } - - public function set_description( $description ) { - $this->description = $description; - } - - public function get_description() { - return $this->description; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/setting/option/interface.php b/backend/wordpress/wp-content/plugins/types/application/models/setting/option/interface.php deleted file mode 100644 index 9305294..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/setting/option/interface.php +++ /dev/null @@ -1,14 +0,0 @@ -setting = new Types_Setting_Boolean( 'types-information-table' ); - - $option_edit_post = new Types_Setting_Option( 'show-on-post' ); - $option_edit_post->set_description( __( 'Edit Post pages', 'wpcf' ) ); - $option_edit_post->set_default( true ); - - $option_edit_post_type = new Types_Setting_Option( 'show-on-post-type' ); - $option_edit_post_type->set_description( __( 'Edit Post Type pages', 'wpcf' ) ); - $option_edit_post_type->set_default( true ); - - $option_edit_field_group = new Types_Setting_Option( 'show-on-field-group' ); - $option_edit_field_group->set_description( __( 'Edit Field Group pages', 'wpcf' ) ); - $option_edit_field_group->set_default( true ); - - $this->setting->add_option( $option_edit_post ); - $this->setting->add_option( $option_edit_post_type ); - $this->setting->add_option( $option_edit_field_group ); - } - - public function __call( $name, $arguments ) { - if( empty( $arguments ) ) - return call_user_func( array( $this->setting, $name ) ); - - return call_user_func_array( array( $this->setting, $name ), $arguments ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/taxonomy.php b/backend/wordpress/wp-content/plugins/types/application/models/taxonomy.php deleted file mode 100644 index 6e1b4d6..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/taxonomy.php +++ /dev/null @@ -1,60 +0,0 @@ -name ) ) { - $this->wp_taxonomy = $taxonomy; - $this->name = $taxonomy->name; - } else { - $this->name = $taxonomy; - $registered = get_post_type_object( $taxonomy ); - - if( $registered ) - $this->wp_taxonomy = $registered; - } - } - - public function __isset( $property ) { - if( $this->wp_taxonomy === null ) - return false; - - if( ! property_exists( $this->wp_taxonomy, 'labels' ) ) - return false; - - if( ! property_exists( $this->wp_taxonomy->labels, $property ) ) - return false; - - return true; - } - - public function __get( $property ) { - if( ! $this->__isset( $property ) ) - return false; - - return $this->wp_taxonomy->labels->$property; - } - - public function get_name() { - return $this->name; - } - - /** - * Get the backend edit link. - * - * @return string - * @since 2.1 - */ - public function get_edit_link() { - return admin_url() . 'admin.php?page=wpcf-edit-tax&wpcf-tax=' . $this->get_name(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string.php b/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string.php deleted file mode 100644 index aaed1f5..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string.php +++ /dev/null @@ -1,245 +0,0 @@ -group = $group; - } - - - /** - * The pattern of the string name in icl_strings - * - [name]: group %s name - * - [description]: group %s description - * - * @return string - */ - abstract protected function get_db_pattern(); - - - /** - * Returns the string which should be translated - * - * @return string - */ - protected function get_string_to_translate() { - return $this->string_to_translate; - } - - - /** - * Get the db identifier (uses slug of group) - * - * @return string - */ - protected function get_db_identifier() { - return sprintf( $this->get_db_pattern(), $this->group->get_slug() ); - } - - - /** - * Get the db identifier (uses id of group) - * - * @return string - */ - protected function get_db_identifier_legacy() { - return sprintf( $this->get_db_pattern(), $this->group->get_id() ); - } - - - /** - * Translate name of the group - * - * @return string - */ - public function translate() { - if ( empty( $this->string_to_translate ) || ! is_string( $this->string_to_translate ) ) { - return $this->string_to_translate; - } - - // trying the new pattern, which uses the GROUP NAME - $translated_string = $this->get_translation( - $this->string_to_translate, - $this->get_db_identifier() - ); - - $was_translated = ( - $translated_string - && ( - $translated_string != $this->string_to_translate - || Types_Interop_Handler_Wpml::get_instance()->is_current_language_default() - ) - ); - - if ( $was_translated ) { - return $translated_string; - } - - // nothing found yet, try the old pattern for group storage - return $this->translate_legacy(); - } - - - - /** - * Returning the legacy pattern which is using the GROUP ID - * - * @return mixed - */ - private function translate_legacy() { - $translated_string = $this->get_translation( - $this->string_to_translate, - $this->get_db_identifier_legacy() - ); - - // no translation found - if ( ! $translated_string ) { - return $this->string_to_translate; - } - - // update pattern of name field in "icl_strings" table - // to use name of group instead of id - $this->update_db_identifier(); - - // return translated string - return $translated_string; - } - - - /** - * Get translation of string - * - * @param $string - * @param $field_id - * - * @return string|false - */ - private function get_translation( $string, $field_id ) { - $wpml_interop = Types_Interop_Handler_Wpml::get_instance(); - return $wpml_interop->get_translation( $string, $field_id, self::CONTEXT ); - } - - - /** - * Update the identifier on db table "{prefix}_icl_strings" to use the "name" - * of a group instead of the "id". - * - * If a row with the new name already exists, only delete the old identifier. - */ - private function update_db_identifier() { - global $wpdb; - - $new_db_identifier = $this->get_db_identifier(); - - if ( $this->string_exists( $new_db_identifier ) ) { - - $wpdb->query( - $wpdb->prepare( - "DELETE FROM {$wpdb->prefix}icl_strings - WHERE `name` = %s", - $this->get_db_identifier_legacy() - ) - ); - - } else { - - $wpdb->query( - $wpdb->prepare( - "UPDATE {$wpdb->prefix}icl_strings - SET name = %s, - domain_name_context_md5 = md5( CONCAT( context, name, gettext_context ) ) - WHERE name = %s", - $this->get_db_identifier(), - $this->get_db_identifier_legacy() - ) - ); - } - } - - - /** - * Determine whether a string with given name already exists in the icl_strings table. - * - * @param string $new_string_name - * @return bool - * @since 2.2.7 - */ - private function string_exists( $new_string_name ) { - - global $wpdb; - - $conflict_count = $wpdb->get_var( - $wpdb->prepare( - "SELECT COUNT(1) - FROM {$wpdb->prefix}icl_strings - WHERE `name` LIKE %s - LIMIT 1", - $new_string_name - ) - ); - - return ( 0 < $conflict_count ); - } - - - /** - * Say Hello to WPML - * - * @param bool $slug_update - */ - public function register( $slug_update = false ) { - // abort if needed function not exists - if ( ! function_exists( 'icl_register_string' ) ) { - return; - } - - // update string identifier - if ( $slug_update ) { - global $wpdb; - - $wpdb->query( - $wpdb->prepare( - "UPDATE {$wpdb->prefix}icl_strings - SET name = %s - WHERE name = %s", - $this->get_db_identifier(), - sprintf( $this->get_db_pattern(), $slug_update ) - ) - ); - } - - // register/update string - icl_register_string( - self::CONTEXT, - $this->get_db_identifier(), - $this->get_string_to_translate() - ); - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string/description.php b/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string/description.php deleted file mode 100644 index bc9b455..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string/description.php +++ /dev/null @@ -1,15 +0,0 @@ -string_to_translate = stripslashes( $this->group->get_description() ); - } - - protected function get_db_pattern() { - return self::DB_NAME_PATTERN; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string/name.php b/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string/name.php deleted file mode 100644 index 80f9d61..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field/group/string/name.php +++ /dev/null @@ -1,16 +0,0 @@ -string_to_translate = stripslashes( $this->group->get_name() ); - } - - protected function get_db_pattern() { - return self::DB_NAME_PATTERN; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field_group.php b/backend/wordpress/wp-content/plugins/types/application/models/wpml/field_group.php deleted file mode 100644 index a1f0126..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/wpml/field_group.php +++ /dev/null @@ -1,91 +0,0 @@ -group = $group; - - // todo get rid of these hard dependencies - $this->name = new Types_Wpml_Field_Group_String_Name( $this->group ); - $this->description = new Types_Wpml_Field_Group_String_Description( $this->group ); - } - - - /** - * Translate name or description of group - * - * @param string $part - * - * @return string - */ - public function translate( $part = self::STRING_NAME ) { - switch( $part ) { - case self::STRING_NAME: - return $this->translate_name(); - break; - case self::STRING_DESCRIPTION: - return $this->translate_description(); - break; - default: - return ''; - } - } - - /** - * Translate name of the group - * - * @return string - */ - public function translate_name() { - return $this->name->translate(); - } - - /** - * Translate description of group - * - * @return string - */ - public function translate_description() { - return $this->description->translate(); - } - - /** - * Registration of name and description strings - * @param bool|string $slug_update - */ - public function register( $slug_update = false ) { - $this->name->register( $slug_update ); - $this->description->register( $slug_update ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/models/wpml/interface.php b/backend/wordpress/wp-content/plugins/types/application/models/wpml/interface.php deleted file mode 100644 index 738355a..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/models/wpml/interface.php +++ /dev/null @@ -1,7 +0,0 @@ - -

- -

- -

- -

- - - - - -

- -

- -

- - -   - - -

- -

- - -

- -

- -

- \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/admin-notices/free-version/types-3-1.phtml b/backend/wordpress/wp-content/plugins/types/application/views/admin-notices/free-version/types-3-1.phtml deleted file mode 100644 index 462e69f..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/admin-notices/free-version/types-3-1.phtml +++ /dev/null @@ -1,18 +0,0 @@ - -

- -

- -

- -

- -

- - -

- -

- -

diff --git a/backend/wordpress/wp-content/plugins/types/application/views/help/basic.twig b/backend/wordpress/wp-content/plugins/types/application/views/help/basic.twig deleted file mode 100644 index 2026091..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/help/basic.twig +++ /dev/null @@ -1,25 +0,0 @@ -{# - Basic template for the help tab on admin pages. - - It works with following context: - - string[] introductory_paragraphs - - string your_options: The string "your options for this page are..." - - array options: Each option needs to have "name" and "explanation" keys. - - string[] ending_paragraphs - - @since 2.0 -#} - -{% for paragraph in introductory_paragraphs %} -

{{ paragraph|raw }}

-{% endfor %} -

{{ your_options }}

-
- {% for option in options %} -
{{ option.name }}
-
{{ option.explanation|raw }}
- {% endfor %} -
-{% for paragraph in ending_paragraphs %} -

{{ paragraph|raw }}

-{% endfor %} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/description/dialog.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/description/dialog.twig deleted file mode 100644 index 5527b3d..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/description/dialog.twig +++ /dev/null @@ -1,22 +0,0 @@ - - - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/description/link.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/description/link.twig deleted file mode 100644 index 122c1e5..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/description/link.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% if description.target and description.label %} - -{% endif %} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/description/list.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/description/list.twig deleted file mode 100644 index 9281760..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/description/list.twig +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/description/paragraph.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/description/paragraph.twig deleted file mode 100644 index e1e3a3c..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/description/paragraph.twig +++ /dev/null @@ -1,3 +0,0 @@ -

- {{ description.content|raw }} -

diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/single.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/single.twig deleted file mode 100644 index 14c3359..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/single.twig +++ /dev/null @@ -1,18 +0,0 @@ - -
- {% if icon %} -
- -
- {% endif %} - -
- {% for message in information.get_messages() %} - {% for description in message.description %} - {% if description.type %} - {% include 'information/description/' ~ description.type ~ '.twig' %} - {% endif %} - {% endfor %} - {% endfor %} -
-
\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/table.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/table.twig deleted file mode 100644 index 779b66a..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/table.twig +++ /dev/null @@ -1,46 +0,0 @@ - -
- - - - {% for cell in thead %} - - {% endfor %} - - - - - {% if table.get_template() %} - - {% endif %} - {% if table.get_archive() %} - - {% endif %} - - - - -
- {{ cell|raw }} -
- {% for information in table.get_template() %} - {% include 'information/table/tbody-cell.twig' %} - {% endfor %} - - {% for information in table.get_archive() %} - {% include 'information/table/tbody-cell.twig' %} - {% endfor %} - - {% for information in table.get_views() %} - {% include 'information/table/tbody-cell.twig' %} - {% endfor %} - - {% for information in table.get_forms() %} - {% include 'information/table/tbody-cell.twig' %} - {% endfor %} -
-
- - - - diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/table/tbody-cell.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/table/tbody-cell.twig deleted file mode 100644 index edd50d7..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/table/tbody-cell.twig +++ /dev/null @@ -1,9 +0,0 @@ -
- - {% for description in information.description %} - {% if description.type %} - {% include 'information/description/' ~ description.type ~ '.twig' %} - {% endif %} - {% endfor %} - -
diff --git a/backend/wordpress/wp-content/plugins/types/application/views/information/table/thead-cell.twig b/backend/wordpress/wp-content/plugins/types/application/views/information/table/thead-cell.twig deleted file mode 100644 index 6c2908e..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/information/table/thead-cell.twig +++ /dev/null @@ -1,17 +0,0 @@ -{{ title }} - - - - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/base.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/base.twig deleted file mode 100644 index 3e4ab97..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/base.twig +++ /dev/null @@ -1,9 +0,0 @@ -
- {% block heading %} -

{% block title %}{% endblock %}

- {% endblock %} - -
{% block content %}{% endblock %}
- - {% block footer %}{% endblock %} -
\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/help.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/help.twig deleted file mode 100644 index 73e19f7..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/help.twig +++ /dev/null @@ -1,16 +0,0 @@ -

- {{ __( 'This is the main Toolset Dashboard page. The table below provides you with an overview of content types and Toolset components in your site. It also displays the links between all the elements.', 'wpcf' ) }} -

- -

- {{ __( 'The table has two parts:', 'wpcf' ) }} -

- - - -

- {{ __( 'The buttons in the table provide shortcuts to create specific content types or Toolset components.', 'wpcf' ) }} -

diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/main.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/main.twig deleted file mode 100644 index 43f155c..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/main.twig +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "page/base.twig" %} - - {% block title %}{{ page.get_title() }}{% endblock %} - - {% block content %} -
- {% if table_toolset %} - {{ table_toolset|raw }} - {% else %} -

{{ labels.msg_no_custom_post_types }}

- {% endif %} - - {# Add new post type #} -

- {{ labels.create_type }} -

- - {# Table with 3rd party post types #} - {% if table_3rd %} -
- {{ table_3rd|raw }} - {% endif %} - - {# Table with wordpress post types #} - {% if table_wordpress %} -
- {{ table_wordpress|raw }} - {% endif %} -
- {% endblock %} - diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table.twig deleted file mode 100644 index c5ec574..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table.twig +++ /dev/null @@ -1,30 +0,0 @@ - -
-

{{ labels.headline }}

- - - - - - - - {% for content in thead %} - - {% endfor %} - - - - {{ rows|raw }} - -
- {{ labels.admin }} - - {{ labels.frontend }} -
- {% include 'page/dashboard/table/thead-cell.twig' %} -
-
- - - - diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/tbody-cell.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/tbody-cell.twig deleted file mode 100644 index edd50d7..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/tbody-cell.twig +++ /dev/null @@ -1,9 +0,0 @@ -
- - {% for description in information.description %} - {% if description.type %} - {% include 'information/description/' ~ description.type ~ '.twig' %} - {% endif %} - {% endfor %} - -
diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/tbody-row.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/tbody-row.twig deleted file mode 100644 index f3e0a00..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/tbody-row.twig +++ /dev/null @@ -1,67 +0,0 @@ - - -
-

- {% if post_type_edit_link %} - {{ post_type.name }} - {% else %} - {{ post_type.name }} - {% endif %} -

-
- - -
- - - -
- - -
- - - -
- - - {% for information in table.get_template() %} - {% include 'page/dashboard/table/tbody-cell.twig' %} - {% endfor %} - - {% if post_type.get_name() == 'page' or post_type.get_name() == 'attachment' %} - -
-

{{ labels.no_archive_for|format( post_type.name ) }}

-
- - {% elseif table.get_archive( 'show-also-for-builtin' ) %} - - {% for information in table.get_archive( 'show-also-for-builtin' ) %} - {% include 'page/dashboard/table/tbody-cell.twig' %} - {% endfor %} - - {% endif %} - - {% for information in table.get_views() %} - {% include 'page/dashboard/table/tbody-cell.twig' %} - {% endfor %} - - - {% for information in table.get_forms() %} - {% include 'page/dashboard/table/tbody-cell.twig' %} - {% endfor %} - - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/thead-cell.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/thead-cell.twig deleted file mode 100644 index 9a1537d..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/dashboard/table/thead-cell.twig +++ /dev/null @@ -1,19 +0,0 @@ -{{ content.title }} - -{% if content.description %} - - - -{% endif %} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/bulk_change_management_status_dialog.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/bulk_change_management_status_dialog.twig deleted file mode 100644 index 9c7f2f5..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/bulk_change_management_status_dialog.twig +++ /dev/null @@ -1,11 +0,0 @@ -{# - Dialog for confirming bulk action "manage/stop managing field with Types" - - @since 2.0 -#} -

{{ strings.youAreAboutToManageFields }}

-

{{ strings.youAreAboutToStopManagingFields }}

- -

{{ strings.confirmContinue }}

\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/change_assignment_dialog.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/change_assignment_dialog.twig deleted file mode 100644 index b72580e..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/change_assignment_dialog.twig +++ /dev/null @@ -1,20 +0,0 @@ -{# - Dialog for changing the field groups where a field definition belongs. - - @since 2.0 -#} -{% if groups is empty %} -

{{ strings.noFieldGroups }}

-{% else %} - -{% endif %} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/change_type_dialog.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/change_type_dialog.twig deleted file mode 100644 index 736fefb..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/change_type_dialog.twig +++ /dev/null @@ -1,59 +0,0 @@ -{# - Change field type dialog. - - @since 2.0 -#} - - {# - Section for changing field type - #} - {{ strings.aboutFieldTypeChanging }} -

{{ strings.potentiallyRiskyOperation }}

-
- {% for fieldType in fieldTypeDefinitions %} - - {% endfor %} -
-

{{ strings.someTypesAreDisabled }}

- -
- - {# - Section for changing field cardinality - #} -
-
-

{{ strings.singleOrRepeatingField }}

-
- -
-
- -
-
- - {# Warning to be displayed only if changing from repeating to single field. #} -
-
- -
-
-

{{ strings.repetitiveToSingleWarning|raw }}

-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/delete_dialog.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/delete_dialog.twig deleted file mode 100644 index d0e36ea..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/delete_dialog.twig +++ /dev/null @@ -1,14 +0,0 @@ -{# - Dialog for deleting a single field (definition + values). - - @since 2.0 -#} - -
- -
-
-

{{ strings.deletingWillRemoveDefinitionAndData }}

-

{{ strings.cannotBeUndone }}

-

{{ strings.doYouReallyWantDelete }}

-
\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/main.twig b/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/main.twig deleted file mode 100644 index fff1bd8..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/main.twig +++ /dev/null @@ -1,187 +0,0 @@ -{% extends "@generic_page/base.twig" %} - -{% block title %}{{ strings.misc.pageTitle }}{% endblock %} - -{% block content %} - -
-

- -
- -
- -
- - - -{% endblock %} - -{% block footer %} - -{% endblock %} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/message_definition_list.html b/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/message_definition_list.html deleted file mode 100644 index f287b0b..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/message_definition_list.html +++ /dev/null @@ -1,8 +0,0 @@ -<%- message %> -
    - <% - _.each(fieldDefinitions, function(fieldDefinition) { - print('
  1. ' + fieldDefinition.displayName() + '
  2. '); - }); - %> -
\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/message_multiple.html b/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/message_multiple.html deleted file mode 100644 index 323f4ea..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/page/field_control/message_multiple.html +++ /dev/null @@ -1,8 +0,0 @@ -<%= (typeof(mainMessage) != 'undefined' && 0 < mainMessage.length ? '

' + mainMessage + '

' : '' ) %> -
    - <% - _.each(messages, function(message) { - print('
  1. ' + message + '
  2. '); - }); - %> -
\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/setting/base.twig b/backend/wordpress/wp-content/plugins/types/application/views/setting/base.twig deleted file mode 100644 index c3f46ad..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/setting/base.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% if description %} -

- {{ description }} -

-{% endif %} - - -{% block setting %}{% endblock %} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/application/views/setting/checkbox.twig b/backend/wordpress/wp-content/plugins/types/application/views/setting/checkbox.twig deleted file mode 100644 index 4d70035..0000000 --- a/backend/wordpress/wp-content/plugins/types/application/views/setting/checkbox.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% extends "/setting/base.twig" %} - -{% block setting %} - {% if title %}

{{ title }}

{% endif %} - -{% endblock %} - diff --git a/backend/wordpress/wp-content/plugins/types/examples/author.php b/backend/wordpress/wp-content/plugins/types/examples/author.php deleted file mode 100644 index 8f2ab21..0000000 --- a/backend/wordpress/wp-content/plugins/types/examples/author.php +++ /dev/null @@ -1,87 +0,0 @@ - - -
-
- - - - - -
- - - - array('post', 'book') , - 'author' => get_queried_object_id(), // this will be the author ID on the author page - 'showposts' => 10 - ); - $custom_posts = new WP_Query( $args ); - - // Start the Loop. - while ( $custom_posts->have_posts() ) : $custom_posts->the_post(); - - /* - * Include the Post-Format-specific template for the content. - * If you want to override this in a child theme, then include a file - * called content-___.php (where ___ is the Post Format name) and that will be used instead. - */ - - get_template_part( 'template-parts/content', get_post_type() ); - - // End the loop. - endwhile; - - // Previous/next page navigation. - the_posts_pagination( array( - 'prev_text' => __( 'Previous page', 'twentysixteen' ), - 'next_text' => __( 'Next page', 'twentysixteen' ), - 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', - ) ); - - // If no content, include the "No posts found" template. - else : - - - endif; - ?> - -
-
- - - diff --git a/backend/wordpress/wp-content/plugins/types/examples/content-book.php b/backend/wordpress/wp-content/plugins/types/examples/content-book.php deleted file mode 100644 index 0027496..0000000 --- a/backend/wordpress/wp-content/plugins/types/examples/content-book.php +++ /dev/null @@ -1,101 +0,0 @@ - - - -
> -
- - - - - ', esc_url( get_permalink() ) ), '' ); ?> -
- - - - - - "thumbnail" ) ); ?> - -
- "%s"', 'twentysixteen' ), - get_the_title() - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> - - - -

Number of pages:

- - - - post_title; - - // Get the contents of the parent (writer) post - $writer_content = $writer_post->post_content; - ?> - -
-
Author:
-
- - -
$writer_id, 'size' => 'thumbnail' ) ); - ?>
- -
-
- - -
- - - -
- diff --git a/backend/wordpress/wp-content/plugins/types/examples/content-consultant.php b/backend/wordpress/wp-content/plugins/types/examples/content-consultant.php deleted file mode 100644 index d2dbcab..0000000 --- a/backend/wordpress/wp-content/plugins/types/examples/content-consultant.php +++ /dev/null @@ -1,83 +0,0 @@ - - - -
> -
- - - - - ', esc_url( get_permalink() ) ), '' ); ?> -
- - - - - - "thumbnail" )); ?> - - -
- - - ID, 'spoken-language', '

Spoken languages: ', ', ', '

'); ?> - - - -

Role:

- - - - "%s"', 'twentysixteen' ), - get_the_title() - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> - - - -

Contact Phone:

-
- - - - -
\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/examples/content-house.php b/backend/wordpress/wp-content/plugins/types/examples/content-house.php deleted file mode 100644 index 707f36a..0000000 --- a/backend/wordpress/wp-content/plugins/types/examples/content-house.php +++ /dev/null @@ -1,131 +0,0 @@ - - - -
> -
- - - - - ', esc_url( get_permalink() ) ), '' ); ?> -
- - - - - - "thumbnail", "index" => "0" ) ); ?> - - -
- - - "%s"', 'twentysixteen' ), - get_the_title() - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> - - - - -

Size:

- - -

Area:

- - -

Property Photos

- - $image ) { - - // Parameters for the Types field rendering mechanism. - $image_parameters = array( - 'proportional' => 'true', - 'url' => 'true', - 'field_value' => $image - ); - - // Get an image of specific (maximum) proportions. - // NOTE: Update image size to your needs - $thumbnail_parameters = array_merge( $image_parameters, array( 'width' => '200', 'height' => '200' ) ); - $thumbnail_url = types_render_field_single( $field_definition, $thumbnail_parameters, null, '', $image_index ); - - // Get the image in full size. - $fullsize_parameters = array_merge( $image_parameters, array( 'size' => 'full' ) ); - $fullsize_url = types_render_field_single( $field_definition, $fullsize_parameters, null, '', $image_index ); - - // Append the markup (a thumbnail linking to the full image) to existing content. - // NOTE: Customize the output to your needs - $output .= sprintf( - '
' - ); - } - } - - echo $output; - } - ?> - -
- - - -
\ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/examples/content-writer.php b/backend/wordpress/wp-content/plugins/types/examples/content-writer.php deleted file mode 100644 index 01b3b0c..0000000 --- a/backend/wordpress/wp-content/plugins/types/examples/content-writer.php +++ /dev/null @@ -1,88 +0,0 @@ - - - -
> -
- - - - - ', esc_url( get_permalink() ) ), '' ); ?> -
- - - - - - "thumbnail" )); ?> - - -
- - - "%s"', 'twentysixteen' ), - get_the_title() - ) ); - ?> - - - -

Books from this author

- - - -
-
post_title; // Display the post title of a current child post ?>
- "$child_post->ID", "size" => "thumbnail" )); // Display the image coming from a custom field of the current child post ?> -
- - - - '', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> - -
- - -
- diff --git a/backend/wordpress/wp-content/plugins/types/examples/single-consultant.php b/backend/wordpress/wp-content/plugins/types/examples/single-consultant.php deleted file mode 100644 index 4693dd0..0000000 --- a/backend/wordpress/wp-content/plugins/types/examples/single-consultant.php +++ /dev/null @@ -1,129 +0,0 @@ - - -
-
- - - -
> -
- - - - - ', esc_url( get_permalink() ) ), '' ); ?> -
- - - - - - "thumbnail" )); ?> - - -
- - - - ID, 'spoken-language', '

Spoken languages: ', ', ', '

'); ?> - - -

Role:

- - - - "%s"', 'twentysixteen' ), - get_the_title() - ) ); - - wp_link_pages( array( - 'before' => '', - 'link_before' => '', - 'link_after' => '', - 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', - 'separator' => ', ', - ) ); - ?> - - -

Contact Phone:

-
- - -
- - "%s"', 'twentysixteen' ), - get_the_title() - ), - '', - '' - ); - ?> -
-
- - - _x( 'Published in%title', 'Parent post link', 'twentysixteen' ), - ) ); - } elseif ( is_singular( 'post' ) ) { - // Previous/next post navigation. - the_post_navigation( array( - 'next_text' => ' ' . - '' . __( 'Next post:', 'twentysixteen' ) . ' ' . - '%title', - 'prev_text' => ' ' . - '' . __( 'Previous post:', 'twentysixteen' ) . ' ' . - '%title', - ) ); - } - - // End of the loop. - endwhile; - ?> - -
- - - -
- - - diff --git a/backend/wordpress/wp-content/plugins/types/license.txt b/backend/wordpress/wp-content/plugins/types/license.txt deleted file mode 100644 index ecbc059..0000000 --- a/backend/wordpress/wp-content/plugins/types/license.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/css/information.css b/backend/wordpress/wp-content/plugins/types/public/css/information.css deleted file mode 100644 index 686eb43..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/css/information.css +++ /dev/null @@ -1,315 +0,0 @@ -/* General */ -.types-table-row { - display: table-row; -} - -.types-table-cell { - display: table-cell; - vertical-align: top; -} - -.types-button, -.types-button:hover, -.types-button:focus, -.types-button:visited, -.wp-core-ui .types-button.button-primary, -.wp-core-ui .types-button.button-primary:hover, -.wp-core-ui .types-button.button-primary:focus, -.wp-core-ui .types-button.button-primary:visited { - background: #f05a28; - border-color: #ed4e26; - box-shadow: 0 1px 0 #ed4e26; - text-shadow: 0 -1px 1px #ed4e26, 1px 0 1px #ed4e26, 0 1px 1px #ed4e26, -1px 0 1px #ed4e26; -} - -.wp-core-ui .types-information .button, -.wp-core-ui .types-information .button-primary, -.wp-core-ui .types-information .button-secondary { - height: 26px; - line-height: 24px; - font-size: 12px; -} - -.types-button:hover, -.wp-core-ui .types-button.button-primary:hover { - background-color: #ed4e26; -} - -.types-warning, -.postbox.types-warning { - background-color: #fffece; -} - -/* Table in Meta Box */ -#poststuff .types-table-in-meta-box .inside, -.types-table-in-meta-box .inside { - padding: 15px; - margin: 0; -} - -.types-table-in-meta-box table { - border-collapse: collapse; - height: 100%; -} - -.types-table-in-meta-box tbody { - vertical-align: top; - height: 100%; -} - -.types-table-in-meta-box th { - text-align: center; - padding: 0 0 10px; -} - -.types-table-in-meta-box td { - margin: 0; - padding: 0; - height: 100%; - border: 1px solid #ececec; - overflow: hidden; -} - -a.types-external-link { - padding-right: 15px; -} -a.types-external-link:after { - content: "\f504"; - display: inline-block; - width: 15px; - margin-right: -15px; - font-size: 14px; - line-height: 18px; - font-family: dashicons; - text-decoration: none; - font-weight: normal; - font-style: normal; - vertical-align: top; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -a.types-button.types-external-link:after { - vertical-align: text-top; - padding-right: 10px; -} - -/* Specific to informations */ -.types-information p { - font-size: 12px; - text-align: left; -} - -.types-information .types-information-link { - text-align: center; -} - -.types-information-td-inner { - height: 100%; - padding: 5px 10px; -} - -.types-information-important { - background-color: #fffece; -} - -.types-information-important p { - text-align: center; -} - -.types-information-important p:first-child { - padding-left: 30px; - text-align: left; -} -.types-information-important p:first-child:before { - margin-left: -32px; - color: #a00; - content: "\f122"; - display: block; - width: 20px; - height: 0; - font-size: 25px; - line-height: 1; - font-family: 'onthegosystems-icons'; - text-decoration: inherit; - font-weight: normal; - font-style: normal; - vertical-align: top; - text-align: center; - -webkit-transition: color .1s ease-in 0; - transition: color .1s ease-in 0; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.types-information ul { - list-style: disc; - margin-left: 25px; -} -.types-message-icon.types-table-cell, -.types-message-content.types-table-cell { - height: 90px; -} - -.types-message-icon { - padding: 0 25px 0 15px; - text-align: center; -} - -.types-message-icon .dashicons, -.types-message-icon .icon-toolset-logo { - color: #f05a28; - font-size: 60px; - width: 60px; - margin-top: 15px; -} - -.types-message-icon .icon-toolset-logo { - font-size: 80px; - width: auto; - margin-top: -15px; -} - -/* Pointer */ -.types-pointer-inner .types-information-paragraph { - padding-right: 30px; -} - -.types-information-pointer .wp-pointer-buttons { - padding: 0; -} - -.types-information-pointer.wp-pointer-bottom .wp-pointer-arrow { - left: auto; - right: 50px; -} - -/* Toolset Dashboard */ -div.toolset-dashboard { - margin-top: 25px; -} - -div.toolset-dashboard .types-information-paragraph { - text-align: center; -} - -div.toolset-dashboard .types-information-important .types-information-paragraph { - text-align: left; -} - -div.toolset-dashboard table td p > a, -div.toolset-dashboard table td li > a { - text-decoration: none !important; -} - -div.toolset-dashboard table ul { - margin-left: 15px; -} - -div.toolset-dashboard table ul li { - font-size: 12px; - margin-bottom: 3px; -} -div.toolset-dashboard .types-information-important { - background: transparent; -} - -/* -div.toolset-dashboard .types-information-important p:first-child a:before { - margin-left: -45px; -} - -div.toolset-dashboard .types-information-important p:first-child:before { - content: ''; -} - -div.toolset-dashboard .types-information-important p:first-child { - padding-left: 0; - text-align: center; -} -*/ - -div.toolset-dashboard div.types-information table { - border-collapse: collapse; -} -div.toolset-dashboard div.types-information table th, -div.toolset-dashboard div.types-information table td { - border: 1px solid #cacaca; - vertical-align: middle; -} - -div.toolset-dashboard div.types-information table th:nth-child(3), -div.toolset-dashboard div.types-information table td:nth-child(3) { - border-right-color: #000; -} - -div.toolset-dashboard div.types-information thead tr:first-child th { - color: #fff; - background-color: #999999; - border-color: #000; - font-size: 14px; - padding: 8px 0; -} - -div.toolset-dashboard div.types-information thead tr:first-child th:last-child { - background-color: #000; -} - -div.toolset-dashboard div.types-information thead tr:last-child th { - font-size: 14px; - padding: 12px 0; -} - -div.toolset-dashboard div.types-information tbody tr { - background: #fff; -} -div.toolset-dashboard div.types-information tbody tr:nth-child(2n) { - background: #f9f9f9; -} - -div.toolset-dashboard .types-information-paragraph.toolset-dashboard-post-type { - font-size: 14px; - font-weight: bold; - text-align: left; -} - -/* DELETE START -@todo Update Toolset logo in otgs-icon-font and delete the following afterwards */ -.types-message-icon .icon-toolset-logo:before { - content: ''; -} - -.types-message-icon .icon-toolset-logo { - height: 100px; - width: 100px; - margin-top: 2px; - display: block; - background: transparent url( '../img/toolset-logo-no-margin.png' ) no-repeat; - background-size: contain; -} -/* DELETE END */ - -.types-message-button-right { - position: absolute; - bottom: 23px; - right: 20px; -} - -.types-message-dialog-button { - display: block; - text-align: right; -} - -#types-feedback { - min-height: 0 !important; -} -.types-feedback .ui-dialog-titlebar { - border: 0; - background: inherit; - height: 8px; -} - -/* todo remove once placeholders are rendered before twig rendering */ -.types-information-td-inner a[href=""] { - display: none; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/images/ajax-loader-overlay.gif b/backend/wordpress/wp-content/plugins/types/public/images/ajax-loader-overlay.gif deleted file mode 100644 index d84f653..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/public/images/ajax-loader-overlay.gif and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/public/img/toolset-logo-no-margin.png b/backend/wordpress/wp-content/plugins/types/public/img/toolset-logo-no-margin.png deleted file mode 100644 index db51196..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/public/img/toolset-logo-no-margin.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/public/js/feedback-on-deactivation.js b/backend/wordpress/wp-content/plugins/types/public/js/feedback-on-deactivation.js deleted file mode 100644 index 33e9309..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/js/feedback-on-deactivation.js +++ /dev/null @@ -1,37 +0,0 @@ -( function( $ ) { - - var linkDeactivate = $( '#types-leave-feedback-trigger' ).parent().parent().find( '.deactivate > a' ), - dialogClosed = 0; - - linkDeactivate.on( 'click', function( e ) { - if( dialogClosed == 1 ) { - location.href = $( this ).attr( 'href' ); - return; - } - - e.preventDefault(); - - $.post( ajaxurl, { - action: 'types_feedback_dont_show_for_90_days' - } ); - - var dialogFeedback = $( '#types-feedback' ); - - dialogFeedback.dialog({ - 'dialogClass' : 'wp-dialog types-feedback', - 'modal' : true, - 'autoOpen' : false, - 'closeOnEscape' : true, - 'width': 500, - close: function() { - dialogClosed = 1; - linkDeactivate.trigger( 'click' ); - } - } ).dialog( 'open' ); - } ); - - $( 'body' ).on( 'click', '#types-leave-feedback-dialog-survey-link, #types-leave-feedback-dialog-survey-link-cancel', function() { - $( '#types-feedback' ).dialog( 'close' ); - } ); - -} )( jQuery ); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/js/information.js b/backend/wordpress/wp-content/plugins/types/public/js/information.js deleted file mode 100644 index e2e9987..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/js/information.js +++ /dev/null @@ -1,64 +0,0 @@ -//noinspection JSUnusedAssignment -var Types = Types || {}; - -Types.information = Types.information || {}; - -( function( $ ) { - Types.information.openDialog = function( id ) { - // dialog - var dialog = $( '#' + id ); - - if( dialog.length ) { - dialog.dialog( { - dialogClass : 'wp-dialog types-information-dialog', - modal : true, - autoOpen : false, - closeOnEscape : true, - minWidth: 800, - open: function() { - dialog.find( 'a' ).blur(); - }, - } ).dialog( 'open' ); - } - } - - $( 'body' ).on( 'click', '[data-types-open-dialog]', function() { - Types.information.openDialog( $( this ).data( 'types-open-dialog' ) ); - } ); - - Types.information.openPointer = function( trigger ) { - var content = $( '#' + trigger.data( 'types-open-pointer' ) ); - $( '.types-information-active-pointer' ).pointer( 'close' ); - - if( trigger.length ) { - trigger.addClass( 'types-information-active-pointer' ); - trigger.pointer( { - pointerClass : 'types-information-pointer', - content: content.html(), - position: { - edge: 'bottom', - align: 'right' - }, - buttons: function( event, t ) { - var button_close = $( '' ); - button_close.bind( 'click.pointer', function( e ) { - e.preventDefault(); - t.element.pointer( 'close' ); - }); - return button_close; - }, - show: function( event, t ){ - t.pointer.css( 'marginLeft', '54px' ); - }, - close: function( event, t ){ - t.pointer.css( 'marginLeft', '0' ); - }, - } ).pointer( 'open' ); - } - } - - $( 'body' ).on( 'click', '[data-types-open-pointer]', function() { - Types.information.openPointer( $( this ) ); - } ); - -} )( jQuery ); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/js/notice-dismiss.js b/backend/wordpress/wp-content/plugins/types/public/js/notice-dismiss.js deleted file mode 100644 index ee8f264..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/js/notice-dismiss.js +++ /dev/null @@ -1,12 +0,0 @@ -( function( $ ) { - - $( 'body' ).on( 'click', '[data-types-notice-dismiss-permanent] .notice-dismiss', function() { - $.post( ajaxurl, { - action: 'types_notice_dismiss_permanent', - types_notice_dismiss_permanent: $( this ).closest( '.notice' ).data( 'types-notice-dismiss-permanent' ) - } ); - - return false; - } ); - -} )( jQuery ); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/js/settings.js b/backend/wordpress/wp-content/plugins/types/public/js/settings.js deleted file mode 100644 index b81f469..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/js/settings.js +++ /dev/null @@ -1,47 +0,0 @@ -//noinspection JSUnusedAssignment -var Types = Types || {}; - -Types.settings = Types.settings || {}; - -( function( $ ) { - - var modelData = $.parseJSON(WPV_Toolset.Utils.editor_decode64($('#types_model_data').html())); - Types.settings.ajaxInfo = modelData.ajaxInfo || {}; - - Types.settings.save = function( setting_id ) { - - var data = { - action: 'types_settings_action', - setting: setting_id, - setting_value: $("input[name^='"+setting_id+"']" ).serialize(), - wpnonce: Types.settings.ajaxInfo.fieldAction.nonce, - }; - - $( document ).trigger( 'js-toolset-event-update-setting-section-triggered' ); - - $.ajax({ - type: "POST", - dataType: "json", - url: ajaxurl, - data: data, - success: function( response ) { - if ( response.success ) { - $( document ).trigger( 'js-toolset-event-update-setting-section-completed' ); - } else { - $( document ).trigger( 'js-toolset-event-update-setting-section-failed' ); - } - }, - error: function( ajaxContext ) { - $( document ).trigger( 'js-toolset-event-update-setting-section-failed' ); - }, - complete: function() { - - } - }); - } - - $( 'body' ).on( 'change', '[data-types-setting-save]', function() { - Types.settings.save( $( this ).attr( 'data-types-setting-save' ) ); - } ); - -} )( jQuery ); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/js/slug_conflict_checker.js b/backend/wordpress/wp-content/plugins/types/public/js/slug_conflict_checker.js deleted file mode 100644 index bebb079..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/js/slug_conflict_checker.js +++ /dev/null @@ -1,90 +0,0 @@ -var Types = Types || {}; - -/** - * Helper for checking an input field for slug conflicts. - * - * See the build() method for details. - * - * @type {slugConflictChecker} - * @since 2.1 - */ -Types.slugConflictChecker = new function() { - - var self = this; - - /** - * Checker object prototype. - * - * @constructor - */ - var Checker = function(element, domains, currentDomain, currentId, nonce, callback) { - - var checker = this; - - /** - * Invoke the check for conflicts manually. - */ - checker.check = function() { - - WPV_Toolset.Utils.Ajax.call( - { - action: 'types_check_slug_conflicts', - wpnonce: nonce, - domains: domains, - value: element.val(), - exclude: { - domain: currentDomain, - id: currentId - } - }, - - /** - * @param response - * @param {{isConflict:boolean,displayMessage:string}} responseData - */ - function(response, responseData) { - if(responseData.isConflict) { - callback(true, responseData.displayMessage); - } else { - callback(false); - } - }, - function() { - // Do nothing - } - ); - }; - - /** - * Bind to the change events of the provided elements and invoke check() when needed. - * - * @since 2.1 - */ - checker.bind = function() { - element.on('change paste keyup input propertychange', _.debounce(function () { - checker.check(); - }, 1000)); - }; - - }; - - - /** - * Build a slug config checker for a specific scenario. - * - * @param element A jQuery element that should be observed for slug conflicts. - * @param {[string]} domains Possible domains of slug conflicts. Check Types_Ajax_Handler_Check_Slug_Conflicts - * for details. - * @param {string} currentDomain Domain of the object that is being edited. - * @param {string|int} currentId ID of the object that is being edited (it needs to be skipped while checking - * for conflicts). - * @param {string} nonce A valid nonce for the types_check_slug_conflicts AJAX call. - * @param {function(isSuccess:bool,displayMessage:string|undefined)} callback Function that handles checking result. - * @returns {Checker} The initialized checker object. - * @since 2.1 - */ - self.build = function(element, domains, currentDomain, currentId, nonce, callback) { - return new Checker(element, domains, currentDomain, currentId, nonce, callback); - }; - -}; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/page/add_term.js b/backend/wordpress/wp-content/plugins/types/public/page/add_term.js deleted file mode 100644 index 45cb400..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/add_term.js +++ /dev/null @@ -1,188 +0,0 @@ - -var Types = Types || {}; - -Types.page = Types.page || {}; - -/** - * Main script for the Add Term (edit-tags.php) page. - * - * Currently it does only one thing: After a new term is added via AJAX, it recognizes the event - * and if there are custom term fields, starts a page reload. - * - * The reason for enforcing a page reload is that we need to completely reset the inputs rendered by - * toolset-forms but in doing so we lose all kinds of event bindings. toolset-forms is not built for such situation - * and implementing the needed changes in legacy code (and also some third-party one) only to avoid one reload - * seems rather impractical. - * - * See wp-admin/edit-tags.php and wp-admin/js/tags.php for details. - * - * @since 2.1 - */ -Types.page.addTerm = (function($) { - - var self = this; - - self.formSelector = 'form#addtag'; - - self.init = function() { - - $(document).ready(function () { - - //noinspection JSUnresolvedVariable - /** - * @type {{autohidden_columns:bool,last_displayed_column:string}} - */ - self.l10n = (typeof(types_page_add_term_l10n) == 'undefined') ? {} : types_page_add_term_l10n; - - if(self.hasTypesFields()) { - - $(document).bind('ajaxSuccess', self.catchAfterTermCreatedEvent); - self.createFauxSubmitButton(); - self.maybeAnnotateLastDisplayedColumn(); - } - }); - }; - - - /** - * Hide the submit button from the form, and display its clone instead. - * - * When the cloned button is clicked, we'll manually trigger form validation and click on the original - * button only if the validation is successful. - * - * This is used to outrun the binding on the original submit button from that's defined in wp-admin/js/tags.js - * (and we can't do anything about that). - * - * @since 2.1 - */ - self.createFauxSubmitButton = function() { - - var form = $(self.formSelector); - var submitSection = form.find('p.submit'); - var originalSubmitButton = submitSection.find('#submit'); - - var customSubmitButton = originalSubmitButton.clone(); - - originalSubmitButton.css('display', 'none'); - - customSubmitButton.off(); - customSubmitButton.attr('id', 'types-custom-submit'); - - var handleSubmitAction = function(e) { - - if(form.valid()) { - WPV_Toolset.Utils.Spinner.show(WPV_Toolset.Utils.Spinner.find(form)); - originalSubmitButton.click(); - } - - // If the form isn't valid, the validation code has displayed all the required messages, etc. - - e.preventDefault(); - e.stopPropagation(); - }; - - customSubmitButton.click(handleSubmitAction); - customSubmitButton.submit(handleSubmitAction); - - submitSection.append(customSubmitButton).append(WPV_Toolset.Utils.Spinner.create()); - - // Set the new custom button as default. - self.setDefaultSubmitButton(form, customSubmitButton); - }; - - - /** - * When the form contains other buttons, we need to ensure our button will be handled as the default one - * (when user presses enter, it's submit event will be invoked). There is no standard way to define a default - * button, and this was causing issues with file-based custom fields (which come with an Upload button). - * - * For more insight see these SO questions: - * - http://stackoverflow.com/q/925334/3191395 - * - http://stackoverflow.com/q/699065/3191395 - * - * @param form - * @param defaultButton - * - * @since 2.1 - */ - self.setDefaultSubmitButton = function(form, defaultButton) { - - // Binding on keydown, because keypress was too late. - form.find('input').keydown(function(e) { - // Lucky number for Enter - if(13 == e.which) { - defaultButton.submit(); - return false; - } - }); - - }; - - - /** - * Indicate whether the Add Term form contains some Types fields. - * - * @returns {boolean} - */ - self.hasTypesFields = function() { - return ($('#types-groups-exist').length !== 0); - }; - - - /** - * Process an event and determine if it was a term creation. - * - * Reload the page if needed. - * - * @param event - * @param xhr - * @param settings - * - * @since 2.1 - */ - self.catchAfterTermCreatedEvent = function(event, xhr, settings) { - - var data = '?' + settings.data; - var action = WPV_Toolset.Utils.getParameterByName('action', data); - - if('add-tag' == action && self.hasTypesFields()) { - - var hasAjaxError = ( 0 < $('div#ajax-response > div.error').length ); - - // If an error message is displayed, we'll scroll to the top of the page - // (because of Types fields the form could have become too long). - if(hasAjaxError) { - WPV_Toolset.Utils.Spinner.hide(WPV_Toolset.Utils.Spinner.find($(self.formSelector))); - $('html, body').animate({ scrollTop: 0 }, "slow"); - } else { - var newUrl = WPV_Toolset.Utils.updateUrlQuery('message', '1'); - window.location.replace(newUrl); - } - } - }; - - - /** - * Add an annotation to one of the column headers if some columns have been hidden automatically. - * - * @since 2.1 - */ - self.maybeAnnotateLastDisplayedColumn = function() { - - if(_.has(self.l10n, 'autohidden_columns') && self.l10n.autohidden_columns) { - $('th.column-' + self.l10n.last_displayed_column).append( - '' + self.l10n.annotation + '' - ); - - // Hide the annotation as soon as user touches the screen options toggle. - $(document).bind('screen:options:open', function() { - $('.types-column-autohiding-annotation').remove(); - }); - } - - }; - - - self.init(); - -})(jQuery); diff --git a/backend/wordpress/wp-content/plugins/types/public/page/adjust_submenu_links.js b/backend/wordpress/wp-content/plugins/types/public/page/adjust_submenu_links.js deleted file mode 100644 index 8203ac9..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/adjust_submenu_links.js +++ /dev/null @@ -1,87 +0,0 @@ -var Types = Types || {}; - -(function($) { - - Types.page = Types.page || {}; - - /** - * Utility for adding URL parameters to WordPress admin menus, which is currently not supported by WordPress. - * - * Usage: - * Types.page.menuLinkAdjuster.addMenuParams(params, selector); - * - * - param can be either a single object {key: 'param', value: 'value'} or an array of such objects. - * - selector, if provided, needs to select the a tag in a menu item. If omitted, it defaults to currently active menu item. - * - * If the params object is provided via wp_localize_script in Types.l10n.paramsToAddToSubmenu, it will be applied - * to the currently selected menu item automatically (this yet needs to be tested). - * - * @since 2.0 - */ - Types.page.menuLinkAdjuster = new function() { - - var self = this; - - self.addQueryArg = function (url, param, value) { - var a = document.createElement('a'), regex = /(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g; - var match, str = []; a.href = url; param = encodeURIComponent(param); - while (match = regex.exec(a.search)) - if (param != match[1]) str.push(match[1]+(match[2]?"="+match[2]:"")); - str.push(param+(value?"="+ encodeURIComponent(value):"")); - a.search = str.join("&"); - return a.href; - }; - - - self.getParamsToAdd = function() { - if(_.has(Types, 'l10n') && _.has(Types.l10n, 'paramsToAddToSubmenu')) { - return Types.l10n['paramsToAddToSubmenu']; - } else { - return null; - } - }; - - - /** - * Add menu parameters to the selected a tag. - * - * @param {{key:string,value:string}|[{key:string,value:string}]} paramsToAdd - * @param {string|undefined} selector - * @since 2.0 - */ - self.addMenuParams = function(paramsToAdd, selector) { - - if(typeof(selector) == 'undefined') { - selector = self.currentSubmenuSelector; - } - - if(!_.isArray(paramsToAdd)) { - paramsToAdd = [paramsToAdd]; - } - - var menuLink = $(selector); - var url = menuLink.attr('href'); - _.each(paramsToAdd, function(paramToAdd) { - url = self.addQueryArg(url, paramToAdd.key, paramToAdd.value); - }); - menuLink.attr('href', url); - }; - - - self.currentSubmenuSelector = '.wp-has-current-submenu li.current a'; - - - self.autorun = function() { - var paramsFromL10n = self.getParamsToAdd(); - if(_.isArray(paramsFromL10n)) { - self.addMenuParams(paramsFromL10n); - } - }; - - - self.autorun(); - - }; - - -})(jQuery); diff --git a/backend/wordpress/wp-content/plugins/types/public/page/edit_post_type/main.js b/backend/wordpress/wp-content/plugins/types/public/page/edit_post_type/main.js deleted file mode 100644 index dbca2da..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/edit_post_type/main.js +++ /dev/null @@ -1,75 +0,0 @@ -var Types = Types || {}; - -Types.page = Types.page || {}; - -Types.page.editPostType = {}; - -/** - * Edit Post Type page controller. - * - * Works together with the legacy script, however completely new code should be added here. - * - * @param $ jQuery - * @constructor - * @since 2.1 - */ -Types.page.editPostType.Class = function($) { - - var self = this; - - - self.init = function() { - self.initRewriteSlugChecker(); - }; - - - /** - * Start checking for rewrite slug conflicts within post types and taxonomies. - * - * Displays a warning (not error) message after the input field as long as there is a conflict, but doesn't block the - * form submitting. - * - * @since 2.1 - */ - self.initRewriteSlugChecker = function() { - var rewriteSlugInput = $('input[name="ct[rewrite][slug]"]'); - - if(rewriteSlugInput.length == 0) { - return; - } - - var checker = Types.slugConflictChecker.build( - rewriteSlugInput, - ['post_type_rewrite_slugs', 'taxonomy_rewrite_slugs'], - 'post_type_rewrite_slugs', - $('input[name="ct[wpcf-post-type]"]').val(), - $('input[name="types_check_slug_conflicts_nonce"]').val(), - function(isConflict, displayMessage) { - - // Hide previous error label - var errorLabel = rewriteSlugInput.parent().find('label.wpcf-form-error.types-slug-conflict'); - if(0 !== errorLabel.length) { - errorLabel.remove(); - } - - if(isConflict) { - rewriteSlugInput.after( - '' - ); - } - } - ); - - checker.bind(); - - // Check even if rewrite is not enabled at the moment. When enabled later, the warning will be already in place. - if(rewriteSlugInput.val().length > 0) { - checker.check(); - } - }; - - $(document).ready(self.init); -}; - - -Types.page.editPostType.main = new Types.page.editPostType.Class(jQuery); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/page/edit_taxonomy/main.js b/backend/wordpress/wp-content/plugins/types/public/page/edit_taxonomy/main.js deleted file mode 100644 index c1fe420..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/edit_taxonomy/main.js +++ /dev/null @@ -1,75 +0,0 @@ -var Types = Types || {}; - -Types.page = Types.page || {}; - -Types.page.editTaxonomy = {}; - -/** - * Edit Taxonomy page controller. - * - * Works together with the legacy script, however completely new code should be added here. - * - * @param $ jQuery - * @constructor - * @since 2.1 - */ -Types.page.editTaxonomy.Class = function($) { - - var self = this; - - self.init = function() { - self.initRewriteSlugChecker(); - }; - - - /** - * Start checking for rewrite slug conflicts within post types and taxonomies. - * - * Displays a warning (not error) message after the input field as long as there is a conflict, but doesn't block the - * form submitting. - * - * @since 2.1 - */ - self.initRewriteSlugChecker = function() { - var rewriteSlugInput = $('input[name="ct[rewrite][slug]"]'); - - if (rewriteSlugInput.length == 0) { - return; - } - - var checker = Types.slugConflictChecker.build( - rewriteSlugInput, - ['post_type_rewrite_slugs', 'taxonomy_rewrite_slugs'], - 'taxonomy_rewrite_slugs', - $('input[name="ct[wpcf-tax]"]').val(), - $('input[name="types_check_slug_conflicts_nonce"]').val(), - function (isConflict, displayMessage) { - - var errorLabel = rewriteSlugInput.parent().find('label.wpcf-form-error.types-slug-conflict'); - if (0 !== errorLabel.length) { - errorLabel.remove(); - } - - if (isConflict) { - rewriteSlugInput.after( - '' - ); - } - } - ); - - checker.bind(); - - // Check even if rewrite is not enabled at the moment. When enabled later, the warning will be already in place. - if (rewriteSlugInput.val().length > 0) { - checker.check(); - } - }; - - $(document).ready(self.init); -}; - - -Types.page.editTaxonomy.main = new Types.page.editTaxonomy.Class(jQuery); - - diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/main.js b/backend/wordpress/wp-content/plugins/types/public/page/field_control/main.js deleted file mode 100644 index 3059a46..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/main.js +++ /dev/null @@ -1,467 +0,0 @@ -var Types = Types || {}; - -// the head.js object -Types.head = Types.head || head; - -Types.page = Types.page || {}; - -// Everything related to this page. -Types.page.fieldControl = {}; -Types.page.fieldControl.viewmodels = {}; -Types.page.fieldControl.strings = {}; - - -/** - * Page controller class. - * - * Handles page initialization. - * - * @param $ jQuery - * @constructor - */ -Types.page.fieldControl.Class = function ($) { - - var self = this; - - /** - * Turns on debug messages. - * @type {boolean} - * @since 2.0 - */ - self.isDebug = false; - - - self.init = function () { - - // Read model data, a JSON string encoded in base64 to avoid parsing issues. - var modelData = $.parseJSON(WPV_Toolset.Utils.editor_decode64($('#types_model_data').html())); - self.debug('modelData', modelData); - - //noinspection JSUnresolvedVariable - Types.page.fieldControl.jsPath = modelData.jsIncludePath; - - self.initTemplates(modelData); - self.initStaticData(modelData); - self.initAjax(); - self.initKnockout(); - self.initDialogs(); - - // Continue after loading the view of the listing table. - Types.head.load( - - Types.page.fieldControl.jsPath + '/viewmodels/BulkChangeManagementStatusDialogViewModel.js', - Types.page.fieldControl.jsPath + '/viewmodels/DeleteDialogViewModel.js', - Types.page.fieldControl.jsPath + '/viewmodels/ChangeAssignDialogViewModel.js', - Types.page.fieldControl.jsPath + '/viewmodels/ChangeFieldTypeDialogViewModel.js', - Types.page.fieldControl.jsPath + '/viewmodels/FieldDefinitionViewModel.js', - Types.page.fieldControl.jsPath + '/viewmodels/ListingViewModel.js', - - function() { - - // Render the listing. - self.viewModel = new Types.page.fieldControl.viewmodels.ListingViewModel(modelData.fieldDefinitions); - - self.afterInit(); - } - ); - - }; - - - /** - * Initialize the getter function for templates. - * - * Reads the data passed from PHP and assigns a function to Types.page.fieldControl.getTemplate that will - * retrieve the template content. This way it becomes the single method of retrieving a template. - * - * @param modelData - * @since 2.0 - */ - self.initTemplates = function(modelData) { - - if( _.has(modelData, 'templates') && _.isObject(_.property('templates')(modelData))) { - - Types.page.fieldControl.templates = new function() { - - var templates = this; - - templates.raw = _.property('templates')(modelData); - - /** - * @param {string} templateName - * @returns {string} Raw template content. - */ - templates.getRawTemplate = function(templateName) { - if(_.has(templates.raw, templateName)) { - return templates.raw[templateName]; - } else { - self.log('Template "' + templateName + '" not found.'); - return ''; - } - }; - - templates.compiledUnderscoreTemplates = {}; - - /** - * @param {string} templateName - * @returns {function} Compiled underscore template - */ - templates.getUnderscoreTemplate = function(templateName) { - if(!_.has(templates.compiledUnderscoreTemplates, templateName)) { - templates.compiledUnderscoreTemplates[templateName] = _.template(templates.getRawTemplate(templateName)); - } - return templates.compiledUnderscoreTemplates[templateName]; - }; - - - /** - * Compile an underscore template (with using cache) and render it. - * - * @param {string} templateName - * @param {object} context Underscore context for rendering the template. - * @returns {string} Rendered markup. - */ - templates.renderUnderscore = function(templateName, context) { - var compiled = templates.getUnderscoreTemplate(templateName); - return compiled(context); - }; - - }; - - } - - }; - - - /** - * Fill the Types.page.fieldControl.strings object with data passed from PHP. - * - * @param modelData - * @since 2.0 - */ - self.initStaticData = function(modelData) { - - Types.page.fieldControl.strings = modelData.strings || {}; - - Types.page.fieldControl.strings.misc = Types.page.fieldControl.strings.misc || {}; - - Types.page.fieldControl.fieldTypeDefinitions = modelData.fieldTypeDefinitions || {}; - - Types.page.fieldControl.ajaxInfo = modelData.ajaxInfo || {}; - - Types.page.fieldControl.currentDomain = modelData.currentDomain || {}; - - Types.page.fieldControl.groups = modelData.groups || {}; - - Types.page.fieldControl.typeConversionMatrix = modelData.typeConversionMatrix || {}; - - Types.page.fieldControl.itemsPerPage = modelData.itemsPerPage || {}; - }; - - - /** - * Initialize everything AJAX-related here. - * - * @since 2.0 - */ - self.initAjax = function() { - - /** - * Ensure that response is always an object with the success property. - * - * If it's not, return a dummy object indicating a failure. - * - * @param response {*} Response from the AJAX call. - * @returns {{success: boolean}} Sanitized response. - * - * @since 2.0 - */ - var parseResponse = function(response) { - if( typeof(response.success) === 'undefined' ) { - self.log("parseResponse: no success value", response); - return { success: false }; - } else { - return response; - } - }; - - - /** - * Perform an AJAX call on field definitions. - * - * @param {string} fieldAction Name of the action, see Types_Ajax::callback_field_control_action() for details. - * @param {string} nonce Name of the nonce for this action. - * @param {object|[object]} fields One or more models of fields this action applies to. - * @param {object} data Custom action-specific data. - * @param {function} successCallback Callback to be used after AJAX call is completed. It will get two parameters, - * the complete AJAX response and the 'data' element for convenience. - * @param {function} [failCallback] Analogous to successCallback for the case of failure. If missing, - * successCallback will be used instead. - * - * @since 2.0 - */ - Types.page.fieldControl.doAjax = function(fieldAction, nonce, fields, data, successCallback, failCallback) { - - - if(!_.isArray(fields)) { - fields = [fields]; - } - - var ajaxData = { - action: 'types_field_control_action', - field_action: fieldAction, - wpnonce: nonce, - fields: fields, - domain: Types.page.fieldControl.currentDomain, - action_specific: data - }; - - - if( typeof(failCallback) == 'undefined' ) { - failCallback = successCallback; - } - - $.ajax({ - async: true, - type: 'POST', - url: ajaxurl, - data: ajaxData, - - success: function(originalResponse) { - var response = parseResponse(originalResponse); - - self.debug('AJAX response', ajaxData, originalResponse); - - if(response.success) { - successCallback(response, response.data || {}); - } else { - failCallback(response, response.data || {}); - } - }, - - error: function( ajaxContext ) { - console.log('Error:', ajaxContext.responseText); - failCallback({ success: false, data: {} }, {}); - } - }); - - } - }; - - - /** - * Initialize custom Knockout bindings and other modifications. - * - * @since 2.0 - */ - self.initKnockout = function() { - - // Taken from http://knockoutjs.com/examples/animatedTransitions.html - // Here's a custom Knockout binding that makes elements shown/hidden via jQuery's fadeIn()/fadeOut() methods - ko.bindingHandlers.fadeVisible = { - init: function(element, valueAccessor) { - // Initially set the element to be instantly visible/hidden depending on the value - var value = valueAccessor(); - $(element).toggle(ko.unwrap(value)); // Use "unwrapObservable" so we can handle values that may or may not be observable - }, - update: function(element, valueAccessor) { - // Whenever the value subsequently changes, slowly fade the element in or out - var value = valueAccessor(); - ko.unwrap(value) ? $(element).fadeIn() : $(element).fadeOut(); - } - }; - - - var applyDisplayMode = function(displayMode, element, immediately) { - switch(displayMode) { - case 'show': - element.css('visibility', 'visible'); - if(immediately) { - element.show(); - } else { - element.slideDown().css('display', 'none').fadeIn(); - } - break; - case 'hide': - element.css('visibility', 'hidden'); - if(immediately) { - element.show(); - } else { - element.slideDown(); - } - break; - case 'remove': - if(immediately) { - element.hide(); - } else { - element.slideUp().fadeOut(); - } - element.css('visibility', 'hidden'); - break; - } - }; - - - /** - * Binding for displaying an element in three modes: - * - * - 'show' will simply display the element - * - 'hide' will hide it, but leave the free space for another message to be displayed soon - * - 'remove' will hide it completely - * - * Show/remove values use animations. - * - * @since 2.0 - */ - ko.bindingHandlers.threeModeVisibility = { - init: function(element, valueAccessor) { - var displayMode = ko.unwrap(valueAccessor()); - applyDisplayMode(displayMode, $(element), true); - }, - update: function(element, valueAccessor) { - var displayMode = ko.unwrap(valueAccessor()); - applyDisplayMode(displayMode, $(element), false); - } - }; - - - var highlightedBorder = function(element, valueAccessor) { - var isHighlighted = ko.unwrap(valueAccessor()); - if(isHighlighted) { - $(element).addClass('types-highlighted-border').focus(); - } else { - $(element).removeClass('types-highlighted-border'); - } - }; - - /** - * Binding for highlighting a button with selected field type. - * - * @since 2.0 - */ - ko.bindingHandlers.highlightedBorder = { - init: highlightedBorder, - update: highlightedBorder - }; - - - var redButton = function(element, valueAccessor) { - var isRed = ko.unwrap(valueAccessor()); - if(isRed) { - $(element).addClass('types-delete-button'); - } else { - $(element).removeClass('types-delete-button'); - } - }; - - - /** - * Add or remove a class that makes a button red. - * - * @since 2.0 - */ - ko.bindingHandlers.redButton = { - init: redButton, - update: redButton - }; - - var disablePrimary = function(element, valueAccessor) { - var isDisabled = ko.unwrap(valueAccessor()); - if(isDisabled) { - $(element).prop('disabled', true).removeClass('button-primary'); - } else { - $(element).prop('disabled', false).addClass('button-primary'); - } - }; - - /** - * Disable primary button and update its class. - * - * @since 2.0 - */ - ko.bindingHandlers.disablePrimary = { - init: disablePrimary, - update: disablePrimary - }; - - }; - - - /** - * Initialize the dialog handler for displaying standard Toolset dialogs. - * - * @since 2.0 - */ - self.initDialogs = function() { - Types.page.fieldControl.dialogHandler = new function() { - - var self = this; - - self.create = function(dialogId, title, templateContext, buttons, options) { - - var dialogDuplicate = DDLayout.DialogView.extend({}); - - var dialog = new dialogDuplicate(_.defaults(options || {}, { - title: title, - selector: '#' + dialogId, - template_object: templateContext, - buttons: buttons, - width: 600 - })); - - return dialog; - } - - }; - }; - - - /** - * Custom actions after the listing table is rendered. - * - * @since 2.0 - */ - self.afterInit = function() { - - var pageContent = $('#types-page-content'); - - // Show the listing after it's been fully rendered by knockout. - pageContent.find('.types-listing-spinner').hide(); - pageContent.find('.types-listing-wrapper').show(); - - // Focus the search field so that the user can start typing immediately. - pageContent.find('.types-field-search').focus(); - - // Immediately apply the item per page setting without reloading the page. - $('#types_field_control_fields_per_page').change(function() { - self.viewModel.itemsPerPage($(this).val()); - }); - - Types.page.menuLinkAdjuster.addMenuParams({key: 'domain', value: Types.page.fieldControl.currentDomain}); - - }; - - - /** - * Log all arguments to console if debugging is turned on. - * - * @since 2.0 - */ - self.debug = function () { - if (self.isDebug) { - console.log.apply(console, arguments); - } - }; - - - self.log = function() { - console.log.apply(console, arguments); - }; - - - $(document).ready(self.init); - -}; - - -Types.page.fieldControl.main = new Types.page.fieldControl.Class(jQuery); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/style.css b/backend/wordpress/wp-content/plugins/types/public/page/field_control/style.css deleted file mode 100644 index fe57859..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/style.css +++ /dev/null @@ -1,105 +0,0 @@ -/* - Stylesheet for the field control page. - - @since 2.0 -*/ - - -#types-page-content .sort-icon-inactive { - color: #ccc !important; -} - -#types-page-content table.wp-list-table td.manage-column > a.sort-column { - cursor: pointer; -} - -/* - Table row styling -*/ - -#types-page-content .row-actions > span > a { - cursor: pointer; -} - -#types-page-content tbody > tr.types-field-not-managed-by-types { - background-color: #E0EFFF; -} - -#types-page-content tbody > tr.types-field-not-used-in-groups { - background-color: #FFE0E0; -} - - -/* - Spinner image before the page is fully loaded. - - Center horizontally and vertically. -*/ - -#types-page-content .types-listing-spinner { - height: 400px; - position: relative; -} - -#types-page-content .types-listing-spinner > img { - overflow: auto; - margin: auto; - position: absolute; - top: 0; left: 0; bottom: 0; right: 0; -} - - -/* - Dialog styling. -*/ - -.types-delete-button { - background-color: #FF4444 !important; - border-color: #DE2020 !important; - box-shadow: #DE2020 0 1px 0 0 !important; - - text-shadow:0 -1px 1px red, 1px 0 1px red, 0 1px 1px red, -1px 0 1px red !important; -} - - -button.types-highlighted-border { - border: orangered 2px solid !important; -} - -button.types-highlighted-border:active, -button.types-highlighted-border:focus { - outline: none !important; - box-shadow: none !important; -} - -/* We're overriding !important here. */ -.wp-core-ui .types-choose-field-type-button.button:disabled, -.wp-core-ui .types-choose-field-type-button.button[disabled] { - color: #DAE0E6 !important; -} - -.wpcf-choose-field .wpcf-form-button[disabled]:hover i { - color: #DAE0E6; -} - -/* Override styling from basic.css back to default. */ -body.wp-admin button.ui-corner-all { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -/* Fix for disabled non-FontAwesome icons. */ -.wpcf-choose-field .wpcf-form-button[disabled] i.types-field-icon { - opacity: 0.4; - filter: alpha(opacity=40); /* For IE8 and earlier */ -} - - -/* Handle too long dialog titles. */ -.ui-dialog-title { - text-overflow: ellipsis; - white-space: nowrap; - display: block; - overflow: hidden; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/BulkChangeManagementStatusDialogViewModel.js b/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/BulkChangeManagementStatusDialogViewModel.js deleted file mode 100644 index b61aa69..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/BulkChangeManagementStatusDialogViewModel.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Viewmodel of the dialog for bulk manage/stop managing fields with Types - * - * Requires the 'types-bulk-change-management-status-dialog' assets to be present. - * - * Call the display() method to invoke the dialog. - * - * @param {{[Types.page.fieldControl.viewmodels.FieldDefinitionViewModel]}} fieldDefinitions - * @param {boolean} willBeManagedByTypes - * @param {function} closeCallback Function that will be called when the dialog is closed. First argument is - * a boolean determining whether user has accepted the change. - * @since 2.0 - */ -Types.page.fieldControl.viewmodels.BulkChangeManagementStatusDialogViewModel = function(fieldDefinitions, willBeManagedByTypes, closeCallback) { - - var self = this; - - - self.willBeManagedByTypes = ko.observable(willBeManagedByTypes); - - self.fieldDefinitions = ko.observableArray(fieldDefinitions); - - /** - * Display the dialog. - */ - self.display = function() { - - var cleanup = function(dialog) { - jQuery(dialog.$el).ddldialog('close'); - ko.cleanNode(dialog.el); - }; - - - var title = ( - willBeManagedByTypes - ? Types.page.fieldControl.strings.misc['startManagingFieldsWithTypes'] - : Types.page.fieldControl.strings.misc['stopManagingFieldsWithTypes'] - ); - - var dialog = Types.page.fieldControl.dialogHandler.create( - 'types-bulk-change-management-status-dialog', - title, - {}, - [ - { - text: Types.page.fieldControl.strings.button['apply'], - click: function() { - cleanup(dialog); - closeCallback(true); - }, - 'class': 'button-primary' - }, - { - text: Types.page.fieldControl.strings.button['cancel'], - click: function() { - cleanup(dialog); - closeCallback(false); - }, - 'class': 'wpcf-ui-dialog-cancel' - } - ] - ); - - ko.applyBindings(self, dialog.el); - }; - - - return self; -}; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ChangeAssignDialogViewModel.js b/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ChangeAssignDialogViewModel.js deleted file mode 100644 index 98e2a41..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ChangeAssignDialogViewModel.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Viewmodel of the dialog for changing assignment of a field definition to field groups. - * - * Requires the 'types-change-assignment-dialog' assets to be present. - * - * Call the display() method to invoke the dialog. - * - * @param {Types.page.fieldControl.viewmodels.FieldDefinitionViewModel} fieldDefinition - * @param {function} closeCallback Function that will be called when the dialog is closed. First argument is - * a boolean determining whether user has accepted the change. If yes, the second argument is an array of - * newly assigned group slugs. - * - * @returns {Types.page.fieldControl.viewmodels.ChangeAssignDialogViewModel} - * @since 2.0 - */ -Types.page.fieldControl.viewmodels.ChangeAssignDialogViewModel = function(fieldDefinition, closeCallback) { - - var self = this; - - /** - * @type {Types.page.fieldControl.viewmodels.FieldDefinitionViewModel} - */ - self.fieldDefinition = fieldDefinition; - - - /** - * Array of slugs of currently selected groups. - */ - self.selectedGroups = ko.observableArray(_.toArray(self.fieldDefinition.groups())); - - - self.totalGroupCount = Types.page.fieldControl.groups.length; - - - /** - * Returns a ko.pureComputed for an individual group slug that keeps self.selectedGroups up-to-date. - * - * @param {string} groupSlug - */ - self.isGroupChecked = function(groupSlug) { - - return ko.pureComputed({ - read: function() { - return _.contains(self.selectedGroups(), groupSlug); - }, - write: function(value) { - if(value) { - var selectedGroups = self.selectedGroups(); - selectedGroups.push(groupSlug); - self.selectedGroups(_.uniq(selectedGroups)); - } else { - self.selectedGroups(_.without(self.selectedGroups(), groupSlug)); - } - } - }); - }; - - - /** - * Display the dialog. - */ - self.display = function() { - - var cleanup = function(dialog) { - jQuery(dialog.$el).ddldialog('close'); - ko.cleanNode(dialog.el.parentNode); - }; - - var dialog = Types.page.fieldControl.dialogHandler.create( - 'types-change-assignment-dialog', - Types.page.fieldControl.strings.misc['changeAssignmentToGroups'] + ' ' + fieldDefinition.displayName(), - {}, - [ - { - text: Types.page.fieldControl.strings.button['apply'], - click: function() { - cleanup(dialog); - closeCallback(true, self.selectedGroups()); - }, - 'class': 'button-primary', - 'data-bind': 'disablePrimary: (0 == totalGroupCount)' - }, - { - text: Types.page.fieldControl.strings.button['cancel'], - click: function() { - cleanup(dialog); - closeCallback(false); - }, - 'class': 'wpcf-ui-dialog-cancel' - } - ] - ); - - // We need to bind to the parent element, which also includes the area with dialog buttons. - // The reason is that we're binding the Apply button style. - // Note that the cleanup function must reference the same element. - ko.applyBindings(self, dialog.el.parentNode); - - }; - - - return self; -}; diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ChangeFieldTypeDialogViewModel.js b/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ChangeFieldTypeDialogViewModel.js deleted file mode 100644 index 64f4596..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ChangeFieldTypeDialogViewModel.js +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Viewmodel of the dialog for changing type of a single field definition. - * - * Requires the 'types-change-field-type-dialog' assets to be present. - * - * Call the display() method to invoke the dialog. - * - * @param fieldDefinition - * @param {function} closeCallback Function that will be called when the dialog is closed. First argument is - * a boolean determining whether user has accepted the change. If they did, there are more arguments: - * - slug of the new field type - * - * @since 2.0 - */ -Types.page.fieldControl.viewmodels.ChangeFieldTypeDialogViewModel = function(fieldDefinition, closeCallback) { - - var self = this; - - - /** - * Currently selected target field type slug. - */ - self.selectedType = ko.observable(); - - - self.isSelected = function(fieldType) { - return ko.pureComputed({ - read: function() { - return (self.selectedType() == fieldType); - } - }); - }; - - - var typeCanBeRepetitive = function(fieldTypeSlug) { - if(_.has(Types.page.fieldControl.fieldTypeDefinitions, fieldTypeSlug)) { - var fieldType = Types.page.fieldControl.fieldTypeDefinitions[fieldTypeSlug]; - return (_.has(fieldType, 'canBeRepetitive') ? fieldType['canBeRepetitive'] : false); - } - return false; - }; - - - self.reducingCardinality = ko.pureComputed(function() { - return (fieldDefinition.isRepetitive() && 'single' == self.targetCardinality()); - }); - - - /** - * Determine if the field definition can be converted into a given type. - * - * Respects the conversion matrix as well as field cardinality. - * - * @param {string} fieldType Field type slug. - * @returns {boolean} - * @since 2.0 - */ - self.canConvertTo = function(fieldType) { - if(! _.has(Types.page.fieldControl.typeConversionMatrix, fieldDefinition.type())) { - return false; - } - var possibleConversions = Types.page.fieldControl.typeConversionMatrix[fieldDefinition.type()]; - if(! _.contains(possibleConversions, fieldType)) { - return false; - } - return !(fieldDefinition.isRepetitive() && !typeCanBeRepetitive(fieldType)); - }; - - - self.targetTypeCanBeRepetitive = ko.pureComputed(function() { - return typeCanBeRepetitive(self.selectedType()); - }); - - - self.targetCardinality = ko.observable(fieldDefinition.isRepetitive() ? 'repetitive' : 'single'); - - self.targetTypeCanBeRepetitive.subscribe(function(newValue) { - if(false == newValue) { - self.targetCardinality('single'); - } - }); - - - - /** - * Display the dialog. - */ - self.display = function() { - - var cleanup = function(dialog) { - jQuery(dialog.$el).ddldialog('close'); - ko.cleanNode(dialog.el.parentNode); - }; - - var dialog = Types.page.fieldControl.dialogHandler.create( - 'types-change-field-type-dialog', - Types.page.fieldControl.strings.misc['changeFieldType'] + ' ' + fieldDefinition.displayName(), - {}, - [ - { - text: Types.page.fieldControl.strings.button['apply'], - click: function() { - cleanup(dialog); - closeCallback(true, self.selectedType(), self.targetCardinality()); - }, - 'class': 'button-primary', - 'data-bind': 'redButton: reducingCardinality' - }, - { - text: Types.page.fieldControl.strings.button['cancel'], - click: function() { - cleanup(dialog); - closeCallback(false); - }, - 'class': 'wpcf-ui-dialog-cancel' - } - ], - { - width: 800 - } - ); - - // We need to bind to the parent element, which also includes the area with dialog buttons. - // The reason is that we're binding the Apply button style. - // Note that the cleanup function must reference the same element. - ko.applyBindings(self, dialog.el.parentNode); - - self.selectedType(fieldDefinition.type()); - }; - - - return self; -}; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/DeleteDialogViewModel.js b/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/DeleteDialogViewModel.js deleted file mode 100644 index 69e4046..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/DeleteDialogViewModel.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Viewmodel of the dialog for deleting a single field definition. - * - * Requires the 'types-delete-field-dialog' assets to be present. - * - * Call the display() method to invoke the dialog. - * - * @param {function} closeCallback Function that will be called when the dialog is closed. First argument is - * a boolean determining whether user has accepted the change. - * @since 2.0 - */ -Types.page.fieldControl.viewmodels.DeleteDialogViewModel = function(subject, closeCallback) { - - var self = this; - - /** - * Display the dialog. - */ - self.display = function() { - - var cleanup = function(dialog) { - jQuery(dialog.$el).ddldialog('close'); - ko.cleanNode(dialog.el); - }; - - var isSingleFieldAction = !_.isArray(subject); - - var title = ( - isSingleFieldAction - ? Types.page.fieldControl.strings.misc['deleteField'] + ' ' + subject.displayName() - : Types.page.fieldControl.strings.misc['deleteFields'] - ); - - var dialog = Types.page.fieldControl.dialogHandler.create( - 'types-delete-field-dialog', - title, - {}, - [ - { - text: Types.page.fieldControl.strings.button['delete'], - click: function() { - cleanup(dialog); - closeCallback(true); - }, - 'class': 'button-primary types-delete-button' - }, - { - text: Types.page.fieldControl.strings.button['cancel'], - click: function() { - cleanup(dialog); - closeCallback(false); - }, - 'class': 'wpcf-ui-dialog-cancel' - } - ] - ); - - ko.applyBindings(self, dialog.el); - }; - - - return self; -}; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/FieldDefinitionViewModel.js b/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/FieldDefinitionViewModel.js deleted file mode 100644 index 699fc0d..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/FieldDefinitionViewModel.js +++ /dev/null @@ -1,329 +0,0 @@ -/** - * ViewModel of a single field definition. - * - * @param {{isUnderTypesControl:bool,isRepetitive:bool,groups:string[],type:string,displayName:string,slug:string,metaKey:string}} model - * Field definition model. - * @param fieldActions An object with methods to perform actions on field definitions. - * - * @since 2.0 - */ -Types.page.fieldControl.viewmodels.FieldDefinitionViewModel = function(model, fieldActions) { - - - var self = this; - - - /** Reusable strings. */ - self.labels = { - notManagedByTypes: '' + Types.page.fieldControl.strings.misc['notManagedByTypes'] + '' - }; - - - self.fieldActions = fieldActions; - - - // ------------------------------------------------------------------------ - // Model properties - // ------------------------------------------------------------------------ - - self.isUnderTypesControl = ko.observable(model.isUnderTypesControl); - - self.isRepetitive = ko.observable(model.isRepetitive); - - self.groups = ko.observableArray(model.groups); - - self.type = ko.observable(model.type); - - self.displayName = ko.observable(model.displayName); - - self.slug = ko.observable(model.slug); - - self.metaKey = ko.observable(model.metaKey); - - - /** - * @returns {{isUnderTypesControl:bool,isRepetitive:bool,groups:string[],type:string,displayName:string, - * slug:string,metaKey:string}} Updated object with the same properties as the original model. - * @since 2.0 - */ - self.getModelObject = function() { - var ownModelProperties = _.keys(model); - var modelObject = {}; - - _.each(ownModelProperties, function(propertyName) { - if(_.has(self, propertyName)) { - if(_.isFunction(self[propertyName])) { - modelObject[propertyName] = self[propertyName](); - } else { - modelObject[propertyName] = self[propertyName]; - } - } - }); - - return modelObject; - }; - - - /** - * Update this ViewModel's properties by properties from a model object. - * - * If there is a property on the model that isn't on the viewmodel, or if such property isn't a function - * (which is expected to be a knockout observable), it will be created. - * - * If there is the property and is a function, it will be called with the new value as a first parameter. - * - * @param updatedModel Model object with updated values. - * @since 2.0 - */ - self.updateModelObject = function(updatedModel) { - var ownModelProperties = _.keys(updatedModel); - - _.each(ownModelProperties, function(propertyName) { - if (!_.has(self, propertyName) && !_.isFunction(self[propertyName])) { - self[propertyName] = ko.observable(); - } - self[propertyName](updatedModel[propertyName]); - }); - }; - - - // ------------------------------------------------------------------------ - // Computed properties for display purposes - // ------------------------------------------------------------------------ - - - self.display = { - - groupList: ko.pureComputed(function () { - if (!self.isUnderTypesControl()) { - return self.labels.notManagedByTypes; - } else { - var groupNameList = _.map(self.groups(), function (groupSlug) { - if (_.has(Types.page.fieldControl.groups, groupSlug)) { - return Types.page.fieldControl.groups[groupSlug].displayName; - } else { - return groupSlug; - } - }); - return groupNameList.join(', '); - } - }), - - type: ko.pureComputed(function() { - - if(!self.isUnderTypesControl()) { - return self.labels.notManagedByTypes; - } else if(_.has(Types.page.fieldControl.fieldTypeDefinitions, self.type())) { - return Types.page.fieldControl.fieldTypeDefinitions[self.type()].displayName; - } else { - return '' + self.type() + ''; - } - - }), - - changeManagementStatusActionLabel: ko.pureComputed(function() { - //noinspection JSUnresolvedVariable - return Types.page.fieldControl.strings.rowAction.manageByTypes[ self.isUnderTypesControl() ? 'no' : 'yes' ]; - }), - - - changeCardinalityActionLabel: ko.pureComputed(function() { - //noinspection JSUnresolvedVariable - return Types.page.fieldControl.strings.rowAction.changeCardinality[ self.isRepetitive() ? 'makeSingle' : 'makeRepetitive' ]; - }) - - }; - - - /** - * Determine CSS class for the tr tag depending on field status. - * - * @since 2.0 - */ - self.trClass = ko.computed(function() { - if(!self.isUnderTypesControl()) { - return 'types-field-not-managed-by-types'; - } else if(0 == self.groups().length) { - return 'types-field-not-used-in-groups'; - } else { - return ''; - } - }); - - - - self.canChangeCardinality = ko.pureComputed(function() { - if(!self.isUnderTypesControl()) { - // we can't manage this field - return false; - } else if(self.isRepetitive()) { - // allways allow for switching from repetitive to single - return true; - } else if(_.has(Types.page.fieldControl.strings.fieldTypeDefinitions, self.type())) { - // for single fields, depends on type definition - //noinspection JSUnresolvedVariable - return Types.page.fieldControl.strings.fieldTypeDefinitions[self.type()].canBeRepetitive || false; - } else { - // disable for safety if the type is unknown - return false; - } - }); - - - self.typeForSorting = ko.pureComputed(function() { - if(self.isUnderTypesControl()) { - return self.display.type(); - } else { - return ''; - } - }); - - - self.isSelectedForBulkAction = ko.observable(false); - - - /** - * This will be updated by the main ViewModel. - * - * @since 2.0 - */ - self.isBeingDisplayed = ko.observable(false); - - - /** - * When the field definition is not displayed in the table, we don't want it to be selected for a bulk action. - * - * @since 2.0 - */ - self.isBeingDisplayed.subscribe(function(newValue) { - if(false == newValue) { - self.isSelectedForBulkAction(false); - } - }); - - - - // ------------------------------------------------------------------------ - // Event handlers - // ------------------------------------------------------------------------ - - - self.onChangeAssignmentAction = function() { - Types.page.fieldControl.viewmodels.ChangeAssignDialogViewModel(self, function(isAccepted, updatedGroups) { - if(isAccepted) { - self.fieldActions.changeGroupAssignment(self, {group_slugs: updatedGroups}); - } - }).display(); - }; - - - self.onChangeTypeAction = function() { - - Types.page.fieldControl.viewmodels.ChangeFieldTypeDialogViewModel(self, function(isAccepted, typeToConvertInto, newCardinality) { - - if(!isAccepted) { - // Action cancelled. - return; - } - - // Depending on user's changes, we may do two AJAX calls, or one, or none. - var isTypeChangeNeeded = (self.type() != typeToConvertInto); - var isCardinalityChangeNeeded = (self.isRepetitive() != ('single' != newCardinality)); - - var finalSuccessCallback = function(response, data, fieldDefinitions) { - self.fieldActions.updateFieldDefinitionModels(data.results, fieldDefinitions); - }; - - var failCallback = function(response) { }; - - var doCardinalityChange = _.partial(self.fieldActions.changeFieldCardinality, self, {target_cardinality: newCardinality}); - - if(isTypeChangeNeeded) { - if(isCardinalityChangeNeeded) { - - // The most complex scenario. Change the field type, and if the action is a success, continue with changing - // it's cardinality. - self.fieldActions.changeFieldType( - self, - function(response, data, fieldDefinitions) { - // onSuccess - self.fieldActions.updateFieldDefinitionModels(data.results, fieldDefinitions); - doCardinalityChange(); - }, - failCallback, - {field_type: typeToConvertInto} - ); - } else { - - // Only change field type. - self.fieldActions.changeFieldType(self, finalSuccessCallback, failCallback, {field_type: typeToConvertInto}); - } - } else { - if(isCardinalityChangeNeeded) { - - // Only change the cardinality - doCardinalityChange(); - - } else { - // Nothing to do at all. - } - } - - }).display(); - }; - - - self.onChangeManagementStatusAction = function() { - if(self.isUnderTypesControl()) { - self.fieldActions.stopManagingWithTypes(self); - } else { - self.fieldActions.manageWithTypes(self); - } - }; - - - self.onDeleteAction = function() { - Types.page.fieldControl.viewmodels.DeleteDialogViewModel(self, function(isAccepted) { - if(isAccepted) { - self.fieldActions.deleteFields(self); - } - }).display(); - }; - - - - /** - * Number of AJAX actions currently in progress. - * - * Do not touch it directly, use beginAction() and finishAction() instead. - */ - self.inProgressActionCount = ko.observable(0); - - - /** - * Show a spinner if there is at least one AJAX action in progress. - */ - self.isSpinnerVisible = ko.pureComputed(function() { - return (self.inProgressActionCount() > 0); - }); - - - /** - * Indicate a beginning of an AJAX action. - * - * Make sure you also call finishAction() afterwards, no matter what the result is. - */ - self.beginAction = function() { - self.inProgressActionCount(self.inProgressActionCount() + 1); - }; - - - /** - * Indicate that an AJAX action was completed. - */ - self.finishAction = function() { - self.inProgressActionCount(self.inProgressActionCount() - 1); - }; - -}; - diff --git a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ListingViewModel.js b/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ListingViewModel.js deleted file mode 100644 index c97d00b..0000000 --- a/backend/wordpress/wp-content/plugins/types/public/page/field_control/viewmodels/ListingViewModel.js +++ /dev/null @@ -1,778 +0,0 @@ -/** - * Main ViewModel of the page. - * - * Holds the collection of field definition ViewModels, handles their sorting and filtering (search). - * - * @param fieldDefinitionModels - * @constructor - */ -Types.page.fieldControl.viewmodels.ListingViewModel = function(fieldDefinitionModels) { - - var self = this; - - - self.isInitialized = false; - - - self.fieldDefinitions = ko.observableArray(); - - - // ------------------------------------------------------------------------ - // Sorting functionality - // ------------------------------------------------------------------------ - - - - self.onSort = function(propertyName) { - var newDirection = ( - sortHelper.currentSortBy() == propertyName - ? sortHelper.currentSortDirection() * -1 - : sortHelper.currentSortDirection() - ); - sortHelper.sortFieldDefinitions(propertyName, newDirection); - }; - - - /** - * Determine a current class for an column sorting indicator icon based on property name. - * - * @param {string} propertyName Name of property that the column uses for sorting. - * @returns {string} One or more CSS classes. - * @since 2.0 - */ - self.sortIconClass = function(propertyName) { - if(sortHelper.currentSortBy() == propertyName) { - if(1 == sortHelper.currentSortDirection()) { - return 'fa fa-sort-alpha-asc'; - } else { - return 'fa fa-sort-alpha-desc'; - } - } else { - return 'fa sort-icon-inactive fa-sort-alpha-asc'; - } - }; - - - /** - * Helper object that encapsulates the functionality related to sorting. - * - * @since 2.0 - */ - var sortHelper = new function() { - - var helper = this; - - /** - * Compare two models by current sort settings of the collection. - * - * Handle empty values as ones with the highest value (they will be at the end on ascending order). - * - * @param itemA - * @param itemB - * @returns {number} -1|0|1 - * @since 2.0 - */ - var comparator = function(itemA, itemB) { - - var a = itemA[helper.currentSortBy()]() || '', b = itemB[helper.currentSortBy()]() || ''; - var result = 0; - - a = a.toLowerCase(); - b = b.toLowerCase(); - - if(0 == a.length && 0 == b.length) { - result = 0; - } else if(0 == a.length) { - result = 1; - } else if(0 == b.length) { - result = -1; - } else { - result = (a == b ? 0 : (a > b ? 1 : -1)); - } - - return (result * helper.currentSortDirection()); - }; - - - /** Sort direction, 1 for ascending and -1 for descending. */ - helper.currentSortDirection = ko.observable(1); - - /** Property name. */ - helper.currentSortBy = ko.observable('displayName'); - - helper.changeSortStrategy = function(propertyName, direction) { - - if('asc' == direction) { - direction = 1; - } else if('desc' == direction) { - direction = -1; - } else if(typeof(direction) == 'undefined') { - direction = helper.currentSortDirection(); - } - - helper.currentSortDirection(direction); - helper.currentSortBy(propertyName); - - }; - - - /** - * Completely handle field definition sorting. - * - * Performs the sorting only when initialization is actually finished to avoid resource wasting. - * - * @param {string} propertyName Name of the field definition property to sort by. The property must be an - * function that returns a string when called without a parameter (for example, a ko.observable). - * @param {int|string} direction 1|-1|'asc'|'desc' - * @since 2.0 - */ - helper.sortFieldDefinitions = function(propertyName, direction) { - helper.changeSortStrategy(propertyName, direction); - - if(self.isInitialized) { - self.fieldDefinitions.sort(comparator); - } - }; - - }; - - - - // ------------------------------------------------------------------------ - // Searching and pagination functionality - // ------------------------------------------------------------------------ - - - self.searchString = ko.observable(''); - - - self.currentPage = ko.observable(1); - - - self.itemsPerPage = ko.observable(Types.page.fieldControl.itemsPerPage); - - - self.totalPages = ko.pureComputed(function(){ - return Math.max(Math.ceil(self.itemCount() / self.itemsPerPage()), 1); - }); - - - /** - * Total count of items that can be displayed now (after filtering). - */ - self.itemCount = ko.pureComputed(function() { - return self.fieldDefinitionsFilteredBySearch().length; - }); - - - self.isFirstPage = ko.pureComputed(function() { return ( 1 == self.currentPage() ); }); - - self.isLastPage = ko.pureComputed(function() { return (self.totalPages() == self.currentPage()); }); - - - self.fieldDefinitionsFilteredBySearch = ko.pureComputed(function() { - var searchString = self.searchString(); - if(_.isEmpty(searchString)) { - - _.each(self.fieldDefinitions(), function(fieldDefinition) { - fieldDefinition.isBeingDisplayed(true); - }); - - return self.fieldDefinitions(); - - } else { - return _.filter(self.fieldDefinitions(), function(fieldDefinition) { - - var isMatch = _.some([fieldDefinition.slug(), fieldDefinition.displayName()], function(value) { - return (typeof(value) != 'undefined' && value.toLowerCase().indexOf(searchString) > -1); - }); - - fieldDefinition.isBeingDisplayed(isMatch); - return isMatch; - }); - } - }); - - - /** - * Safely get/set new current page number. - * - * @since 2.0 - */ - self.currentPageSafe = ko.computed({ - read: function() { return self.currentPage(); }, - write: function(page) { - if(page < 1) { - self.currentPage(1); - } else if(page > self.totalPages()) { - self.currentPage(self.totalPages()); - } else { - self.currentPage(page); - } - } - }); - - - /** - * Safely change current page. - * - * @param {string} page first|previous|next|last - * @since 2.0 - */ - self.gotoPage = function(page) { - switch(page) { - case 'first': - self.currentPageSafe(1); - break; - case 'previous': - self.currentPageSafe(self.currentPage() - 1); - break; - case 'next': - self.currentPageSafe(self.currentPage() + 1); - break; - case 'last': - self.currentPageSafe(self.totalPages()); - break; - } - }; - - - /** - * The array of actually visible field definitions, after searching and pagination. - * - * @since 2.0 - */ - self.fieldDefinitionsToShow = ko.pureComputed(function() { - return _.first(_.rest(self.fieldDefinitionsFilteredBySearch(), self.itemsPerPage() * (self.currentPage()-1)), self.itemsPerPage()); - }); - - - // ------------------------------------------------------------------------ - // Field actions - // ------------------------------------------------------------------------ - - - /** - * Currently displayed message. - * - * Text can contain HTML code. Type can be 'info' or 'error' for different message styles. - */ - self.displayedMessage = ko.observable({text: '', type: 'info'}); - - - /** - * Determine how the message is being displayed at the moment. - * - * Allowed values are those of the threeModeVisibility knockout binding. - * - * @since 2.0 - */ - self.messageVisibilityMode = ko.observable('remove'); - - - /** - * Display a message. - * - * Overwrites previous message if there was one displayed. - * - * @param {string} text Message content. - * @param {string} type 'info'|'error' - */ - self.displayMessage = function(text, type) { - self.hideDisplayedMessage(); - self.displayedMessage({text: text, type: type}); - self.messageVisibilityMode('show'); - }; - - - /** - * Hide the message if it is displayed, but leave free space instead of it. - * - * If the message was completely hidden before, do nothing. - */ - self.hideDisplayedMessage = function() { - if('show' == self.messageVisibilityMode()) { - self.messageVisibilityMode('hide'); - } - // Adjust message height to one line. - self.displayedMessage({text: 'A', type: 'info'}); - }; - - - /** - * Hide the message completely. - */ - self.removeDisplayedMessage = function() { - self.messageVisibilityMode('remove'); - }; - - - /** - * Determine CSS class for the message, based on it's type. - */ - self.messageNagClass = ko.pureComputed(function() { - switch(self.displayedMessage().type) { - case 'error': - return 'error'; - case 'info': - default: - return 'updated'; - } - }); - - - /** - * Number of AJAX actions currently in progress. - * - * Do not touch it directly, use beginAction() and finishAction() instead. - */ - self.inProgressActionCount = ko.observable(0); - - - /** - * Show a spinner if there is at least one AJAX action in progress. - */ - self.isSpinnerVisible = ko.pureComputed(function() { - return (self.inProgressActionCount() > 0); - }); - - - /** - * Indicate a beginning of an AJAX action. - * - * Make sure you also call finishAction() afterwards, no matter what the result is. - */ - self.beginAction = function(fieldDefinitions) { - self.inProgressActionCount(self.inProgressActionCount() + 1); - _.each(fieldDefinitions, function(fieldDefinition) { - fieldDefinition.beginAction(); - }); - }; - - - /** - * Indicate that an AJAX action was completed. - */ - self.finishAction = function(fieldDefinitions) { - self.inProgressActionCount(self.inProgressActionCount() - 1); - _.each(fieldDefinitions, function(fieldDefinition) { - fieldDefinition.finishAction(); - }); - }; - - - /** - * Run an action on one or more field definitions. - * - * Handles all GUI updates as well as the underlying AJAX call. - * - * @param {string} fieldAction Name of the action to be performed on a field (see - * Types_Ajax::callback_field_control_action() for details). - * @param {[object]} fieldDefinitions One or more field definitions this action applies to. - * @param {object|undefined} [data] Custom action-specific data. - * @param {function|undefined} [successCallback] Callback function that will be called on success. It will get - * two parameters, the full AJAX response and the "data" part for convenience. - * @param {function|undefined} [failCallback] Callback function that will be called on failuer. Same params as above. - * @since 2.0 - */ - self.doFieldAction = function(fieldAction, fieldDefinitions, data, successCallback, failCallback) { - - self.beginAction(fieldDefinitions); - self.hideDisplayedMessage(); - - //noinspection JSUnresolvedVariable - var nonce = Types.page.fieldControl.ajaxInfo.fieldAction.nonce; - - var callback = function(messageType, genericMessageString, callback, response, data) { - - var messageText = data.message || genericMessageString; - - // If we have an array of messages, ue that instead. - if(_.has(data, 'messages') && _.isArray(data.messages)) { - var messages = _.without(data.messages, ''); - if(0 == messages.length) { - // keep the default text - } else if(1 == messages.length) { - messageText = (messages[0]); - } else { - // This will display a simple list of messages. - messageText = Types.page.fieldControl.templates.renderUnderscore('messageMultiple', { - messages: messages - }); - } - } - - self.displayMessage(messageText, messageType); - - if(_.isFunction(callback)) { - callback(response, data); - } - - self.finishAction(fieldDefinitions); - }; - - //noinspection JSUnresolvedVariable - Types.page.fieldControl.doAjax( - fieldAction, - nonce, - self.getFieldDefinitionModels(fieldDefinitions), - data || {}, - _.partial(callback, 'info', Types.page.fieldControl.strings.misc.genericSuccess || '', successCallback), - _.partial(callback, 'error', Types.page.fieldControl.strings.misc.undefinedAjaxError || 'undefined error', failCallback) - ); - - }; - - - /** - * Obtain up-to-date models from given field definitions. - * - * @param {{[Types.page.fieldControl.viewmodels.FieldDefinitionViewModel]}} fieldDefinitions - * @returns {{[object]}} Models with the same properties as the original model had. - * @since 2.0 - */ - self.getFieldDefinitionModels = function(fieldDefinitions) { - return _.map(fieldDefinitions, function(fieldDefinition) { return fieldDefinition.getModelObject(); }); - }; - - - /** - * Update field definition viewmodels by new models. - * - * If a model's slug matches field definition, it will be updated. - * - * @param fieldModels - * @param sourceDefinitions - * @since 2.0 - */ - self.updateFieldDefinitionModels = function(fieldModels, sourceDefinitions) { - - _.each(fieldModels, function(fieldModel) { - - if(_.has(fieldModel, 'slug')) { - - // Find the definition by it's slug - var fieldDefinition = _.find(sourceDefinitions, function (fieldDefinition) { - // Comparing also by metaKey because the slug can change under some circumstances. - return (fieldDefinition.slug() == fieldModel.slug || fieldDefinition.metaKey() == fieldModel.metaKey); - }); - - if(typeof(fieldDefinition) != 'undefined') { - fieldDefinition.updateModelObject(fieldModel); - } else { - // todo report error - } - - } else { - // todo report error - } - - }); - - }; - - - /** - * Handle user's input on a field action in a generic way. - * - * Works for both bulk and single actions. - * - * @param {[object]|object} fieldDefinitions One or more selected field definitions. - * @param {function|null} conflictFilter Function that for a given field definition returns true if the action - * cannot be applied on it. - * @param {string} conflictStringName Name of the string in Types.page.fieldControl.strings.misc that will be used - * for the message about conflicting field definitions. - * @param {string} fieldActionName Name of the field action to be passed through AJAX. - * @param {function} onSuccess Callback on action success. It will recieve the complete response, response data and - * the array of original field definitions (allways an array) as parameters. - * @param onFailure Callback to be used when there is an error of some kind. Same as onSuccess with only two parameters. - * @param {object|undefined} actionData Custom action data that will be passed through the AJAX call. - * @since 2.0 - */ - self.handleFieldActionInput = function(fieldDefinitions, conflictFilter, conflictStringName, fieldActionName, onSuccess, onFailure, actionData) { - - if(!_.isArray(fieldDefinitions)) { - fieldDefinitions = [fieldDefinitions]; - } - - if(0 == fieldDefinitions.length) { - // No message is needed because the bulk action mechanism should never allow this. - console.log('no fields selected'); - return; - } - - if(_.isFunction(conflictFilter)) { - var conflictingDefinitions = _.filter(fieldDefinitions, conflictFilter); - - if(0 < conflictingDefinitions.length) { - - var messageText = Types.page.fieldControl.strings.misc[conflictStringName] + ' ' - + Types.page.fieldControl.strings.misc['unselectAndRetry']; - - self.displayMessage( - Types.page.fieldControl.templates.renderUnderscore('messageDefinitionList', { - message: messageText, - fieldDefinitions: conflictingDefinitions - }), - 'error' - ); - return; - } - } - - self.doFieldAction(fieldActionName, fieldDefinitions, actionData || {}, _.partial(onSuccess, _, _, fieldDefinitions), onFailure); - - }; - - - /** - * An object with methods to perform actions on field definitions. - * - * Each action accepts an array of field definitions, or a single field definition, as first parameter. - * - * @type {{manageWithTypes: function, stopManagingWithTypes: function}} - * @since 2.0 - */ - self.fieldActions = { - - manageWithTypes: _.partial( - self.handleFieldActionInput, - _, - function(fieldDefinition) { - // conflict filter - return fieldDefinition.isUnderTypesControl(); - }, - 'fieldsAlreadyManaged', - 'manage_with_types', - function(response, data, fieldDefinitions) { - // onSuccess - self.updateFieldDefinitionModels(data.results, fieldDefinitions); - }, - function(response) { - // onFailure - console.log("fail", response); - // todo report error - } - ), - - - stopManagingWithTypes: _.partial( - self.handleFieldActionInput, - _, - function(fieldDefinition) { - // conflict filter - return !fieldDefinition.isUnderTypesControl(); - }, - 'fieldsAlreadyUnmanaged', - 'stop_managing_with_types', - function(response, data, fieldDefinitions) { - // onSuccess - self.updateFieldDefinitionModels(data.results, fieldDefinitions); - }, - function(response) { - // onFailure - console.log("fail", response); - // todo report error - } - ), - - - changeGroupAssignment: _.partial( - self.handleFieldActionInput, - _, - // no conflict filter because there is no bulk action for this - null, - null, - 'change_group_assignment', - function(response, data, fieldDefinitions) { - // onSuccess - self.updateFieldDefinitionModels(data.results, fieldDefinitions); - }, - function(response) { - // onFailure - } - ), - - - deleteFields: _.partial( - self.handleFieldActionInput, - _, - function(fieldDefinition) { - // conflict filter - return !fieldDefinition.isUnderTypesControl(); - }, - 'cannotDeleteUnmanagedFields', - 'delete_field', - function(response, data, fieldDefinitions) { - // onSuccess - self.fieldDefinitions.removeAll(fieldDefinitions); - }, - function(response) { - // onFailure - } - ), - - - changeFieldType: _.partial( - self.handleFieldActionInput, - _, - // no conflict filter needed - null, - null, - 'change_field_type', - _, - _ - ), - - - changeFieldCardinality: _.partial( - self.handleFieldActionInput, - _, - // no conflict filter needed - null, - null, - 'change_field_cardinality', - function(response, data, fieldDefinitions) { - // onSuccess - self.updateFieldDefinitionModels(data.results, fieldDefinitions); - }, - function(response) { - // onFailure - } - ), - - // For referencing form outside the ListingViewModel. - updateFieldDefinitionModels: self.updateFieldDefinitionModels - }; - - - // ------------------------------------------------------------------------ - // Bulk actions - // ------------------------------------------------------------------------ - - - //noinspection JSUnresolvedVariable - /** - * Array of objects describing available bulk actions. - * - * It will be used by knockout to populate the select input field dynamically. - * - * @returns {[{value:string,displayName:string,handler:function|undefined}]} - * @since 2.0 - */ - self.bulkActions = ko.observableArray([ - { - value: '-1', - displayName: Types.page.fieldControl.strings.bulkAction.select - }, - { - value: 'delete', - displayName: Types.page.fieldControl.strings.bulkAction.delete, - handler: function(fieldDefinitions) { - Types.page.fieldControl.viewmodels.DeleteDialogViewModel(fieldDefinitions, function(isAccepted) { - if(isAccepted) { - self.fieldActions.deleteFields(fieldDefinitions); - } - }).display(); - } - }, - { - value: 'manageWithTypes', - displayName: Types.page.fieldControl.strings.bulkAction.manageWithTypes, - handler: function(fieldDefinitions) { - Types.page.fieldControl.viewmodels.BulkChangeManagementStatusDialogViewModel(fieldDefinitions, true, function(isAccepted) { - if(isAccepted) { - self.fieldActions.manageWithTypes(fieldDefinitions); - } - }).display(); - } - }, - { - value: 'stopManagingWithTypes', - displayName: Types.page.fieldControl.strings.bulkAction.stopManagingWithTypes, - handler: function(fieldDefinitions) { - Types.page.fieldControl.viewmodels.BulkChangeManagementStatusDialogViewModel(fieldDefinitions, false, function(isAccepted) { - if(isAccepted) { - self.fieldActions.stopManagingWithTypes(fieldDefinitions); - } - }).display(); - } - } - ]); - - - self.selectedFieldDefinitions = ko.pureComputed(function() { - return _.filter(self.fieldDefinitionsToShow(), function(fieldDefinition) { - return fieldDefinition.isSelectedForBulkAction(); - }); - }); - - - self.selectedBulkAction = ko.observable('-1'); - - - self.isBulkActionAllowed = ko.pureComputed(function() { - return ('-1' != self.selectedBulkAction() && self.selectedFieldDefinitions().length > 0); - }); - - - /** - * Find the selected bulk action by it's value and execute it's handler if possible. - * - * @since 2.0 - */ - self.onBulkAction = function() { - var action = _.findWhere(self.bulkActions(), {value: self.selectedBulkAction()}); - if(typeof(action) != 'undefined' && _.has(action, 'handler') && _.isFunction(action.handler)) { - action.handler(self.selectedFieldDefinitions()); - } - }; - - - /** - * True if all visible rows are selected for a bulk action, false otherwise. - * When written to, the value will influence all visible rows. - * - * @since 2.0 - */ - self.allVisibleFieldDefinitionSelection = ko.computed({ - read: function() { - if(0 == self.fieldDefinitionsToShow().length) { - return false; - } - return _.every(self.fieldDefinitionsToShow(), function(fieldDefinition) { - return fieldDefinition.isSelectedForBulkAction(); - }); - }, - write: function(value) { - _.each(self.fieldDefinitionsToShow(), function(fieldDefinition) { - fieldDefinition.isSelectedForBulkAction(value); - }) - } - }); - - - // ------------------------------------------------------------------------ - // Initialization - // ------------------------------------------------------------------------ - - - var init = function() { - - // Fill field definition with data from PHP - self.fieldDefinitions(_.map(fieldDefinitionModels, function(definitionModel) { - return new Types.page.fieldControl.viewmodels.FieldDefinitionViewModel(definitionModel, self.fieldActions); - })); - - ko.applyBindings(self); - - self.currentPage(1); - - // Now we can finally sort - self.isInitialized = true; - sortHelper.sortFieldDefinitions('displayName', 'asc'); - }; - - - init(); -}; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/readme.txt b/backend/wordpress/wp-content/plugins/types/readme.txt deleted file mode 100644 index 1d2ec36..0000000 --- a/backend/wordpress/wp-content/plugins/types/readme.txt +++ /dev/null @@ -1,1123 +0,0 @@ -=== Toolset Types - Custom Post Types, Custom Fields and Taxonomies === -Contributors: AmirHelzer, brucepearson, christianglingener, jadpm, zaantar, jmilczarek, kouratoras, displaynone -Donate link: http://toolset.com -Tags: CMS, custom field, custom fields, custom post type, custom post types, field, fields post, post type, post types, taxonomies, taxonomy, toolset -Text Domain: wpcf -Domain Path: /embedded/locale -License: GPLv2 -Requires at least: 3.7 -Requires PHP: 5.3 -Tested up to: 4.9 -Stable tag: 2.3.2 - -The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields. - -== Description == - -**Toolset Types let’s you add custom post types, custom fields and custom taxonomies to the WordPress admin. A convenient dashboard lets you control everything from one place.** - -[youtube https://www.youtube.com/watch?v=Akzybh3uyXA] - -= TYPES 3.0 AVAILABLE = -We have [released Types 3.0](https://toolset.com/2018/05/toolset-post-relationships-release/) with completely rewritten post relationships (many-to-many post relationships, repeatable field groups and much more). - -However, Types since version 3.0 is a [part of the complete Toolset package](https://toolset.com/2017/11/types-plugin-is-moving-to-be-a-part-of-the-complete-toolset-package/) and it is available only with a [Toolset account](https://toolset.com). - -We will keep supporting the free version of Types with security and compatibility updates and bug fixes through 2018. - -= COMPLETE DOCUMENTATION, POWERFUL API, SIMPLE GUI FOR NON-CODERS = -If you're an experienced PHP developer, you'll appreciate Types comprehensive [fields API](https://toolset.com/documentation/customizing-sites-using-php/functions/). - -You will find detailed guides on [adding custom post types, fields and taxonomy to the front-end](https://toolset.com/documentation/customizing-sites-using-php/), including: - -* [Creating templates for single custom posts](https://toolset.com/documentation/customizing-sites-using-php/creating-templates-single-custom-posts/) -* [Creating templates for custom post type archives](https://toolset.com/documentation/customizing-sites-using-php/creating-templates-custom-post-type-archives/) -* [Creating custom user profiles](https://toolset.com/documentation/customizing-sites-using-php/creating-custom-user-profiles/) -* [Create taxonomy term archives](https://toolset.com/documentation/customizing-sites-using-php/creating-taxonomy-term-archives/) - -and [more](https://toolset.com/documentation/customizing-sites-using-php/). - -**Too much technical stuff to learn?** The full [Toolset](https://toolset.com) package lets you build complete WordPress sites from within the admin dashboard. - -= CUSTOM FIELDS FOR CONTENT, TAXONOMY TERMS AND USERS = -Types lets you add custom fields for posts (meaning, WordPress posts, pages and custom content types), taxonomy terms and users. You can add any field types to different user profiles. - -= ACCESS CONTROL FOR FIELDS = -Using [Access](https://toolset.com/home/toolset-components/#access), you will be able to control what fields different users can edit and view. This way, you can make some field groups read-only for certain users, and fully-editable for other users. - -For example, when you build a membership site, the site admin will be able to change membership levels for everyone and users will see their membership fields as read-only. - -= RELIABLE SUPPORT = -To get support for Types, please join our [technical support forum](https://toolset.com/forums/). You will receive support directly from our developers, helping you deliver great sites on time and correctly. - -= CUSTOM FIELDS = - -Types includes support for a wide list of custom fields. - -* **Single-line text** -* **Multi-line text** -* **WYSIWYG** (WordPress Visual Editor) -* **Checkbox** -* **Multi-value Checkboxes** -* **Radio group** -* **Drop-down Select** -* **File upload** -* **Image** (Types includes a robust image-resize and caching engine) -* **Date** (includes a JS date-picker) -* **Email** -* **Number** -* **Phone** -* **Skype** -* **URL** -* **Audio** -* **Video** -* **Embedded media** -* **Colorpicker** -* **Post reference** (using Types Parent / Child relationships management) - -Types custom fields use the standard WordPress post-meta table, making it cross-compatible with any theme or plugin. Additionally, all fields can be **repeating fields**. - -= CUSTOM POST TYPES AND TAXONOMIES = - -Types lets you easily setup custom post types and taxonomies. You can create new post types in seconds and use the advanced settings to customize every aspect. - -* Full control over every feature -* Associate taxonomies with custom post types -* Integrated control over custom fields display for different post types - -= BUILD RELATIONAL SITES = - -Types lets you define parent / child relationship between different post types. You'll easily setup one-to-many and many-to-many relationships and build powerful sites. - -= MULTILINGUAL READY = - -Types is the only custom fields and post types plugin that's built multilingual-ready. It plays perfectly with [WPML](http://wpml.org). You'll be able to translate everything, including texts and labels in the WordPress admin and user-content for front-page. See the [guide for translating Toolset](https://toolset.com/documentation/translating-sites-built-with-toolset/). - -= BUILT FOR STABILITY = - -Types is part of a family of plugins, including WPML and Toolset, developed and maintained by [OnTheGoSystems](http://www.onthegosystems.com). Our plugins power over 500,000 commercial sites, using WordPress as a complete CMS. While we love features, we know that stability, performance, usability and security are critical. All our plugins go through comprehensive testing, QA and security analysis before every release. - -== Installation == - -1. Upload 'types' to the '/wp-content/plugins/' directory -2. Activate the plugin through the 'Plugins' menu in WordPress - - -== Frequently Asked Questions == - -= How can I display custom post types on the home-page? = - -By default, WordPress will either display your blog posts or a specific page on the home-page. - -To display custom post types on the home-page, you have two options: - -1. If you're comfortable with PHP and WordPress API, edit the site's template files (probably index.php) and load the custom post types there. Different themes do this differently, so we can't really say what single approach works best. You should look at [get_posts](http://codex.wordpress.org/Template_Tags/get_posts), which is part of the WordPress Template Tags system. - -2. If you want to build sites right away, without becoming an expert in WordPress API and try our [Toolset Views](https://toolset.com/home/views-create-elegant-displays-for-your-content/). You'll be able to load whatever content you need from the database and display it anywhere and in whatever way you choose. - -We're sorry, but we don't know of any third option which is both free and requires no coding. - -= How can I create repeating field groups?= - -The paid version of Types, available through [Toolset](https://toolset.com) Website lets you create infinitely nested groups of repeating fields. - -= Can I use Types without Views? = - -Sure you can! Types, by itself, replaces several other plugins that define custom types and fields. We believe that it does it much better, but it's up to you to decide. - -If you also buy Views, with Toolset, you'll have a complete solution for both **defining** and **displaying** custom data. You can achieve everything that Views does if you're fluent in PHP and know WordPress API. When you buy Views, you're also supporting Types development, but we're not looking for donations. You should consider Views for its value and nothing else. - -= I am already a ninja developer, do I really need Views? = - -We honestly think so. Even if you're an expert developer, do you really enjoy doing the same stuff over and over again? With Views, you can concentrate on the unique features of every new site that you build, without wasting time on routine stuff. - -Views was originally inspired by the Drupal module with the same name. Around 90% of all Drupal sites use the Drupal Views module and many consider it as one of the most powerful features in Drupal. Now, you too can enjoy the same power (and even more), but without any of the complexity of Drupal. - -= Can Types display custom fields that I defined somehow else? = - -Yes! You can tell Types to manage any other custom fields. For example, if you're using an e-commerce plugin, you can tell Types to manage product pricing. This will greatly help you display these fields with Types API or with Views. - -Go to Custom fields control, under the Types menu. There, you can tell Types to manage existing custom fields. - -= How do I migrate an existing site to use Types? = - -The most important thing is to remember not to define custom post types and taxonomies in more than one place. If you previously defined them in PHP, first, remove your PHP code with the manual definition. The content will appear to temporarily vanish. Don't panic. Now, redefine the same custom post types and taxonomies with Types. Everything will return :-) - -Types also includes data import from other plugins such as Custom Post UI and Advanced Custom Fields. - -= Can I import and export my Types settings? = - -Yes! Types includes its own import and export features, using an XML settings file. If you create a development site, you can easily transfer settings to the production site. - -= What is the advantage of using Types over separate plugins for custom post types, taxonomies and fields? = - -Types offers a much richer integration, which is simply impossible with separate plugins. For example, you have fine-grained control of where to display custom meta-boxes. Because Types defines both the post types and fields, we have greater control of where things can go. - -Additionally, Types is the only plugin that lets you define parent/child relationships between different post types AND use that information to edit child data when editing a parent. - - -== Screenshots == - -1. Toolset Dashboard -2. Post Types list -3. Custom Taxonomies list -4. Edit Post Type -5. Edit Taxonomy -6. Editing post field group -7. Editing user field group -8. Inserting custom fields to content -9. Custom fields on the post editing page -10. Bulk editing child content using Field Tables - -== Changelog == - -= 2.3.2 = -* An upgrade to the Installer component to prevent the notification about a possible upgrade to Types 3.0 for non-subscription users. - -= 2.3.1 = -* Bring back the upgraded Installer in order to remedy upgrade issues for both subscription and non-subscription clients. - -= 2.3 = -* Free Types version which will be available on wordpress.org only. -* Added a dismissable notice about what is going on with Types development. -* Removed the Installer dependency. Clients who buy Toolset will have to download Types 3.0+ manually for the first time. -* Users should no longer be asked to buy a subscription in order to upgrade (sorry about that). - -= 2.2.23 = -* Fixed issue with Toolset registration - -= 2.2.22 = -* First version of the public relationship API that will be sustainable also for many-to-many relationships. -* Added a warning about dropping the PHP 5.2 support (which is no longer officially supported anyway) in the near future. -* Fixed: Using the_title filter without the mandatory $id argument. -* Fixed: Deprecated function notice in PHP 7.2. - -= 2.2.21 = -* Fixed a compatibility issue with Beaver Builder -* Fixed an issue with extra backslashes when using quotes in field name -* Removed the Toolset overlay while saving -* Removed the dependency of GLOB_BRACE - -= 2.2.20 = -* Fixed an issue that field title was not available on filter "wpt_field_options" -* Fixed an issue with the background when resizing transparent indexed colored PNGs -* Fixed an issue with special character entities import - -= 2.2.19 = -* Fixed an issue when using 3rd party shortcodes on the WYSIWYG field - -= 2.2.18 = -* Fixed an issue when adding option to checkbox / radio / select field -* Fixed an issue with Custom Post Types loading (since WordPress 4.8.2) - -= 2.2.17 = -* Fixed an issue when saving field conditional while the latest version of Views was active. -* Updated the list of WordPress reserved names. -* Fixed a formatting issue when using a WYSIWYG field in Content Templates. - -= 2.2.16 = -* Fixed a bug with numeric validation used a different decimal sign than a dot. -* Fixed a compatibility issue with the The7 theme. -* Display an admin message if there are other Toolset plugins that are not registered. This should not affect local and staging sites. - -= 2.2.15.1 = -* Fixed a bug that caused WCML to request registration in order to receive updates. - -= 2.2.15 = -* Fixed a bug that caused Types to request registration in order to receive updates. - -= 2.2.14 = -* Improved translations -* Fixed notice in term listing page when image field URL is not valid - -= 2.2.13 = -* Fixed an issue between the Image field and databases using utf8mb4 character set - -= 2.2.12 = -* Improved the performance of the Image field. - -= 2.2.11 = -* Removed notices, to push users to activate Layouts theme integration plugins based on the current theme -* Added filter to remove/add automatic notices on demand - -= 2.2.10 = -* Compatibility changes for CRED 1.9 -* Updated Font Awesome to version 4.7.0 -* Fixed broken link in parent relationship table on unpublished posts -* Fixed a compatibility issue with Soliloquy Slider - -= 2.2.9 = -* Added the feature to display posts and pages in Toolset dashboard by default. -* Added the ability to set the purpose of a View or a WordPress Archive, when creating from the Toolset Dashboard. -* Added support for user language setting. -* Renamed "Thumbnail" to "Featured Image" in custom post type edit screen options. -* Removed non-Types taxonomies from the related section in post type edit screen. -* Removed "Layouts not compatible with theme" message. -* Fixed an issue with checkbox user field with option to save 0 to the database -* Fixed an issue that WordPress Archives created inside Layouts were listed in Views section of Types Information table -* Fixed a compatibility issue with WPML plugin which was causing duplicate keys in the icl_strings table, when renaming post field groups or post types. -* Fixed a compatibility issue with UseAnyFont plugin. - -= 2.2.8 = - -* Fixed an issue where Types saves invalid values in user fields. -* Added 'custom_css' and 'customize_changeset' to list of excluded post types. -* Fixed fatal errors with Styling editor and PHP 7.1. -* Fixed a glitch in Firefox ”a new blank tab was opened when clicking on ‘Skip Feedback’” - -= 2.2.7 = - -* Fixed a JavaScript error when using a flat taxonomy in the relationship post table. -* Fixed an issue where no value was stored for checkboxes when option to save 0 was selected. -* Fixed a validation issue for file, audio, video and embed fields affecting Types. Allowing URLs with non-latin characters, but only for URLs that point to attachments from the Media Library (validated by WordPress media upload mechanism). -* Removed the "Types Migration" page which was broken and not maintained. -* Fixed an incompatibility issue with Divi caused by double enqueuing of the jQuery UI Validation plugin. -* When inserting the types shortcode for an image field, we will always use placeholders for the title and alt text. -* Fixed an issue in the relationship post table where it wasn't possible to repeatedly set and remove a child post's featured image. -* Improved how the Types meta fields are registered in the Fields and Views dialog. - -= 2.2.6 = - -* Updated Installer to 1.7.15. -* Fix several issues with the Styling editor. -* Fixed a compatibility with Layouts, child themes of Layouts-integrated themes haven't been recognized as such. -* Fixed a compatibility with WPML, where a rare ID collision caused problems on the parent post selection dropdown. - -= 2.2.5 = - -* Use a different validation rule for file fields that also allows domains without TLD. -* Fix a CRED issue with added validation rules. -* Handle several issues related to using "0" as a default field value and saving it to the database. -* Fix an edge-case bug when loading field groups on the Edit Post page. - -= 2.2.4 = - -* Added missing mandatory URL validation to file fields. -* Added support for all custom post types in Toolset Dashboard. -* Added support for "id" attribute for $parent-post selection in types_render_shortcode() function and [types] shortcode. -* Added PHP template example files. -* Implemented an alternative escaping mechanism for custom format setting of the date field. -* Changed the way we store the context of a Types field for string translation (use field group name instead of ID). -* Excluded Media from post relationships since the current GUI isn't able to support it properly. -* Fixed compatibility issue with registering custom taxonomies in WordPress 4.7. -* Fixed compatibility issue with direct access to $wp_filter in WordPress 4.7. -* Fixed taxonomies export with legacy "object_type" setting that was causing syntax errors in the output XML. -* Fixed manipulation with repetitive user field values making it more similar to post fields. -* Fixed front-end notice when there is only one value in a repeating user Skype field. -* Fixed issue with Types export and non-latin characters in a field group slug. -* Fixed regression on the post parent selector caused by the select2 update. -* Fixed name display instead of slug in term field group edit pages. - -= 2.2.3 = - -* Fixed several security issues. - -= 2.2.2 = - -* Toolset Dashboard now supports custom post types created by theme or other plugins -* Updated select2 to version 4 -* Fixed issue using [types] shortcode in CRED notification -* Fixed minor incompatibility with the latest version of Toolset Access. -* Fixed issue with custom values for checkboxes fields not being respected. - -= 2.2.1 = - -* Fixed path for Toolset Installer - -= 2.2 = - -* Added feature to output title, description, caption and alt text using placeholders in image field. -* Added types_import_from_zip_file API filter. -* Added types_finished_saving_child_posts API action as a workaround for https://core.trac.wordpress.org/ticket/17817. -* Fixed error when generic field definitions are queried by Types-specific arguments. -* Fixed warnings when saving a child post with repetitive field in the parent's edit page. -* Fixed issue where internal "Types Term Groups" post type was appearing in some places that it should not. -* Fixed issue in RTL languages where save button was being overlapped by cancel button on field group conditions. -* Fixed issue with post relationship query in WPML default language. -* Fixed issue with term field checkboxes options which were not able to be edit -* Fixed performance issue with frontend display table. -* Fixed issue with same fields in multiple field groups and they are now being displayed only once in post/user/term edit pages. - -= 2.1 = - -* Added dashboard for Toolset. -* Added setting to hide “Front-end Display” table. -* Added types_filter_query_field_definitions API filter. -* Added Import and Export support for term fields and field groups. -* Added ability to add term fields values on Add Term page. -* Added warning about possible conflicts between post type and taxonomy rewrite slugs. -* Added feature in Edit Field Group where fields with errors will be expanded on submit to make the error visible to the user. -* Added feature on term listing page to hide term field columns, if there are too many and user has not changed screen options . -* Added feature on post type edit screen to also display complex fields in “Post Fields to be shown as columns in Post Type listing in WordPress Admin” section, even if they are not available in the listing. -* Added ability to delete a taxonomy in edit page. -* Added ability to delete a field group in edit page. -* Added support for "id" in types_render_field() function. -* Changed label "Numeric" to "Number". -* Updated “Where to include this Field Group” section, which is no longer a meta box and is now placed under “Name and description”. -* Updated “Front-end Display” table, which will no longer display "Template" for built-in post types. -* Updated “Cancel” links in dialogs, which are now buttons to match WordPress style. -* Updated [types] shortcode attributes and they are now using single quotes, instead of double quotes. -* Updated screen header tags to h1, instead of h2. -* Updated plugin license information. -* Updated POT language file. -* Fixed issue with child post types not created by Types that could not be edited in child-relationship table. -* Fixed issue with name and singular name of post types and post field groups that were not being sanitised. -* Fixed issue with Types admin screens access when user role has been degraded from Administrator role. -* Fixed issue with post count display in "At a Glance" section, when it was above a thousand. -* Fixed issue in Conditional Display that advanced logic did not work without simple logic. -* Fixed issue in Conditional Display that simple logic was always being displayed, even if advanced logic was used. -* Fixed issue in Conditional Display that slugs with hyphens were not usable in advanced logic. -* Fixed issue with field control pages that were not displaying all groups. -* Fixed issue with fields that changing a slug removed the field conditions. -* Fixed issue with term fields showing field content instead of "Display text". - -= 2.0.1 = - -* Release date: 2016-04-12 -* Fixed issue with information table and Layouts. - -= 2.0 = - -* Release date: 2016-04-11 -* Revamped Field Control page for all field domains. -* Added information table on post, post type and field group edit pages. -* Added columns with previews of field values in taxonomy term listing pages. -* Fixed issue with cursor that was moved automatically to the end of the slug input. -* Fixed issue with slugs that could not be numeric. -* Fixed disabled buttons when saving a child post in post-relationship table. -* Fixed upgrade issue from version 1.9 to 1.9.1 that was removing assignment between custom post types and native taxonomies. -* Fixed issue with initial expression of "Advanced text mode" in data-dependent display conditions for field groups. -* Fixed issue with special characters when displaying taxonomy names on the Edit Taxonomy page. -* Fixed issue with special characters when displaying term names on the Edit Post Field Group page. - -= 1.9.1 = - -* Released date: 2016-03-08 -* Fixed javascript infinite loop in post field group edit page. -* Fixed conflict between post relationship table and WordPress heartbeat ajax call. -* Fixed field slug limit of 20 characters. -* Fixed issue with filtering by multiple checkboxes fields that failed to return results. -* Fixed custom post type icon on "At a Glance" section. -* Fixed hidden visibility option of post types that did not work for built-in types. -* Fixed issue when adding an existing field that was always attached to bottom of the list. -* Fixed issue with parent custom post type that could not be stored in "Select child fields from Child to be displayed in Post Relationship table" -* Fixed options of unsaved checkbox / select / radio fields weren't sortable. -* Fixed an issue when adding a existing field to another group. -* Fixed an issue with cursor that was moved automatically to the end of slug input. - -= 1.9 = - -* Release date: 2016-02-17 -* New: Taxonomy term meta (custom fields for taxonomy). -* Major upgrade to user interface. -* Renamed "Custom Fields" to "Post Fields". -* Added post arguments “show_rest” and “rest_base” to options on post type edit screen. -* Added ability to rename built-in post types “Posts”, “Pages” and “Media”. -* Added new filter "wpcf_exclude_meta_boxes_on_post_type" that allows to exclude own Post Types from wpcf_add_meta_boxes() function in order to avoid adding Types meta boxes to certain custom posts. -* Added ability to modify the title placeholder, displayed when creating a new post, for each post type. -* Added ability to deactivate built-in taxonomies. -* CPTs can now be positioned anywhere in the admin menu. -* Promotional messages can now be disabled in settings. -* Fixed date fields so they properly display "hour" and "minutes" when they provide those options. -* Fix wrong field type conversion options for checkboxes fields. -* Avoid clearing the roles for the current user as global when editing a user by visiting its profile. -* Properly escape data used as attributes on a javascript methods controlling the post types, taxonomies, Content Templates or user roles assigned to a field group. -* Ensure a user creating children posts on a Fields Table table has the right capabilities to do so, including Access rights. -* Extend meta queries coming from Views so they work with Types checkboxes fields for users and taxonomy terms. Also, allow filtering by checkbox value in addition to checkbox title. -* Allow to filter checkboxes fields by a value that contains a comma in its title. -* Fix pagination in the Fields Table of a parent post type: it was returning the posts per page setting to its default state of 5. -* Fix the Next pagination button missing on Fields Tables when the table is set to show N children each time and you have N+1 children assigned to that parent. -* Fix custom taxonomy export/import when it is attached to a post type whose slug starts with a number. - -= 1.8.11 = - -* Release date: 2015-12-07 -* Fixed compatibility with WPML related to custom field translations. -* Fixed compatibility with WordPress 4.4 related to menu management. -* Added 'action' to the list of reserved words that can not be used to name post types or taxonomies. - -= 1.8.10 = - -* Release date: 2015-11-18 -* Added filter "wpcf_init_custom_types_taxonomies". - -= 1.8.9 = - -* Release date: 2015-11-10 -* Changed Installer version to 1.7 -* Changed Common version to 1.8 - -= 1.8.8 = - -* Release date: 2015-11-02 -* Replaced esc_attr_e to esc_attr in skype field. -* Changed Installer version to 1.6.8. - -= 1.8.7.2 = - -* Release date: 2015-10-28 -* Fixed the problem with select post parent if WPML is active. -* Replaced sum of array by array merge to avoid losing values. - -= 1.8.7.1 = - -* Release date: 2015-10-20 -* Added check to do not translate if value to translate is empty or not a string. - -= 1.8.7 = - -* Release date: 2015-10-18 -* Fixed a problem with shortcode playlist. -* Fixed a problem with backslash in WYSIWYG field name. -* Improved WPML integration, replace `icl_t()` by filter `wpml_translate_single_string`. -* Changed Installer version to 1.6.7 - to reduce requests to Toolset API. - -= 1.8.6.2 = - -* Release date: 2015-09-29 -* Fixed a problem with "Feature Image". -* Fixed a problem with loading parent data in child table. - -= 1.8.6.1 = - -* Release date: 2015-09-28 -* Fixed a problem with get_plugins() function is some Installer actions. - -= 1.8.6 = - -* Release date: 2015-09-28 -* Replaced parameter "numberposts" with "posts_per_page" in post relationships query. -* Fixed a meta post data before use and if is too complex just do not handle this in Types. -* Fixed a problem with selecting file in child tabele when is no WYSIWYG or other file field on edit screen. -* When we get User Group we added information about affected roles. -* Fixed a problem with playlist. - -= 1.8.5 = - -* Release date: 2015-09-02 -* Fixed a problem with display post parent in post children table after pagination. -* Fixed a problem with display post parent in post children table after sorting. - -= 1.8.4 = - -* Release date: 2015-09-01 -* Fixed a problem with display post parent in post children table after pagination. -* Fixed a problem with some AJAX action (can't add new field, can't choose child fields, etc. etc.) - -= 1.8.3 = - -* Release date: 2015-08-31 -* Fixed a problem with saving child posts when author role is "Author". - -= 1.8.2 = - -* Release date: 2015-08-27 -* Fixed a problem with selecting child post Events from Event Calendar when evens are "expired". - -= 1.8.1 = - -* Release date: 2015-08-25 -* Fixed a problem with select2 and new child posts. - -= 1.8 = - -* Release date: 2015-08-17 -* Added the ability to choose Custom Field as a column for Posts and Pages. -* Added the ability to select the Feature image in the child Post table. -* Added the ability to turn off the standard WordPress Custom Fields metabox. -* Added default value to a Custom Field. -* Added an "Edit" button for the parent post on the child Post editing page. -* Added an error message for Custom Fields in children entries. -* Added a new filter “wpcf_config_options_(type)”. -* Added "ico" file type as a proper image file. -* Added "parent" keyword into the list of reserved words for Custom Post Type or Custom Taxonomy name. -* Added "select2" options script in parent Post field. -* Changed "View template" string to "Content Template" in order to avoid inconsistencies. -* Added a check for Custom Fields in order to display only active ones in lists. -* Fixed a problem about the visibility of Types button in Post edit screen editor, when there are User Fields groups but no Custom Fields groups available. -* Fixed a problem about the Module Manager box. -* Fixed a problem with the usage of "dashboard_glance_items" filter. -* Fixed a problem about alternative text and title of repetitive image fields. -* Fixed a problem about lost translation when a parent Post was saved (https://wpml.org/forums/topic/custom-post-type-relationships/). -* Fixed a conflict of validation field with CRED plugin. -* Removed "Styling Editor" section in Custom Fields groups and User Fields groups edit screen. In order to enable it again, you can define “TYPES_USE_STYLING_EDITOR” constant in wp-config.php file. -* Improved Module Manager box in Custom Post Type and Custom Taxonomy edit screen. -* Moved marketing message into the "Need Help?" tab. -* Reviewed "Add New" buttons in all edit screens for consistency. -* Removed the "auto-import" option. -* Turned off migration from "Advanced Custom Fields Pro", as this plugin has different data structure than "Advanced Custom Fields". -* Updated list of Font Awesome icons. -* Updated Skype field according to the new Skype Buttons API. - -= 1.7.11 = - -* Release date: 2015-08-05 -* Fixed a problem when saving HTML in meta fields. - -= 1.7.10 = - -* Release date: 2015-08-04 -* Fixed a problem when saving HTML in meta fields. - -= 1.7.9 = - -* Release date: 2015-08-04 -* Fixed a problem when saving HTML in meta fields. - -= 1.7.8 = - -* Release date: 2015-08-03 -* Fixed WYSIWYG field for WP 4.2.3 security release. -* Added HTML frontend rendering settings. - -= 1.7.7 = - -* Release date: 2015-07-21 -* Fixed a problem with the Getting Started tutorials. - -= 1.7.6 = - -* Release date: 2015-07-20 -* Changed Installer version to 1.6.4 - to reduce load time and avoid to much update requests. - -= 1.7.6 = - -* Release date: 2015-07-20 -* Changed Installer version to 1.6.4 - to reduce load time and avoid to much update requests. - -= 1.7.5 = - -* Release date: 2015-07-15 -* Fixed a problem with Custom Fields Group edit screen to allow (again) underscore in Custom Fields names. https://toolset.com/forums/topic/underscores-in-custom-field-names-possible-bug/ - -= 1.7.4 = - -* Release date: 2015-07-09 -* Changed Installer version to 1.6.1 - -= 1.7.3 = - -* Release date: 2015-06-25 -* Fixed problem with "View All" in menu builder for Custom Post Types. https://toolset.com/forums/topic/appearance-menu-php-errornotice/ - -= 1.7.2 = - -* Release date: 2015-06-23 -* Field a problem with "file type" field on post edit screen when is no WYSIWYG editor. https://wordpress.org/support/topic/image-field-not-working-1 - -= 1.7.1 = - -* Release date: 2015-06-22 -* Fixed a problem with constant ICL_SITEPRESS_VERSION https://wordpress.org/support/topic/types-17-notice-undefined-constant-icl_sitepress_version -* Field a problem with "file type" field on user profile screen. https://wordpress.org/support/topic/image-field-not-working-1 -* Types and Access integration - You can define roles and control who can add, edit or change Custom Post Types, Custom Taxonomies, Custom Field Groups and User Meta Groups. - -= 1.7 = - -* Release date: 2015-06-15 -* Added the word "mode" to the list of words reserved by WordPress. https://toolset.com/forums/topic/when-types-is-activated-i-cant-filter-articles-by-category-in-the-wp-backend/ -* Added the feature that automatically creates a slug for the Custom Post Type and Custom Taxonomy. -* Added bulk delete options to Custom Field Groups listing page. -* Added bulk delete options to Custom Post Types listing page. -* Added bulk delete options to Custom Taxonomies listing page. -* Added the automatic check of availability for the "Title" and "Editor" fields in the child relationship dialog. -* Added the duplicate option for Custom Post Type and Custom Taxonomy. -* Added the "Excerpt" field to the Child Posts table. -* Added the "wpcf_field_image_max_width" filter which allows user to change image width on admin listing pages. -* Added the option to specify the custom archive slug for the Custom Post Type http://toolset.com/forums/topic/specify-cpt-archive-slug-as-string/ -* All custom fields on Custom Post Type listing pages are now sortable. -* Changes to the Types fields GUI for easier support. -* Fixed a problem with Custom Post Type, Custom Taxonomy and Custom Fields Group editing pages where forms would "freeze" after validation fails. -* Fixed a problem with selecting an image for the Custom Image Field in the Child Posts table, after using the "Add New", "Save All" and "Save" buttons. https://toolset.com/forums/topic/featured-image-cannot-be-changed-after-first-save/ -* Fixed a problem with multi-line field not being wrapped with P (paragraph) HTML tag https://toolset.com/forums/topic/multi-line-text-fields-are-missing-paragraph-tags/ -* Fixed problem with fields being covered by colorbox on the Custom Post Type editing page. -* Fixed an issue where a wrong message was displayed when minimum number of characters has not been reached. - -= 1.6.6.6 = - -* Release date: 2015-06-10 -* Fixed problem with "playlist" word. https://toolset.com/forums/topic/front-end-warning-from-wysiwyg-php/ - -= 1.6.6.5 = - -* Release date: 2015-05-20 -* Fixed problem with Uncaught ReferenceError: pagenow is not defined. http://toolset.com/forums/topic/nextgen-gallery-broken-urgent/ - -= 1.6.6.4 = - -* Release date: 2015-05-12 -* Fixed problem Export/Import for CPT with custom fields. - -= 1.6.6.3 = - -* Release date: 2015-04-27 -* Fixed problem with Commercial tab on Install new Plugin Page. - -= 1.6.6.2 = - -* Release date: 2015-04-10 -* Fixed problem with File Field which do not work when edited from the Parent Post Type. https://toolset.com/forums/topic/1-6-6-seems-to-break-child-fields-when-parent-has-an-image-field/ - -= 1.6.6.1 = - -* Release date: 2015-04-03 -* Fixed problem with archive page for custom post type. - -= 1.6.6 = - -* Release date: 2015-04-02 -* Fixed problem with shortcode "playlist" used in WYSIWYG field. http://toolset.com/forums/topic/media-play-list-not-outputting-from-custom-wysiwyg-field-js-error/ -* Fixed empty title problem for filter "wpt_field_options" on user edit/add screen https://toolset.com/forums/topic/populate-select-field-in-wpcf-um-group/ -* Added ability to create CPT without title and editor. https://toolset.com/forums/topic/inaccurate-warning-message-when-creatingediting-a-cpt/ -* Added Skype field validation. -* Fixed problem with loading custom CSS when user meta group is inactive or not assign to certain user role. -* Added ability to add to menu link to archive of post type. -* Added ability to setup meta box callback function. https://toolset.com/forums/topic/add-support-for-meta_box_cb-in-custom-taxonomy/ -* Added ability to add HTML5 placeholder attribute for custom post fields. -* Fixed problem with CPT labels. https://toolset.com/forums/topic/after-save-cpts-cutom-labels-always-revert-to-default-label/ -* Added a filters to the post title as option text in the select dropdown for post parents. wpcf_pr_belongs_items for array of options and wpcf_pr_belongs_item for one option. https://toolset.com/forums/topic/help-to-distinguish-duplicate-titles-in-post-relationship/ -* Added ability to choose custom fields to display it on custom posts admin list. -* Fixed problem with saving parent data into child data. On parent edit screen. -* Added check group name for Custom Fields and User Fields. -* Fixed missing "Edit" button on group edit screen when we close custom logic form. - -= 1.6.5.1 = - -* Release date: 2015-02-24 -* Fixed Installer patch to plugins. -* Fixed problem with "Access Control and User Roles" menu in Types, when Access is active http://toolset.com/forums/topic/update-issues-fatal-error-require_once-failed-opening-required-wpcf_access_/ -* Changed utm_media used in links on "Getting Started" pages. - -= 1.6.5 = - -* Release date: 2015-02-10 -* Changed in relationships, now all posts are showed, even those which have show_ui to false. -* Added ability to hide custom post types on post relationships list. https://toolset.com/forums/topic/post-relationship-doesnt-show-post-type-events-created-by-events-espresso/ using filter add_filter('wpcf_show_ui_hide_in_relationships', '__return_false'); -* Fixed a problem with deleting last children on post relationships table. -* Added filter to allow use "?" in image url. https://toolset.com/forums/topic/image-custom-field-is-not-storing-image-path-with-parameters/ -* Added option for child table, when editing parent to allow show only list of children instead edit form. http://toolset.com/forums/topic/miss-settings-for-post-relationship-child-options/ -* Fixed a problem with slug in custom fields, when field have special chars. -* Fixed wrong display message about custom fields not manageable by Types. -* Fixed a conflict with Formidable-Pro plugin https://toolset.com/forums/topic/plugin-conflict/ -* Fixed creating new post in relationships. WP 4.1 need real title not faked by one space. -* Fixed problem with validate fields on user create page. http://toolset.com/forums/topic/custom-usermeta-bypassed-even-required-is-set/ -* Improved Edit CPT and Edit CT screens to be more compatible with WP Admin UI -* Fixed problem with default label which contains single quote character (eg. French) https://toolset.com/forums/topic/default-label-always-shown/ -* Improved display list of custom fields groups. - -= 1.6.4 = - -* Release date: 2014-11-17 -* Fixed an issue with dependency between custom taxonomies and custom posts when importing data from the "Custom Post Type UI" plugin. -* Fixed an issue with editing checkboxes with the option "save 0 to the database" selected, created for Custom Posts. http://toolset.com/forums/topic/checkbox-custom-field-doesnt-save-value-since-upgrade-to-version-1-6-2/ http://toolset.com/forums/topic/types-checkbox-field-not-saving-after-save-0-to-the-database/ -* Fixed an issue with PHP notices being thrown when relative URLs to images were used. http://toolset.com/forums/topic/php-notice-undefined-index-host-in-image-php/ -* Fixed the example file which adds the Google Map field to Types and allows users to enter coordinates to display a map on the front-end. -* Added the "wpcf_delete_relation_meta" filter which allows deletion of all post relationships when deleting a custom post type. -* Fixed an issue with the file name being changed when the file was uploaded. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/189560556/comments http://toolset.com/forums/topic/types-1-6-update-breaks-layout-that-worked-in-types-1-5-7/ -* Fixed a problem with duplicate slugs on "Edit Group" screen. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/187118123/comments http://toolset.com/forums/topic/cant-add-more-custom-fields/ -* Fixed a problem with default description not disappearing for non-English placeholders. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/189787190/comments -* Fixed a problem with Custom Taxonomy metaboxes still appearing on the Custom Post editing page even after removing a Custom Taxonomy from a Custom Post Type. -* Fixed embedding OTGS CSS for the admin area. https://wordpress.org/support/topic/four-stylesheets-being-loaded-at-frontend -* Fixed a problem with Checkbox field value not being saved. https://toolset.com/forums/topic/checkbox-value-not-saved/ -* Added the option to select posts with the "Private" post status as parents in a parent-child Custom Post Types relationships. http://toolset.com/forums/topic/cred-child-form-not-working-with-private-ctp/ -* Fixed a problem with the date-picker. https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/191190651/comments -* Fixed a problem with label menu in wp-admin for child posts. -* Fixed a problem with child table when edit parent post and children do not have title. -* Prevent to chose repetitive field in child table on edit parent screen. http://toolset.com/forums/topic/wp-types-select-child-fields-to-be-displayed-specific-fields-not-working/ -* Added a dynamic "posted x minutes/hours ago" for Types fields. https://toolset.com/forums/topic/adding-a-dynamic-posted-x-minuteshours-ago-in-a-view/ -* Improved post relation table by using more precise labels. http://toolset.com/forums/topic/displaying-the-best-names-of-cpts-in-applicable-contexts/ -* Fixed a problem with display checkbox value from database if checkbox is empty. - -= 1.6.3 = - -* Release date: 2014-10-23 -* Added the message to ask users to answer a short survey for feedback on their work using the Types plugin. -* Fixed a problem where the custom field group’s description was missing from the post/page editing page. http://toolset.com/forums/topic/custom-field-group-descriptions-no-longer-visible-in-cpt-add-newedit-screen/ -* Fixed a problem where the field descriptions weren’t displayed on the user profile editing page. http://toolset.com/forums/topic/checkbox-description-fields-no-longer-display-in-types-1-6-2/ -* Fixed a problem where users weren’t able to untick the single and multiple checkbox fields on the user profile editing page. -* Fixed a problem where the value of date field couldn’t be cleared and added new button which clears the date field value. http://toolset.com/forums/topic/problem-2-after-update/ -* Replaced the deprecated like_escape function with the wpdb::esc_like function. -* Fixed a problem where the parent-child relations between custom post types persisted after deleting and re-creating a custom post type. -* Fixed a problem where date picker scripts were being enqueued in the front end. https://wordpress.org/support/topic/datepicker-css-enqueued-on-public - - -= 1.6.2 = - -* Release date: 2014-08-29 -* Fixed addslashes warning -* Fixed display problems with Types shortcodes -* Fixed PHP error for checkboxes - -= 1.6.1 = - -* Release date: 2014-08-22 -* Fixed Formfactory::createForm and Formfactory::displayForm errors on some systems -* Fixed anonymous function problem with wysiwyg field -* Fixed datepicker.css so it only styles the datepicker popup -* Fixed escaping problems with the Types shortcode - -= 1.6 = - -* Release date: 2014-08-22 -* Added ability to add extra options by filter *wpt_field_options* to fields with "options". -* Added ability to create custom post type with the same singular and plural name. -* Added ability to select menu icon (WordPress dashicon) for custom post type. -* Added delete attached repetitive files. -* Added filter "wpcf_pr_belongs_post_status" that allows to change post_status for parent/child posts. -* Added sanitization for uploaded file names, to remove non-latin1 characters. -* Added debug page to help retrieving debug information. -* Fixed export problem if system temporary directory is not allowed to write by open_basedir restriction. -* Fixed export problem, when temporary directory is full or not available. -* Fixed import of slug for custom fields. -* Fixed problems with calling static method in PHP 5.2 -* Fixed problems with embedding scripts when WordPress works on non-standard port. -* Fixed problems with getting not existing array keys when register new post type. -* Fixed problems with manage more than one flat taxonomy on one CRED screen. -* Improved import button, which is disabled until user select a import file. -* Improved custom display logic UI for conditional display in custom fields edit screen. -* Prevent raising group chose overlay on "Custom Fields Control" screen if there is no group. -* Removed serialize/unserialize for exported relationships to avoid object injection. -* Removed Zebra library and created new Toolset fields library. -* Tweak import/export screen when is something wrong with imported file -* Fixed several security issues -* Unify code with other Toolset plugins -* Added debug information output for improved customer support -* Added "required" validation audio, file and video fields - -= 1.5.7 = - -* Fixed action "admin_header" to "admin_head" thx for (anarchocoder)[https://wordpress.org/support/profile/anarchocoder] -* Fixed english suggests in non-english sites. -* Fixed missing icons in WordPress menu on custom fields edit screen. -* Fixed problem with posts relations if post has no parent. -* Fixed problems with checkbox field. Sometimes "check for new posts" do not works correctly. -* Fixed Media Library size if post have no editor. -* Fixed empty fields in "Styling Editor" when editing custom fields. -* Fixed usage of custom fields with prefix "wpcf-" but added by default interface. -* Fixed save fields on attachment edit page. -* Fixed save custom checkbox fields for new attachments. -* Fixed problems with id when repetitive fields are added very fast. -* Fixed problems with displaying options witch apostrophe like "90's". -* Removed clickable links on preview when editing Custom Fields Groups. -* Check compatibility with WordPress 3.9.1. - -= 1.5.6 = - -* Avoid to get WPML configuration if WPML is not installed. -* Check compatibility with WordPress 3.9. -* Fixed missing setting get in module manager. -* Fixed problems with getting post data in relationship when post do not exist. -* Fixed setting override when import data. - -= 1.5.5 = - -* Added file name normalization to avoid some storing problems. -* Added post type slug check due changing. -* Added showing hidden fields on fields control screen -* Added "Show hidden fields" checkbox to show hidden custom fields. -* Adjusted media file path normalization -* Allowed choosing parent posts of all post statuses -* Introduced TYPES_EMBEDDED_URL constant for embedded code -* Fixed bug with child posts and WPML -* Fixed checks if usermeta control screen have hidden fields allowed -* Fixed conditionals are not saved when adding existing fields to group -* Fixed missing relations between posts, after changing parent post type slug. -* Fixed missing relations between post and custom fields, after changing parent post type slug. -* Fixed missing relations between post and taxonomy, after changing parent post type slug. -* Fixed missing WPML translations, after changing parent post type slug. -* Fixed on changing parent posts select to fetch all statuses -* Fixed order of parent form now sorted for pubblished and draft -* Fixed saving conditional settings -* Fixed 'wpcf-post-type' notice. - -= 1.5.4 = -* Caching improvements -* Image resizing adjustments - -= 1.5.3 = -* Fixed caching field data before applying WPML filters -* Fixed forced saving Uncategorized category in child table taxonomy forms -* Fixed indexing bugs with repetitive fields -* Fixed changing numeric to single-line do not remove numeric validation -* Fixed deleted fields showing in conditional dropdown -* Fixed checkboxes special characters in modal screen -* Added preview warning about not updated meta fields -* Added better filtering malformed fields -* Added not allowed saving fields with numeric slugs -* Added 'suppress_filters' parameter for WYSIWYG field -* Added support for W3TC CDN hosted resized images -* Improved JS validation performance -* Removed image exif_imagetype check - -= 1.5.2 = -* Fixed image resizing when only width or height is specified -* Fixed image saving for Win -* Fixed validation for radio field - -= 1.5.1 = -* Fixed the URLs of image fields on several server configurations - -= 1.5 = -* Added new field Colorpicker -* Added new field Video -* Added new field Audio -* Added new field Embedded Media -* Added Usermeta fields to 'Add New User' screen -* Added backward compatibility for 'output' parameter -* Added show_admin_column support for taxonomies -* Added option to have padded cropped image and real non-proportional resize -* Added taxonomy terms selection to child post tables -* Added datepicker support for year range -* Added handling post_id to API call types_child_posts() for custom queries -* Fixed WPML updating fields from original translation -* Fixed WPML edit post screen forms for copied fields -* Fixed WPML creating and updating child posts -* Fixed WPML copied fields appear locked if post do not have original post -* Fixed WPML deleting translated post fields marked as 'translatable' when original is updated -* Fixed WPML changed all fields to be disabled when copied -* Fixed WPML unlocked copied fields when Translation Management is not active -* Fixed WPML removed translation preferences form when Translation Management is not active -* Fixed changing child post status when updating from child table or updating parent -* Fixed setting post parent as 'Not selected' for child post -* Fixed processing shortcodes from field value -* Fixed bug with caching types_child_posts() API call -* Fixed 'maxlength' validation -* Fixed saving post as draft when required field is hidden by other conditional field -* Fixed conditionals triggered on profile page if postmeta and usermeta have same ID -* Fixed custom fields named with prefix 'wpcf-' put under Types control -* Fixed possible issues with relative paths for embedded mode -* Fixed bug with Group conditional and date field -* Fixed bug with fields group conditional and date field -* Fixed saving checkbox zero value for usermeta -* Fixed saving checkboxes for usermeta -* Fixed migrating checkbox for usermeta -* Fixed migrating checkboxes for usermeta -* Fixed child table may show inactive fields - -= 1.4 = -* Views 1.3 compatibility -* New Editor ( new GUI, complete parameter list available, improved inserting shortcodes ) -* Added 'url' parameter for Image field -* Added 'target' parameter for URL field -* Added Asterisk for required fields titles -* API functions updated -* Added support for custom image sizes ( registered using add_image_size() ) -* Removed un-necessary controls from Media Upload for field -* Improved performance on AJAX conditional check -* Fixed inconsistencies when creating first child -* Fixed various issues with Usermeta fields -* Fixed and improved sorting child posts -* Fixed bugs with validation JS -* Date conditional form improved ( added Date select ) -* Checkboxes removed from conditional selection -* WPML synchronization when custom post type or taxonomy is changed (translation preferences, translation connections, belonging terms connections) -* Fixed various issues with WPML-copied fields -* Added support for Tabify plugin - -= 1.3 = -* Added support for User Meta fields -* Added customization for styling of fields -* Added Access control for fields -* Added Read-only mode for fields -* Added no_protocol attribute for url field -* Fixed Date issues when Date is empty -* Better checks for Date values added -* Fixed Date formats issues -* Added Datepicker localization -* WPML and Group terms filter compatibility added -* Fixed Checkboxes 'save zero' setting and display issues -* Fixed Checkbox 'save zero' inserting value on new post -* Added missing Filters association Group setting in Export -* Fixed JS issues when adding first child post -* Fixed WYSIWYG editor not showing in child form -* Reviewed filters for Images for Windows server -* Fixed adding inactive images to editor dropdown -* Performance improvements ( caching results, JS reviews ) - -= 1.2.1.1 = -* Fixed problem with some dates showing as a time stamp -* Fixed number field so it excepts 0 (zero) -* Fixed raw="true" mode so it doesn't process shortcodes -* Fixed translations missing in some languages -* Fixed wrong language being displayed for missing translations -* Fixed repeater fields and conditional display issues - -= 1.2.1 = -* Fixed compatibility with ACF, Events Calendar and a number of other plugins due to removed actions -* Fixed a problem with WooCommerce Extensions, due to too late initialization -* Fixed translations -* Fixed a problem with stypes_child_posts function on updates -* Fixed a problem with Types API for field render -* Fixed a problem with conditional fields and wpv_condition -* Fixed a bug with repeating fields in translated content -* Fixed a problem with many-to-many relationship -* Fixed a bug with fields inserted into the wrond WYSIWYG field - -= 1.2 = -* Added allowing ordering of repeater fields -* Added allow duplicate repeater fields -* Added support for translating Custom Post Type slugs -* Added control of the number of children displayed in the Fields table -* Added optional hour and minutes to the Date field -* Added check to make sure the single and plural names of a Custom Post Type are different -* Fixed handling of required conditional fields -* Removed use of mb_ereg and mb_string functions -* Fixed JavaScript escaping -* Fixed rendering of shortcodes inside types shortcode -* Fixed Open_basedir restriction -* Fixed AJAX popup CSS and JS -* Fixed translation of "Add another field" and "Delete field" buttons -* Fixed exporting and importing of Types Taxonomy -* Fixed exporting and importing of conditional settings for groups - -= 1.1.3.4 = -* Fixed adding child posts for WordPress 3.5 - -= 1.1.3.2 = -* Fixed 'em' tags in radio.php and select.php -* Added support for localized custom post slugs via WPML - -= 1.1.3.1 = -* Fixed saving fields in WP 3.5 -* Fixed a bug displaying Types credit footer when not asked to do so - -= 1.1.3 = -* Added support for resizing remote images -* Fixed long and short date formats -* Fixed many small bugs and glitches -* Sync with Views 1.1.3 - -= 1.0.4 = -* Some fixes for textarea rendering without automatic paragraph insertion -* Some fixes for WPML compatibility -* Support for Views 1.1.1 - -= 1.0.3 = -* Fixes for repeating fields - -= 1.0.2 = -* Improved WPML support with repeating fields -* Fixed problems with decimal repeating fields -* Post relationship meta box goes through standard WordPress filters -* Fixed field display conditions for date fields -* Fixed field count when adding or deleting fields -* Stopped saving child posts when saving the parent, to avoid conflicts with other plugins -* Checkboxes can save '0' for empty fields - -= 1.0.1 = -* Fixes a number of small bugs, related with JS interaction with other plugins - -= 1.0 = -* Added an option to make fields repeatable -* Added multiple-option checkboxes -* Added an option to output just URLs for resized images -* Added support for global class and style for all fields -* Added AJAX support for conditional fields -* Added support for non-ASCII characters in CPT URLs -* Added translations for Spanish, French, German, Portuguese, Italian and Dutch -* Fixed many small bugs and glitches - -= 0.9.5.4 = -* Fixed a javascript bug on group edit pages - -= 0.9.5.1 = -* Fixed a last-minute bug with post relationship - -= 0.9.5 = -* Added support for parent/child post relationship between different types -* Added Field Tables, for bulk editing child fields from the parent editor -* Streamlined the field insert GUI - -= 0.9.4.2 = -* Fixes a few bugs. - -= 0.9.4.1 = -* Fixed a problem adding custom fields to a group on some servers -* Fixed so that standard tags and categories work again with custom post types -* Fixed custom field groups not being shown for some content templates - -= 0.9.4 = -* Added an option to display custom field groups on specific templates only -* Fixed a number of bugs with Javascript and with Windows servers - -= 0.9.3 = -* Added an import screen from Advanced Custom Fields -* Added an import screen from Custom Posts UI -* Added support for non-English character in custom field names -* Eliminated messages about how to insert custom fields in PHP -* Check if fields already exist with the same name before creating them -* Improved compatibility with WPML - -= 0.9.2 = -* Added WYSIWYG custom fields -* Improved the usability for setting up custom taxonomies -* Date fields use the date format specified by WordPress -* Fixed a few bugs for WordPress 3.3 -* Checks that fields cannot be created twice -* Checks that only local images are resized -* Added bulk-delete for custom fields -* Fixed a few issues with WPML support - -= 0.9.1 = -* Added Embedded mode -* Allows to manage existing custom fields with Types -* Added a .po file for translating Types interface - -= 0.9 = -* First release - -== Upgrade Notice == - -= 0.9.1 = -* The new Embedded mode allows integrating Types functionality in WordPress plugins and themes. - -= 0.9.2 = -* Check out the new WYSIWYG custom fields. - -= 0.9.3 = -* This version streamlines the admin screens and includes a importers from other plugins - -= 0.9.4 = -* You can now enable custom field groups for content with specific templates - -= 0.9.4.1 = -* Fixed a few problems found in the 0.9.4 release - -= 0.9.5 = -Try the new parent/child relationship between different post types! - -= 0.9.5.1 = -Fixed a last-minute bug with post relationship - -= 0.9.5.4 = -Fixed a javascript bug on group edit pages - -= 1.0 = -You can make any field repeating now - -= 1.0.1 = -Small bugfix release - -= 1.0.2 = -Better support for multilingual sites with repeating fields - -= 1.1.3 = -Includes support for resizing remote images - -= 1.1.3.1 = -Fix for WP 3.5 - -= 1.1.3.2 = -You can have localized slugs for custom post types - -= 1.1.3.4 = -Fix adding child posts for WordPress 3.5 - -= 1.2 = -Drag and Drop ordering of repeating fields - -= 1.2.1 = -Just bug fixes. Usermeta fields are coming in Types 1.3! - -= 1.3 = -Add Usermeta fields and Access control of fields. diff --git a/backend/wordpress/wp-content/plugins/types/vendor/autoload.php b/backend/wordpress/wp-content/plugins/types/vendor/autoload.php deleted file mode 100644 index bd7550b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/LICENSE b/backend/wordpress/wp-content/plugins/types/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_classmap.php b/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_classmap.php deleted file mode 100644 index 579e71c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,881 +0,0 @@ - $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php', - 'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php', - 'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php', - 'Composer\\Installers\\AsgardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AsgardInstaller.php', - 'Composer\\Installers\\AttogramInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AttogramInstaller.php', - 'Composer\\Installers\\BaseInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BaseInstaller.php', - 'Composer\\Installers\\BitrixInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BitrixInstaller.php', - 'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php', - 'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php', - 'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php', - 'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php', - 'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php', - 'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php', - 'Composer\\Installers\\Concrete5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Concrete5Installer.php', - 'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php', - 'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php', - 'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php', - 'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php', - 'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php', - 'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php', - 'Composer\\Installers\\ElggInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ElggInstaller.php', - 'Composer\\Installers\\EliasisInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EliasisInstaller.php', - 'Composer\\Installers\\ExpressionEngineInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php', - 'Composer\\Installers\\EzPlatformInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php', - 'Composer\\Installers\\FuelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelInstaller.php', - 'Composer\\Installers\\FuelphpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php', - 'Composer\\Installers\\GravInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/GravInstaller.php', - 'Composer\\Installers\\HuradInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/HuradInstaller.php', - 'Composer\\Installers\\ImageCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php', - 'Composer\\Installers\\Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Installer.php', - 'Composer\\Installers\\ItopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ItopInstaller.php', - 'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php', - 'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php', - 'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php', - 'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php', - 'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php', - 'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php', - 'Composer\\Installers\\LaravelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LaravelInstaller.php', - 'Composer\\Installers\\LavaLiteInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php', - 'Composer\\Installers\\LithiumInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LithiumInstaller.php', - 'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php', - 'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php', - 'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php', - 'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php', - 'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php', - 'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php', - 'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php', - 'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php', - 'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php', - 'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php', - 'Composer\\Installers\\OntoWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php', - 'Composer\\Installers\\OsclassInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OsclassInstaller.php', - 'Composer\\Installers\\OxidInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OxidInstaller.php', - 'Composer\\Installers\\PPIInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PPIInstaller.php', - 'Composer\\Installers\\PhiftyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php', - 'Composer\\Installers\\PhpBBInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php', - 'Composer\\Installers\\PimcoreInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php', - 'Composer\\Installers\\PiwikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PiwikInstaller.php', - 'Composer\\Installers\\PlentymarketsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php', - 'Composer\\Installers\\Plugin' => $vendorDir . '/composer/installers/src/Composer/Installers/Plugin.php', - 'Composer\\Installers\\PortoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PortoInstaller.php', - 'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php', - 'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php', - 'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php', - 'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php', - 'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php', - 'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php', - 'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php', - 'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php', - 'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php', - 'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php', - 'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php', - 'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php', - 'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php', - 'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php', - 'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php', - 'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php', - 'Composer\\Installers\\VanillaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VanillaInstaller.php', - 'Composer\\Installers\\VgmcpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php', - 'Composer\\Installers\\WHMCSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php', - 'Composer\\Installers\\WolfCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php', - 'Composer\\Installers\\WordPressInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WordPressInstaller.php', - 'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php', - 'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php', - 'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php', - 'Enlimbo_Forms' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.eforms.php', - 'FieldAbstract' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/abstract.field.php', - 'FieldFactory' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.field_factory.php', - 'FormAbstract' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/abstract.form.php', - 'FormFactory' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.form_factory.php', - 'IToolset_Association' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/interface.php', - 'IToolset_Association_Query_Condition' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/interface.php', - 'IToolset_Association_Query_Element_Selector' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/element_selector/interface.php', - 'IToolset_Association_Query_Orderby' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/orderby/interface.php', - 'IToolset_Association_Query_Restriction' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/restriction/interface.php', - 'IToolset_Association_Query_Result_Transformation' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/interface.php', - 'IToolset_Cron_Event' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/cron/event_interface.php', - 'IToolset_Element' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/i_element.php', - 'IToolset_Output_Template' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/interface.php', - 'IToolset_Post' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/i_post.php', - 'IToolset_Post_Type' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/i_post_type.php', - 'IToolset_Post_Type_From_Types' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/i_post_type_from_types.php', - 'IToolset_Post_Type_Registered' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/i_post_type_registered.php', - 'IToolset_Potential_Association_Query' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/query_interface.php', - 'IToolset_Query_Condition' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/condition/interface.php', - 'IToolset_Relationship_Database_Issue' => $vendorDir . '/toolset/toolset-common/inc/m2m/database/issue/interface.php', - 'IToolset_Relationship_Definition' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/definition/interface.php', - 'IToolset_Relationship_Origin' => $vendorDir . '/toolset/toolset-common/inc/m2m/origin/interface.php', - 'IToolset_Relationship_Query_Cardinality_Match' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/interface.php', - 'IToolset_Relationship_Query_Condition' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/interface.php', - 'IToolset_Relationship_Role' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/role/interface.php', - 'IToolset_Relationship_Role_Parent_Child' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/role/parent_child_interface.php', - 'IToolset_Upgrade_Command' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/command_interface.php', - 'OTGS\\Toolset\\Common\\Condition\\Installer\\IsAvailable' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/installer/is_available.php', - 'OTGS\\Toolset\\Common\\Condition\\Installer\\IsToolsetSubscriptionValid' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/installer/is_toolset_subscription_valid.php', - 'OTGS\\Toolset\\Common\\Interop\\HandlerInterface' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/interop/handler_interface.php', - 'OTGS\\Toolset\\Common\\Interop\\Handler\\InstallerCompatibilityReporting' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/interop/handler/installer_compatibility_reporting.php', - 'OTGS\\Toolset\\Common\\Interop\\Mediator' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/interop/mediator.php', - 'OTGS\\Toolset\\Common\\M2M\\Association\\Repository' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/Repository.php', - 'OTGS\\Toolset\\Common\\M2M\\PotentialAssociation\\CardinalityPostQuery' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/cardinality_post_query.php', - 'OTGS\\Toolset\\Common\\M2M\\PotentialAssociation\\JoinManager' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/join_manager.php', - 'OTGS\\Toolset\\Common\\M2M\\PotentialAssociation\\WpQueryAdjustment' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/wp_query_adjustment.php', - 'OTGS\\Toolset\\Common\\M2M\\PublicApiService' => $vendorDir . '/toolset/toolset-common/inc/m2m/public_api_service.php', - 'OTGS\\Toolset\\Common\\MaintenanceMode\\Controller' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/maintenance_mode/controller.php', - 'OTGS\\Toolset\\Common\\Utility\\Admin\\Notices\\Builder' => $vendorDir . '/toolset/toolset-common/utility/admin/notices/Builder.php', - 'ReCaptchaResponse' => $vendorDir . '/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/recaptchalib.php', - 'Toolset_Admin_Bar_Menu' => $vendorDir . '/toolset/toolset-common/inc/toolset.admin.bar.menu.class.php', - 'Toolset_Admin_Controller' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/admin.php', - 'Toolset_Admin_Notice_Abstract' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/abstract.php', - 'Toolset_Admin_Notice_Dismissible' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/dismissible.php', - 'Toolset_Admin_Notice_Error' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/error.php', - 'Toolset_Admin_Notice_Interface' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/interface.php', - 'Toolset_Admin_Notice_Layouts_Help' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/layouts/help.php', - 'Toolset_Admin_Notice_Required_Action' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/required/action.php', - 'Toolset_Admin_Notice_Success' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/success.php', - 'Toolset_Admin_Notice_Undismissible' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/undismissible.php', - 'Toolset_Admin_Notice_Warning' => $vendorDir . '/toolset/toolset-common/utility/admin/notice/warning.php', - 'Toolset_Admin_Notices_Manager' => $vendorDir . '/toolset/toolset-common/utility/admin/notices/manager.php', - 'Toolset_Ajax' => $vendorDir . '/toolset/toolset-common/inc/toolset.ajax.class.php', - 'Toolset_Ajax_Handler_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/abstract.php', - 'Toolset_Ajax_Handler_Get_Content_Template_Block_Preview' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_ct_block_preview.php', - 'Toolset_Ajax_Handler_Get_Post_By_Id' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_post_by_id.php', - 'Toolset_Ajax_Handler_Get_Term_By_Id' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_term_by_id.php', - 'Toolset_Ajax_Handler_Get_User_By_Id' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_user_by_id.php', - 'Toolset_Ajax_Handler_Get_View_Block_Preview' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_view_block_preview.php', - 'Toolset_Ajax_Handler_Interface' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/interface.php', - 'Toolset_Ajax_Handler_Intermediary_Post_Cleanup' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/intermediary_post_cleanup.php', - 'Toolset_Ajax_Handler_Migrate_To_M2M' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/migrate_to_m2m.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Posts_By_Post_Type' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_posts_by_post_type.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Posts_By_Title' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_posts_by_title.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Terms' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_terms.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Users' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_users.php', - 'Toolset_ArrayUtils' => $vendorDir . '/toolset/toolset-common/utility/utils.php', - 'Toolset_Asset_Manager' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/asset_manager.php', - 'Toolset_Assets_Manager' => $vendorDir . '/toolset/toolset-common/inc/toolset.assets.manager.class.php', - 'Toolset_Association' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/association.php', - 'Toolset_Association_Cleanup_Association' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/association.php', - 'Toolset_Association_Cleanup_Cron_Event' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/cron_event.php', - 'Toolset_Association_Cleanup_Cron_Handler' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/cron_handler.php', - 'Toolset_Association_Cleanup_Dangling_Intermediary_Posts' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/dangling_intermediary_posts.php', - 'Toolset_Association_Cleanup_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/factory.php', - 'Toolset_Association_Cleanup_Post' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/post.php', - 'Toolset_Association_Cleanup_Post_Type' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/post_type.php', - 'Toolset_Association_Cleanup_Troubleshooting_Section' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/cleanup/troubleshooting_section.php', - 'Toolset_Association_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/factory.php', - 'Toolset_Association_Intermediary_Post_Persistence' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/intermediary_post_persistence.php', - 'Toolset_Association_Persistence' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/persistence.php', - 'Toolset_Association_Query' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/association_query.php', - 'Toolset_Association_Query_Condition' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/abstract.php', - 'Toolset_Association_Query_Condition_Association_Id' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/association_id.php', - 'Toolset_Association_Query_Condition_Element_Id' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/element_id.php', - 'Toolset_Association_Query_Condition_Element_Id_And_Domain' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/element_id_and_domain.php', - 'Toolset_Association_Query_Condition_Element_Status' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/element_status.php', - 'Toolset_Association_Query_Condition_Empty_Intermediary' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/empty_intermediary.php', - 'Toolset_Association_Query_Condition_Exclude_Element' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/exclude_element.php', - 'Toolset_Association_Query_Condition_Exclude_Relationship' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/exclude_relationship.php', - 'Toolset_Association_Query_Condition_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition_factory.php', - 'Toolset_Association_Query_Condition_Has_Active_Relationship' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/has_active_relationship.php', - 'Toolset_Association_Query_Condition_Has_Domain' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/has_domain.php', - 'Toolset_Association_Query_Condition_Has_Domain_And_Type' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/has_domain_and_type.php', - 'Toolset_Association_Query_Condition_Has_Intermediary_Id' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/has_intermediary_id.php', - 'Toolset_Association_Query_Condition_Has_Legacy_Relationship' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/has_legacy_relationship.php', - 'Toolset_Association_Query_Condition_Has_Type' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/has_type.php', - 'Toolset_Association_Query_Condition_Intermediary_Id' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/intermediary_id.php', - 'Toolset_Association_Query_Condition_Postmeta' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/postmeta.php', - 'Toolset_Association_Query_Condition_Relationship_Flag' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/relationship_flag.php', - 'Toolset_Association_Query_Condition_Relationship_Id' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/relationship_id.php', - 'Toolset_Association_Query_Condition_Relationship_Origin' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/relationship_origin.php', - 'Toolset_Association_Query_Condition_Search' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/search.php', - 'Toolset_Association_Query_Condition_Wp_Query' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/condition/wp_query.php', - 'Toolset_Association_Query_Element_Selector_Abstract' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/element_selector/abstract.php', - 'Toolset_Association_Query_Element_Selector_Default' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/element_selector/default.php', - 'Toolset_Association_Query_Element_Selector_Provider' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/element_selector/provider.php', - 'Toolset_Association_Query_Element_Selector_Wpml' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/element_selector/wpml.php', - 'Toolset_Association_Query_Element_Selector_Wpml_Lang_All' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/element_selector/wpml_lang_all.php', - 'Toolset_Association_Query_Orderby' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/orderby/abstract.php', - 'Toolset_Association_Query_Orderby_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/orderby_factory.php', - 'Toolset_Association_Query_Orderby_Nothing' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/orderby/nothing.php', - 'Toolset_Association_Query_Orderby_Postmeta' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/orderby/postmeta.php', - 'Toolset_Association_Query_Orderby_Title' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/orderby/title.php', - 'Toolset_Association_Query_Result_Transformation_Association_Instance' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/association_instance.php', - 'Toolset_Association_Query_Result_Transformation_Association_Uid' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/association_uid.php', - 'Toolset_Association_Query_Result_Transformation_Element_Id' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/element_id.php', - 'Toolset_Association_Query_Result_Transformation_Element_Instance' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/element_instance.php', - 'Toolset_Association_Query_Sql_Expression_Builder' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/sql_expression_builder.php', - 'Toolset_Association_Query_Table_Join_Manager' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/table_join_manager.php', - 'Toolset_Association_Query_V2' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/association_query_v2.php', - 'Toolset_Association_Query_Wpdb_Wrapper' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/query/wpdb_wrapper.php', - 'Toolset_Association_Translator' => $vendorDir . '/toolset/toolset-common/inc/m2m/association/translator.php', - 'Toolset_Blocks' => $vendorDir . '/toolset/toolset-common/toolset-blocks/toolset-blocks.php', - 'Toolset_Blocks_Content_Template' => $vendorDir . '/toolset/toolset-common/toolset-blocks/blocks/ct/ct.php', - 'Toolset_Blocks_Custom_HTML' => $vendorDir . '/toolset/toolset-common/toolset-blocks/blocks/custom-html/custom-html.php', - 'Toolset_Blocks_View' => $vendorDir . '/toolset/toolset-common/toolset-blocks/blocks/view/view.php', - 'Toolset_Bootstrap_Loader' => $vendorDir . '/toolset/toolset-common/inc/toolset.bootstrap.loader.class.php', - 'Toolset_Common_Autoloader' => $vendorDir . '/toolset/toolset-common/utility/autoloader.php', - 'Toolset_Common_Bootstrap' => $vendorDir . '/toolset/toolset-common/bootstrap.php', - 'Toolset_Condition_Interface' => $vendorDir . '/toolset/toolset-common/utility/condition/interface.php', - 'Toolset_Condition_Plugin_Access_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/access/active.php', - 'Toolset_Condition_Plugin_Access_Missing' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/access/missing.php', - 'Toolset_Condition_Plugin_Cred_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/cred/active.php', - 'Toolset_Condition_Plugin_Cred_Missing' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/cred/missing.php', - 'Toolset_Condition_Plugin_Encrypted_No_Valid_Theme' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/encrypted/no-valid-theme.php', - 'Toolset_Condition_Plugin_Layouts_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/layouts/active.php', - 'Toolset_Condition_Plugin_Layouts_Missing' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/layouts/missing.php', - 'Toolset_Condition_Plugin_Layouts_No_Items' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/layouts/no-items.php', - 'Toolset_Condition_Plugin_Types_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/types/active.php', - 'Toolset_Condition_Plugin_Types_Has_Legacy_Relationships' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/types/has_legacy_relationships.php', - 'Toolset_Condition_Plugin_Types_Missing' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/types/missing.php', - 'Toolset_Condition_Plugin_Types_Ready_For_M2M' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/types/ready_for_m2m.php', - 'Toolset_Condition_Plugin_Views_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/views/active.php', - 'Toolset_Condition_Plugin_Views_Missing' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/views/missing.php', - 'Toolset_Condition_Plugin_Wpml_Doesnt_Support_M2m' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/wpml/doesnt_support_m2m.php', - 'Toolset_Condition_Plugin_Wpml_Is_Active_And_Configured' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/wpml/is_active_and_configured.php', - 'Toolset_Condition_Plugin_Wpml_Is_Current_Language_Default' => $vendorDir . '/toolset/toolset-common/utility/condition/plugin/wpml/is_current_language_default.php', - 'Toolset_Condition_Theme_Avada_Not_Active_Or_Greater_Equal_5_0' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/avada/not-active-or-greater-equal-5-0.php', - 'Toolset_Condition_Theme_Layouts_Support_Native_Available' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/native/available.php', - 'Toolset_Condition_Theme_Layouts_Support_Native_Missing' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/native/missing.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/active.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Available' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/available.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Missing' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/missing.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Not_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/not-active.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Not_Installed' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/not-installed.php', - 'Toolset_Condition_Theme_Layouts_Support_Theme_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/theme/active.php', - 'Toolset_Condition_Theme_Layouts_Support_Theme_Installed' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/theme/installed.php', - 'Toolset_Condition_Theme_Layouts_Support_Theme_Not_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/layouts-support/theme/not-active.php', - 'Toolset_Condition_Theme_Toolset_Based_Active' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/toolset-based/active.php', - 'Toolset_Condition_Theme_Toolset_Based_Inactive' => $vendorDir . '/toolset/toolset-common/utility/condition/theme/toolset-based/inactive.php', - 'Toolset_Condition_User_Role_Admin' => $vendorDir . '/toolset/toolset-common/utility/condition/user/role/admin.php', - 'Toolset_Constants' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/constants.php', - 'Toolset_Controller_Admin_Notices' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/admin/notices.php', - 'Toolset_Cron' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/cron/cron.php', - 'Toolset_Cron_Event' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/cron/event.php', - 'Toolset_CssComponent' => $vendorDir . '/toolset/toolset-common/inc/toolset.css.component.class.php', - 'Toolset_Date' => $vendorDir . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_DateParser' => $vendorDir . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Date_Utils' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/date_utils.php', - 'Toolset_DialogBoxes' => $vendorDir . '/toolset/toolset-common/utility/dialogs/toolset.dialog-boxes.class.php', - 'Toolset_Element' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/element.php', - 'Toolset_Element_Domain' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/domain.php', - 'Toolset_Element_Exception_Element_Doesnt_Exist' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/exception_element_doesnt_exist.php', - 'Toolset_Element_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/element_factory.php', - 'Toolset_ErrorHandler' => $vendorDir . '/toolset/toolset-common/utility/utils.php', - 'Toolset_Export_Import_Screen' => $vendorDir . '/toolset/toolset-common/inc/toolset.export.import.screen.class.php', - 'Toolset_Field_Accessor_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/accessor/abstract.php', - 'Toolset_Field_Accessor_Dummy' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/accessor/dummy.php', - 'Toolset_Field_Accessor_Postmeta' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/accessor/postmeta.php', - 'Toolset_Field_Accessor_Postmeta_Field' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/accessor/postmeta_field.php', - 'Toolset_Field_Accessor_Termmeta' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/accessor/termmeta.php', - 'Toolset_Field_Accessor_Termmeta_Field' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/accessor/termmeta_field.php', - 'Toolset_Field_Data_Mapper_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/abstract.php', - 'Toolset_Field_Data_Mapper_Checkbox' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/checkbox.php', - 'Toolset_Field_Data_Mapper_Checkboxes' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/checkboxes.php', - 'Toolset_Field_Data_Mapper_Identity' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/identity.php', - 'Toolset_Field_Data_Saver' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/data_saver.php', - 'Toolset_Field_Definition' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition.php', - 'Toolset_Field_Definition_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_abstract.php', - 'Toolset_Field_Definition_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_factory.php', - 'Toolset_Field_Definition_Factory_Interface' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_interface.php', - 'Toolset_Field_Definition_Factory_Post' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_post.php', - 'Toolset_Field_Definition_Factory_Term' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_term.php', - 'Toolset_Field_Definition_Factory_User' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_user.php', - 'Toolset_Field_Definition_Generic' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_generic.php', - 'Toolset_Field_Definition_Interface' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_interface.php', - 'Toolset_Field_Definition_Post' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_post.php', - 'Toolset_Field_Definition_Term' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_term.php', - 'Toolset_Field_Definition_User' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/definition_user.php', - 'Toolset_Field_Group' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group.php', - 'Toolset_Field_Group_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group/factory.php', - 'Toolset_Field_Group_Post' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group/post.php', - 'Toolset_Field_Group_Post_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php', - 'Toolset_Field_Group_Term' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group/term.php', - 'Toolset_Field_Group_Term_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group/term_factory.php', - 'Toolset_Field_Group_User' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group/user.php', - 'Toolset_Field_Group_User_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/group/user_factory.php', - 'Toolset_Field_Instance' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/instance.php', - 'Toolset_Field_Instance_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/instance_abstract.php', - 'Toolset_Field_Instance_Post' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/instance_post.php', - 'Toolset_Field_Instance_Term' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/instance_term.php', - 'Toolset_Field_Instance_Unsaved' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/instance_unsaved.php', - 'Toolset_Field_Option_Checkboxes' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/option_checkboxes.php', - 'Toolset_Field_Option_Radio' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/option_radio.php', - 'Toolset_Field_Option_Select' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/option_select.php', - 'Toolset_Field_Renderer_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/abstract.php', - 'Toolset_Field_Renderer_Preview_Address' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/address.php', - 'Toolset_Field_Renderer_Preview_Base' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/base.php', - 'Toolset_Field_Renderer_Preview_Checkbox' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/checkbox.php', - 'Toolset_Field_Renderer_Preview_Checkboxes' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/checkboxes.php', - 'Toolset_Field_Renderer_Preview_Colorpicker' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/colorpicker.php', - 'Toolset_Field_Renderer_Preview_Date' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/date.php', - 'Toolset_Field_Renderer_Preview_File' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/file.php', - 'Toolset_Field_Renderer_Preview_Image' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/image.php', - 'Toolset_Field_Renderer_Preview_Post' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/post.php', - 'Toolset_Field_Renderer_Preview_Radio' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/radio.php', - 'Toolset_Field_Renderer_Preview_Skype' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/skype.php', - 'Toolset_Field_Renderer_Preview_Textfield' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/textfield.php', - 'Toolset_Field_Renderer_Preview_URL' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/url.php', - 'Toolset_Field_Renderer_Purpose' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/purpose.php', - 'Toolset_Field_Renderer_Toolset_Forms' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/toolset_forms.php', - 'Toolset_Field_Renderer_Toolset_Forms_Repeatable_Group' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/renderer/toolset_forms_repeatable_group.php', - 'Toolset_Field_Type_Definition' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition.php', - 'Toolset_Field_Type_Definition_Checkbox' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition/checkbox.php', - 'Toolset_Field_Type_Definition_Checkboxes' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition/checkboxes.php', - 'Toolset_Field_Type_Definition_Date' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition/date.php', - 'Toolset_Field_Type_Definition_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition_factory.php', - 'Toolset_Field_Type_Definition_Numeric' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition/numeric.php', - 'Toolset_Field_Type_Definition_Radio' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition/radio.php', - 'Toolset_Field_Type_Definition_Select' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition/select.php', - 'Toolset_Field_Type_Definition_Singular' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/type/definition/singular.php', - 'Toolset_Field_Utils' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/field/utils.php', - 'Toolset_Files' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/files.php', - 'Toolset_Functions' => $vendorDir . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Gui_Base' => $vendorDir . '/toolset/toolset-common/utility/gui-base/main.php', - 'Toolset_HelpVideo' => $vendorDir . '/toolset/toolset-common/utility/help-videos/toolset-help-videos.php', - 'Toolset_HelpVideosFactoryAbstract' => $vendorDir . '/toolset/toolset-common/utility/help-videos/toolset-help-videos.php', - 'Toolset_Internal_Compatibility' => $vendorDir . '/toolset/toolset-common/inc/toolset.internal.compatibility.class.php', - 'Toolset_Localization' => $vendorDir . '/toolset/toolset-common/inc/toolset.localization.class.php', - 'Toolset_Menu' => $vendorDir . '/toolset/toolset-common/inc/toolset.menu.class.php', - 'Toolset_Naming_Helper' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/naming_helper.php', - 'Toolset_Object_Relationship' => $vendorDir . '/toolset/toolset-common/inc/toolset.object.relationship.class.php', - 'Toolset_Output_Template' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/abstract.php', - 'Toolset_Output_Template_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template_factory.php', - 'Toolset_Output_Template_Phtml' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/phtml.php', - 'Toolset_Output_Template_Repository' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template_repository.php', - 'Toolset_Output_Template_Repository_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template_repository_abstract.php', - 'Toolset_Output_Template_Static' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/static.php', - 'Toolset_Output_Template_Twig' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/twig.php', - 'Toolset_Parser' => $vendorDir . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Post' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/post.php', - 'Toolset_Post_Translation_Set' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/element/post_translation_set.php', - 'Toolset_Post_Type_Abstract' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/abstract.php', - 'Toolset_Post_Type_Exclude_List' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/excluded_list.php', - 'Toolset_Post_Type_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/factory.php', - 'Toolset_Post_Type_From_Types' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/from_types.php', - 'Toolset_Post_Type_Labels' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/labels.php', - 'Toolset_Post_Type_List' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/list.php', - 'Toolset_Post_Type_Query' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/query.php', - 'Toolset_Post_Type_Query_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/query_factory.php', - 'Toolset_Post_Type_Registered' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/registered.php', - 'Toolset_Post_Type_Repository' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/post_type/repository.php', - 'Toolset_Postmeta_Access_Loader' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/postmeta_access/loader.php', - 'Toolset_Postmeta_Access_M2m' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/postmeta_access/m2m.php', - 'Toolset_Potential_Association_Query_Arguments' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/query_arguments.php', - 'Toolset_Potential_Association_Query_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/query_factory.php', - 'Toolset_Potential_Association_Query_Filter_Interface' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/filters/interface.php', - 'Toolset_Potential_Association_Query_Filter_Posts_Author' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/filters/post/author.php', - 'Toolset_Potential_Association_Query_Filter_Search_String' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/filters/search_string.php', - 'Toolset_Potential_Association_Query_Posts' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/query_posts.php', - 'Toolset_Promotion' => $vendorDir . '/toolset/toolset-common/inc/toolset.promotion.class.php', - 'Toolset_Public_API_Loader' => $vendorDir . '/toolset/toolset-common/inc/public_api/loader.php', - 'Toolset_Query_Comparison_Operator' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/comparison_operator.php', - 'Toolset_Query_Condition_And' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/condition/and.php', - 'Toolset_Query_Condition_Contradiction' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/condition/contradiction.php', - 'Toolset_Query_Condition_Not' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/condition/not.php', - 'Toolset_Query_Condition_Operator' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/condition/operator.php', - 'Toolset_Query_Condition_Or' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/condition/or.php', - 'Toolset_Query_Condition_Tautology' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/condition/tautology.php', - 'Toolset_Regex' => $vendorDir . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Relationship_Cardinality' => $vendorDir . '/toolset/toolset-common/inc/m2m/cardinality.php', - 'Toolset_Relationship_Controller' => $vendorDir . '/toolset/toolset-common/inc/m2m/controller.php', - 'Toolset_Relationship_Database_Issue_Missing_Element' => $vendorDir . '/toolset/toolset-common/inc/m2m/database/issue/missing_element.php', - 'Toolset_Relationship_Database_Operations' => $vendorDir . '/toolset/toolset-common/inc/m2m/database/operations.php', - 'Toolset_Relationship_Database_Unique_Table_Alias' => $vendorDir . '/toolset/toolset-common/inc/m2m/database/unique_table_alias.php', - 'Toolset_Relationship_Definition' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/definition/definition.php', - 'Toolset_Relationship_Definition_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/definition/factory.php', - 'Toolset_Relationship_Definition_Persistence' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/definition/persistence.php', - 'Toolset_Relationship_Definition_Repository' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/definition/repository.php', - 'Toolset_Relationship_Definition_Translator' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/definition/translator.php', - 'Toolset_Relationship_Distinct_Post_Query' => $vendorDir . '/toolset/toolset-common/inc/m2m/potential_association/distinct_post_query.php', - 'Toolset_Relationship_Driver' => $vendorDir . '/toolset/toolset-common/inc/m2m/driver.php', - 'Toolset_Relationship_Driver_Base' => $vendorDir . '/toolset/toolset-common/inc/m2m/driver_base.php', - 'Toolset_Relationship_Element_Type' => $vendorDir . '/toolset/toolset-common/inc/m2m/element_type.php', - 'Toolset_Relationship_Migration' => $vendorDir . '/toolset/toolset-common/inc/m2m/migration/controller.php', - 'Toolset_Relationship_Migration_Associations' => $vendorDir . '/toolset/toolset-common/inc/m2m/migration/associations.php', - 'Toolset_Relationship_Migration_Controller' => $vendorDir . '/toolset/toolset-common/inc/m2m/migration/controller.php', - 'Toolset_Relationship_Migration_Post_Translation' => $vendorDir . '/toolset/toolset-common/inc/m2m/migration/post_translation.php', - 'Toolset_Relationship_Origin_Post_Reference_Field' => $vendorDir . '/toolset/toolset-common/inc/m2m/origin/post_reference_field.php', - 'Toolset_Relationship_Origin_Repeatable_Group' => $vendorDir . '/toolset/toolset-common/inc/m2m/origin/repeatable_group.php', - 'Toolset_Relationship_Origin_Wizard' => $vendorDir . '/toolset/toolset-common/inc/m2m/origin/wizard.php', - 'Toolset_Relationship_Query' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/relationship_query.php', - 'Toolset_Relationship_Query_Base' => $vendorDir . '/toolset/toolset-common/inc/m2m/query_base.php', - 'Toolset_Relationship_Query_Cache' => $vendorDir . '/toolset/toolset-common/inc/m2m/query_cache.php', - 'Toolset_Relationship_Query_Cardinality_Match_Conjunction' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/conjunction.php', - 'Toolset_Relationship_Query_Cardinality_Match_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/factory.php', - 'Toolset_Relationship_Query_Cardinality_Match_Operators' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/operators.php', - 'Toolset_Relationship_Query_Cardinality_Match_Single' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/single.php', - 'Toolset_Relationship_Query_Condition' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/abstract.php', - 'Toolset_Relationship_Query_Condition_Exclude_Relationship' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/exclude_relationship.php', - 'Toolset_Relationship_Query_Condition_Exclude_Type' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/exclude_type.php', - 'Toolset_Relationship_Query_Condition_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition_factory.php', - 'Toolset_Relationship_Query_Condition_Has_Active_Types' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/has_active_types.php', - 'Toolset_Relationship_Query_Condition_Has_Cardinality' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/has_cardinality.php', - 'Toolset_Relationship_Query_Condition_Has_Domain' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/has_domain.php', - 'Toolset_Relationship_Query_Condition_Intermediary_Type' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/intermediary_type.php', - 'Toolset_Relationship_Query_Condition_Is_Active' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/is_active.php', - 'Toolset_Relationship_Query_Condition_Is_Boolean_Flag' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/is_boolean_flag.php', - 'Toolset_Relationship_Query_Condition_Is_Legacy' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/is_legacy.php', - 'Toolset_Relationship_Query_Condition_Origin' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/origin.php', - 'Toolset_Relationship_Query_Condition_Type' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php', - 'Toolset_Relationship_Query_Factory' => $vendorDir . '/toolset/toolset-common/inc/m2m/query/factory.php', - 'Toolset_Relationship_Query_Sql_Expression_Builder' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/sql_expression_builder.php', - 'Toolset_Relationship_Query_V2' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/query/relationship_query_v2.php', - 'Toolset_Relationship_Role' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/role/role.php', - 'Toolset_Relationship_Role_Abstract' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/role/abstract.php', - 'Toolset_Relationship_Role_Child' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/role/child.php', - 'Toolset_Relationship_Role_Intermediary' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/role/intermediary.php', - 'Toolset_Relationship_Role_Parent' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/role/parent.php', - 'Toolset_Relationship_Scope' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/scope.php', - 'Toolset_Relationship_Service' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/relationship_service.php', - 'Toolset_Relationship_Slug_Validator' => $vendorDir . '/toolset/toolset-common/inc/m2m/relationship/slug_validator.php', - 'Toolset_Relationship_Table_Name' => $vendorDir . '/toolset/toolset-common/inc/m2m/database/table_name.php', - 'Toolset_Relationship_Utils' => $vendorDir . '/toolset/toolset-common/inc/m2m/utils.php', - 'Toolset_Relevanssi_Compatibility' => $vendorDir . '/toolset/toolset-common/inc/toolset.relevanssi.compatibility.class.php', - 'Toolset_Renderer' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/renderer/renderer.php', - 'Toolset_Result' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/result.php', - 'Toolset_Result_Set' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/result_set.php', - 'Toolset_Result_Updated' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/result_updated.php', - 'Toolset_Script' => $vendorDir . '/toolset/toolset-common/inc/toolset.assets.manager.class.php', - 'Toolset_Settings' => $vendorDir . '/toolset/toolset-common/inc/toolset.settings.class.php', - 'Toolset_Settings_Screen' => $vendorDir . '/toolset/toolset-common/inc/toolset.settings.screen.class.php', - 'Toolset_Shortcode_Attr_Field' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/field.php', - 'Toolset_Shortcode_Attr_Interface' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/interface.php', - 'Toolset_Shortcode_Attr_Item_Gui_Base' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/base.php', - 'Toolset_Shortcode_Attr_Item_Gui_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/factory.php', - 'Toolset_Shortcode_Attr_Item_Gui_M2m' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/m2m.php', - 'Toolset_Shortcode_Attr_Item_Gui_O2m' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/o2m.php', - 'Toolset_Shortcode_Attr_Item_Gui_O2o' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/o2o.php', - 'Toolset_Shortcode_Attr_Item_Gui_Option' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/option.php', - 'Toolset_Shortcode_Attr_Item_Id' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/id.php', - 'Toolset_Shortcode_Attr_Item_Legacy' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/legacy.php', - 'Toolset_Shortcode_Attr_Item_M2M' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/m2m.php', - 'Toolset_Shortcode_Generator' => $vendorDir . '/toolset/toolset-common/inc/toolset.shortcode.generator.class.php', - 'Toolset_Shortcode_Transformer' => $vendorDir . '/toolset/toolset-common/inc/toolset.shortcode.transformer.class.php', - 'Toolset_Singleton_Factory' => $vendorDir . '/toolset/toolset-common/utility/singleton_factory_pre_php_5_6.php', - 'Toolset_Stack' => $vendorDir . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Style' => $vendorDir . '/toolset/toolset-common/inc/toolset.assets.manager.class.php', - 'Toolset_Template_Dialog_Box' => $vendorDir . '/toolset/toolset-common/utility/gui-base/template_dialog_box.php', - 'Toolset_Tokenizer' => $vendorDir . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Twig_Autoloader' => $vendorDir . '/toolset/toolset-common/utility/gui-base/twig_autoloader.php', - 'Toolset_Twig_Dialog_Box' => $vendorDir . '/toolset/toolset-common/utility/gui-base/twig_dialog_box.php', - 'Toolset_Twig_Dialog_Box_Factory' => $vendorDir . '/toolset/toolset-common/utility/gui-base/twig_dialog_box_factory.php', - 'Toolset_Twig_Extensions' => $vendorDir . '/toolset/toolset-common/utility/gui-base/twig_extensions.php', - 'Toolset_Upgrade_Command_Definition' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/command_definition.php', - 'Toolset_Upgrade_Command_Definition_Repository' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/command_definition_repository.php', - 'Toolset_Upgrade_Command_Delete_Obsolete_Upgrade_Options' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/command/delete_obsolete_version_number_option.php', - 'Toolset_Upgrade_Command_Factory' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/command_factory.php', - 'Toolset_Upgrade_Command_M2M_V1_Database_Structure_Upgrade' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/command/m2m_v1_database_structure_upgrade.php', - 'Toolset_Upgrade_Command_M2M_V2_Database_Structure_Upgrade' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/command/m2m_v2_database_structure_upgrade.php', - 'Toolset_Upgrade_Controller' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/controller.php', - 'Toolset_Upgrade_Executed_Commands' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/upgrade/executed_commands.php', - 'Toolset_User_Editors_Editor_Abstract' => $vendorDir . '/toolset/toolset-common/user-editors/editor/abstract.php', - 'Toolset_User_Editors_Editor_Avada' => $vendorDir . '/toolset/toolset-common/user-editors/editor/avada.php', - 'Toolset_User_Editors_Editor_Basic' => $vendorDir . '/toolset/toolset-common/user-editors/editor/basic.php', - 'Toolset_User_Editors_Editor_Beaver' => $vendorDir . '/toolset/toolset-common/user-editors/editor/beaver.php', - 'Toolset_User_Editors_Editor_Divi' => $vendorDir . '/toolset/toolset-common/user-editors/editor/divi.php', - 'Toolset_User_Editors_Editor_Gutenberg' => $vendorDir . '/toolset/toolset-common/user-editors/editor/gutenberg.php', - 'Toolset_User_Editors_Editor_Interface' => $vendorDir . '/toolset/toolset-common/user-editors/editor/interface.php', - 'Toolset_User_Editors_Editor_Native' => $vendorDir . '/toolset/toolset-common/user-editors/editor/native.php', - 'Toolset_User_Editors_Editor_Screen_Abstract' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/abstract.php', - 'Toolset_User_Editors_Editor_Screen_Avada_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/avada/backend.php', - 'Toolset_User_Editors_Editor_Screen_Basic_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/basic/backend.php', - 'Toolset_User_Editors_Editor_Screen_Beaver_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/beaver/backend.php', - 'Toolset_User_Editors_Editor_Screen_Beaver_Frontend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php', - 'Toolset_User_Editors_Editor_Screen_Beaver_Frontend_Editor' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/beaver/frontend-editor.php', - 'Toolset_User_Editors_Editor_Screen_Divi_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/divi/backend.php', - 'Toolset_User_Editors_Editor_Screen_Divi_Frontend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/divi/frontend.php', - 'Toolset_User_Editors_Editor_Screen_Gutenberg_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.php', - 'Toolset_User_Editors_Editor_Screen_Interface' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/interface.php', - 'Toolset_User_Editors_Editor_Screen_Native_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/native/backend.php', - 'Toolset_User_Editors_Editor_Screen_Visual_Composer_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.php', - 'Toolset_User_Editors_Editor_Screen_Visual_Composer_Frontend' => $vendorDir . '/toolset/toolset-common/user-editors/editor/screen/visual-composer/frontend.php', - 'Toolset_User_Editors_Editor_Visual_Composer' => $vendorDir . '/toolset/toolset-common/user-editors/editor/visual-composer.php', - 'Toolset_User_Editors_Manager' => $vendorDir . '/toolset/toolset-common/user-editors/manager.php', - 'Toolset_User_Editors_Manager_Interface' => $vendorDir . '/toolset/toolset-common/user-editors/interface.php', - 'Toolset_User_Editors_Medium_Abstract' => $vendorDir . '/toolset/toolset-common/user-editors/medium/abstract.php', - 'Toolset_User_Editors_Medium_Content_Template' => $vendorDir . '/toolset/toolset-common/user-editors/medium/content-template.php', - 'Toolset_User_Editors_Medium_Interface' => $vendorDir . '/toolset/toolset-common/user-editors/medium/interface.php', - 'Toolset_User_Editors_Medium_Screen_Abstract' => $vendorDir . '/toolset/toolset-common/user-editors/medium/screen/abstract.php', - 'Toolset_User_Editors_Medium_Screen_Content_Template_Backend' => $vendorDir . '/toolset/toolset-common/user-editors/medium/screen/content-template/backend.php', - 'Toolset_User_Editors_Medium_Screen_Content_Template_Frontend' => $vendorDir . '/toolset/toolset-common/user-editors/medium/screen/content-template/frontend.php', - 'Toolset_User_Editors_Medium_Screen_Content_Template_Frontend_Editor' => $vendorDir . '/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.php', - 'Toolset_User_Editors_Medium_Screen_Interface' => $vendorDir . '/toolset/toolset-common/user-editors/medium/screen/interface.php', - 'Toolset_Utils' => $vendorDir . '/toolset/toolset-common/utility/utils.php', - 'Toolset_VideoDetachedPage' => $vendorDir . '/toolset/toolset-common/utility/help-videos/toolset-help-videos.php', - 'Toolset_WPLogger' => $vendorDir . '/toolset/toolset-common/inc/toolset.wplogger.class.php', - 'Toolset_WPML_Compatibility' => $vendorDir . '/toolset/toolset-common/inc/toolset.wpml.compatibility.class.php', - 'Toolset_Wp_Query_Adjustments' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/abstract.php', - 'Toolset_Wp_Query_Adjustments_Legacy_Relationships' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/legacy_relationships.php', - 'Toolset_Wp_Query_Adjustments_Loader' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/loader.php', - 'Toolset_Wp_Query_Adjustments_M2m' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/m2m.php', - 'Toolset_Wp_Query_Adjustments_Table_Join_Manager' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/table_join_manager.php', - 'Toolset_Wpdb_User' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/wpdb_user.php', - 'Toolset_Wpml_Utils' => $vendorDir . '/toolset/toolset-common/inc/autoloaded/wpml_utils.php', - 'Twig_Autoloader' => $vendorDir . '/twig/twig/lib/Twig/Autoloader.php', - 'Twig_BaseNodeVisitor' => $vendorDir . '/twig/twig/lib/Twig/BaseNodeVisitor.php', - 'Twig_CacheInterface' => $vendorDir . '/twig/twig/lib/Twig/CacheInterface.php', - 'Twig_Cache_Filesystem' => $vendorDir . '/twig/twig/lib/Twig/Cache/Filesystem.php', - 'Twig_Cache_Null' => $vendorDir . '/twig/twig/lib/Twig/Cache/Null.php', - 'Twig_Compiler' => $vendorDir . '/twig/twig/lib/Twig/Compiler.php', - 'Twig_CompilerInterface' => $vendorDir . '/twig/twig/lib/Twig/CompilerInterface.php', - 'Twig_ContainerRuntimeLoader' => $vendorDir . '/twig/twig/lib/Twig/ContainerRuntimeLoader.php', - 'Twig_Environment' => $vendorDir . '/twig/twig/lib/Twig/Environment.php', - 'Twig_Error' => $vendorDir . '/twig/twig/lib/Twig/Error.php', - 'Twig_Error_Loader' => $vendorDir . '/twig/twig/lib/Twig/Error/Loader.php', - 'Twig_Error_Runtime' => $vendorDir . '/twig/twig/lib/Twig/Error/Runtime.php', - 'Twig_Error_Syntax' => $vendorDir . '/twig/twig/lib/Twig/Error/Syntax.php', - 'Twig_ExistsLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/ExistsLoaderInterface.php', - 'Twig_ExpressionParser' => $vendorDir . '/twig/twig/lib/Twig/ExpressionParser.php', - 'Twig_Extension' => $vendorDir . '/twig/twig/lib/Twig/Extension.php', - 'Twig_ExtensionInterface' => $vendorDir . '/twig/twig/lib/Twig/ExtensionInterface.php', - 'Twig_Extension_Core' => $vendorDir . '/twig/twig/lib/Twig/Extension/Core.php', - 'Twig_Extension_Debug' => $vendorDir . '/twig/twig/lib/Twig/Extension/Debug.php', - 'Twig_Extension_Escaper' => $vendorDir . '/twig/twig/lib/Twig/Extension/Escaper.php', - 'Twig_Extension_GlobalsInterface' => $vendorDir . '/twig/twig/lib/Twig/Extension/GlobalsInterface.php', - 'Twig_Extension_InitRuntimeInterface' => $vendorDir . '/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php', - 'Twig_Extension_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/Extension/Optimizer.php', - 'Twig_Extension_Profiler' => $vendorDir . '/twig/twig/lib/Twig/Extension/Profiler.php', - 'Twig_Extension_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Extension/Sandbox.php', - 'Twig_Extension_Staging' => $vendorDir . '/twig/twig/lib/Twig/Extension/Staging.php', - 'Twig_Extension_StringLoader' => $vendorDir . '/twig/twig/lib/Twig/Extension/StringLoader.php', - 'Twig_FactoryRuntimeLoader' => $vendorDir . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php', - 'Twig_FileExtensionEscapingStrategy' => $vendorDir . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php', - 'Twig_Filter' => $vendorDir . '/twig/twig/lib/Twig/Filter.php', - 'Twig_FilterCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterCallableInterface.php', - 'Twig_FilterInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterInterface.php', - 'Twig_Filter_Function' => $vendorDir . '/twig/twig/lib/Twig/Filter/Function.php', - 'Twig_Filter_Method' => $vendorDir . '/twig/twig/lib/Twig/Filter/Method.php', - 'Twig_Filter_Node' => $vendorDir . '/twig/twig/lib/Twig/Filter/Node.php', - 'Twig_Function' => $vendorDir . '/twig/twig/lib/Twig/Function.php', - 'Twig_FunctionCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionCallableInterface.php', - 'Twig_FunctionInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionInterface.php', - 'Twig_Function_Function' => $vendorDir . '/twig/twig/lib/Twig/Function/Function.php', - 'Twig_Function_Method' => $vendorDir . '/twig/twig/lib/Twig/Function/Method.php', - 'Twig_Function_Node' => $vendorDir . '/twig/twig/lib/Twig/Function/Node.php', - 'Twig_Lexer' => $vendorDir . '/twig/twig/lib/Twig/Lexer.php', - 'Twig_LexerInterface' => $vendorDir . '/twig/twig/lib/Twig/LexerInterface.php', - 'Twig_LoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/LoaderInterface.php', - 'Twig_Loader_Array' => $vendorDir . '/twig/twig/lib/Twig/Loader/Array.php', - 'Twig_Loader_Chain' => $vendorDir . '/twig/twig/lib/Twig/Loader/Chain.php', - 'Twig_Loader_Filesystem' => $vendorDir . '/twig/twig/lib/Twig/Loader/Filesystem.php', - 'Twig_Loader_String' => $vendorDir . '/twig/twig/lib/Twig/Loader/String.php', - 'Twig_Markup' => $vendorDir . '/twig/twig/lib/Twig/Markup.php', - 'Twig_Node' => $vendorDir . '/twig/twig/lib/Twig/Node.php', - 'Twig_NodeCaptureInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeCaptureInterface.php', - 'Twig_NodeInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeInterface.php', - 'Twig_NodeOutputInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeOutputInterface.php', - 'Twig_NodeTraverser' => $vendorDir . '/twig/twig/lib/Twig/NodeTraverser.php', - 'Twig_NodeVisitorInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitorInterface.php', - 'Twig_NodeVisitor_Escaper' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Escaper.php', - 'Twig_NodeVisitor_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Optimizer.php', - 'Twig_NodeVisitor_SafeAnalysis' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php', - 'Twig_NodeVisitor_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Sandbox.php', - 'Twig_Node_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/Node/AutoEscape.php', - 'Twig_Node_Block' => $vendorDir . '/twig/twig/lib/Twig/Node/Block.php', - 'Twig_Node_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/BlockReference.php', - 'Twig_Node_Body' => $vendorDir . '/twig/twig/lib/Twig/Node/Body.php', - 'Twig_Node_CheckSecurity' => $vendorDir . '/twig/twig/lib/Twig/Node/CheckSecurity.php', - 'Twig_Node_Do' => $vendorDir . '/twig/twig/lib/Twig/Node/Do.php', - 'Twig_Node_Embed' => $vendorDir . '/twig/twig/lib/Twig/Node/Embed.php', - 'Twig_Node_Expression' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression.php', - 'Twig_Node_Expression_Array' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Array.php', - 'Twig_Node_Expression_AssignName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/AssignName.php', - 'Twig_Node_Expression_Binary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary.php', - 'Twig_Node_Expression_Binary_Add' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Add.php', - 'Twig_Node_Expression_Binary_And' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/And.php', - 'Twig_Node_Expression_Binary_BitwiseAnd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php', - 'Twig_Node_Expression_Binary_BitwiseOr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php', - 'Twig_Node_Expression_Binary_BitwiseXor' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php', - 'Twig_Node_Expression_Binary_Concat' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php', - 'Twig_Node_Expression_Binary_Div' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Div.php', - 'Twig_Node_Expression_Binary_EndsWith' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php', - 'Twig_Node_Expression_Binary_Equal' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php', - 'Twig_Node_Expression_Binary_FloorDiv' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php', - 'Twig_Node_Expression_Binary_Greater' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php', - 'Twig_Node_Expression_Binary_GreaterEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php', - 'Twig_Node_Expression_Binary_In' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/In.php', - 'Twig_Node_Expression_Binary_Less' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Less.php', - 'Twig_Node_Expression_Binary_LessEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php', - 'Twig_Node_Expression_Binary_Matches' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php', - 'Twig_Node_Expression_Binary_Mod' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php', - 'Twig_Node_Expression_Binary_Mul' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php', - 'Twig_Node_Expression_Binary_NotEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php', - 'Twig_Node_Expression_Binary_NotIn' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php', - 'Twig_Node_Expression_Binary_Or' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Or.php', - 'Twig_Node_Expression_Binary_Power' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Power.php', - 'Twig_Node_Expression_Binary_Range' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Range.php', - 'Twig_Node_Expression_Binary_StartsWith' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php', - 'Twig_Node_Expression_Binary_Sub' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php', - 'Twig_Node_Expression_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/BlockReference.php', - 'Twig_Node_Expression_Call' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Call.php', - 'Twig_Node_Expression_Conditional' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Conditional.php', - 'Twig_Node_Expression_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Constant.php', - 'Twig_Node_Expression_ExtensionReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php', - 'Twig_Node_Expression_Filter' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter.php', - 'Twig_Node_Expression_Filter_Default' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter/Default.php', - 'Twig_Node_Expression_Function' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Function.php', - 'Twig_Node_Expression_GetAttr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/GetAttr.php', - 'Twig_Node_Expression_MethodCall' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/MethodCall.php', - 'Twig_Node_Expression_Name' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Name.php', - 'Twig_Node_Expression_NullCoalesce' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php', - 'Twig_Node_Expression_Parent' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Parent.php', - 'Twig_Node_Expression_TempName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/TempName.php', - 'Twig_Node_Expression_Test' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test.php', - 'Twig_Node_Expression_Test_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Constant.php', - 'Twig_Node_Expression_Test_Defined' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Defined.php', - 'Twig_Node_Expression_Test_Divisibleby' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php', - 'Twig_Node_Expression_Test_Even' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Even.php', - 'Twig_Node_Expression_Test_Null' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Null.php', - 'Twig_Node_Expression_Test_Odd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Odd.php', - 'Twig_Node_Expression_Test_Sameas' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php', - 'Twig_Node_Expression_Unary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary.php', - 'Twig_Node_Expression_Unary_Neg' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php', - 'Twig_Node_Expression_Unary_Not' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Not.php', - 'Twig_Node_Expression_Unary_Pos' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php', - 'Twig_Node_Flush' => $vendorDir . '/twig/twig/lib/Twig/Node/Flush.php', - 'Twig_Node_For' => $vendorDir . '/twig/twig/lib/Twig/Node/For.php', - 'Twig_Node_ForLoop' => $vendorDir . '/twig/twig/lib/Twig/Node/ForLoop.php', - 'Twig_Node_If' => $vendorDir . '/twig/twig/lib/Twig/Node/If.php', - 'Twig_Node_Import' => $vendorDir . '/twig/twig/lib/Twig/Node/Import.php', - 'Twig_Node_Include' => $vendorDir . '/twig/twig/lib/Twig/Node/Include.php', - 'Twig_Node_Macro' => $vendorDir . '/twig/twig/lib/Twig/Node/Macro.php', - 'Twig_Node_Module' => $vendorDir . '/twig/twig/lib/Twig/Node/Module.php', - 'Twig_Node_Print' => $vendorDir . '/twig/twig/lib/Twig/Node/Print.php', - 'Twig_Node_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Node/Sandbox.php', - 'Twig_Node_SandboxedPrint' => $vendorDir . '/twig/twig/lib/Twig/Node/SandboxedPrint.php', - 'Twig_Node_Set' => $vendorDir . '/twig/twig/lib/Twig/Node/Set.php', - 'Twig_Node_SetTemp' => $vendorDir . '/twig/twig/lib/Twig/Node/SetTemp.php', - 'Twig_Node_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/Node/Spaceless.php', - 'Twig_Node_Text' => $vendorDir . '/twig/twig/lib/Twig/Node/Text.php', - 'Twig_Node_With' => $vendorDir . '/twig/twig/lib/Twig/Node/With.php', - 'Twig_Parser' => $vendorDir . '/twig/twig/lib/Twig/Parser.php', - 'Twig_ParserInterface' => $vendorDir . '/twig/twig/lib/Twig/ParserInterface.php', - 'Twig_Profiler_Dumper_Blackfire' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php', - 'Twig_Profiler_Dumper_Html' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Html.php', - 'Twig_Profiler_Dumper_Text' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Text.php', - 'Twig_Profiler_NodeVisitor_Profiler' => $vendorDir . '/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php', - 'Twig_Profiler_Node_EnterProfile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php', - 'Twig_Profiler_Node_LeaveProfile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php', - 'Twig_Profiler_Profile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Profile.php', - 'Twig_RuntimeLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/RuntimeLoaderInterface.php', - 'Twig_Sandbox_SecurityError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityError.php', - 'Twig_Sandbox_SecurityNotAllowedFilterError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php', - 'Twig_Sandbox_SecurityNotAllowedFunctionError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php', - 'Twig_Sandbox_SecurityNotAllowedMethodError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php', - 'Twig_Sandbox_SecurityNotAllowedPropertyError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php', - 'Twig_Sandbox_SecurityNotAllowedTagError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php', - 'Twig_Sandbox_SecurityPolicy' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php', - 'Twig_Sandbox_SecurityPolicyInterface' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php', - 'Twig_SimpleFilter' => $vendorDir . '/twig/twig/lib/Twig/SimpleFilter.php', - 'Twig_SimpleFunction' => $vendorDir . '/twig/twig/lib/Twig/SimpleFunction.php', - 'Twig_SimpleTest' => $vendorDir . '/twig/twig/lib/Twig/SimpleTest.php', - 'Twig_Source' => $vendorDir . '/twig/twig/lib/Twig/Source.php', - 'Twig_SourceContextLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php', - 'Twig_Template' => $vendorDir . '/twig/twig/lib/Twig/Template.php', - 'Twig_TemplateInterface' => $vendorDir . '/twig/twig/lib/Twig/TemplateInterface.php', - 'Twig_TemplateWrapper' => $vendorDir . '/twig/twig/lib/Twig/TemplateWrapper.php', - 'Twig_Test' => $vendorDir . '/twig/twig/lib/Twig/Test.php', - 'Twig_TestCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/TestCallableInterface.php', - 'Twig_TestInterface' => $vendorDir . '/twig/twig/lib/Twig/TestInterface.php', - 'Twig_Test_Function' => $vendorDir . '/twig/twig/lib/Twig/Test/Function.php', - 'Twig_Test_IntegrationTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/IntegrationTestCase.php', - 'Twig_Test_Method' => $vendorDir . '/twig/twig/lib/Twig/Test/Method.php', - 'Twig_Test_Node' => $vendorDir . '/twig/twig/lib/Twig/Test/Node.php', - 'Twig_Test_NodeTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/NodeTestCase.php', - 'Twig_Token' => $vendorDir . '/twig/twig/lib/Twig/Token.php', - 'Twig_TokenParser' => $vendorDir . '/twig/twig/lib/Twig/TokenParser.php', - 'Twig_TokenParserBroker' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBroker.php', - 'Twig_TokenParserBrokerInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBrokerInterface.php', - 'Twig_TokenParserInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserInterface.php', - 'Twig_TokenParser_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/AutoEscape.php', - 'Twig_TokenParser_Block' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Block.php', - 'Twig_TokenParser_Do' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Do.php', - 'Twig_TokenParser_Embed' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Embed.php', - 'Twig_TokenParser_Extends' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Extends.php', - 'Twig_TokenParser_Filter' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Filter.php', - 'Twig_TokenParser_Flush' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Flush.php', - 'Twig_TokenParser_For' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/For.php', - 'Twig_TokenParser_From' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/From.php', - 'Twig_TokenParser_If' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/If.php', - 'Twig_TokenParser_Import' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Import.php', - 'Twig_TokenParser_Include' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Include.php', - 'Twig_TokenParser_Macro' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Macro.php', - 'Twig_TokenParser_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Sandbox.php', - 'Twig_TokenParser_Set' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Set.php', - 'Twig_TokenParser_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Spaceless.php', - 'Twig_TokenParser_Use' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Use.php', - 'Twig_TokenParser_With' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/With.php', - 'Twig_TokenStream' => $vendorDir . '/twig/twig/lib/Twig/TokenStream.php', - 'Twig_Util_DeprecationCollector' => $vendorDir . '/twig/twig/lib/Twig/Util/DeprecationCollector.php', - 'Twig_Util_TemplateDirIterator' => $vendorDir . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php', - 'Types_Admin' => $baseDir . '/application/controllers/admin.php', - 'Types_Admin_Menu' => $baseDir . '/application/controllers/admin_menu.php', - 'Types_Admin_Notices_Free_Version' => $baseDir . '/application/controllers/admin_notice/free-version.php', - 'Types_Ajax' => $baseDir . '/application/controllers/ajax.php', - 'Types_Ajax_Handler_Abstract' => $baseDir . '/application/controllers/ajax/handler/abstract.php', - 'Types_Ajax_Handler_Check_Slug_Conflicts' => $baseDir . '/application/controllers/ajax/handler/check_slug_conflicts.php', - 'Types_Ajax_Handler_Field_Control_Action' => $baseDir . '/application/controllers/ajax/handler/field_control_action.php', - 'Types_Ajax_Handler_Interface' => $baseDir . '/application/controllers/ajax/handler_interface.php', - 'Types_Ajax_Handler_Settings_Action' => $baseDir . '/application/controllers/ajax/handler/settings_action.php', - 'Types_Api' => $baseDir . '/application/controllers/api.php', - 'Types_Api_Handler_Filter_Get_Field_Group_Ids_By_Post_Type' => $baseDir . '/application/controllers/api/handler/filter_get_field_group_ids_by_post_type.php', - 'Types_Api_Handler_Import_From_Zip_File' => $baseDir . '/application/controllers/api/handler/import_from_zip_file.php', - 'Types_Api_Handler_Interface' => $baseDir . '/application/controllers/api/handler/interface.php', - 'Types_Api_Handler_Query_Groups' => $baseDir . '/application/controllers/api/handler/query_groups.php', - 'Types_Asset_Help_Tab_Loader' => $baseDir . '/application/controllers/asset/help_tab_loader.php', - 'Types_Asset_Manager' => $baseDir . '/application/controllers/asset/manager.php', - 'Types_Assets' => $baseDir . '/application/controllers/assets.php', - 'Types_Dialog_Box' => $baseDir . '/application/controllers/dialog_box.php', - 'Types_Embedded' => $baseDir . '/application/controllers/embedded.php', - 'Types_Field_Group' => $baseDir . '/application/models/field/group.php', - 'Types_Field_Group_Factory' => $baseDir . '/application/models/field/group/factory.php', - 'Types_Field_Group_Post' => $baseDir . '/application/models/field/group/post.php', - 'Types_Field_Group_Post_Factory' => $baseDir . '/application/models/field/group/post_factory.php', - 'Types_Field_Group_Term' => $baseDir . '/application/models/field/group/term.php', - 'Types_Field_Group_Term_Factory' => $baseDir . '/application/models/field/group/term_factory.php', - 'Types_Field_Group_User' => $baseDir . '/application/models/field/group/user.php', - 'Types_Field_Group_User_Factory' => $baseDir . '/application/models/field/group/user_factory.php', - 'Types_Field_Type_Converter' => $baseDir . '/application/controllers/field/type_converter.php', - 'Types_Field_Type_Definition' => $baseDir . '/application/models/field/type/definition.php', - 'Types_Field_Type_Definition_Checkbox' => $baseDir . '/application/models/field/gateway/checkbox.php', - 'Types_Field_Type_Definition_Checkboxes' => $baseDir . '/application/models/field/gateway/checkboxes.php', - 'Types_Field_Type_Definition_Date' => $baseDir . '/application/models/field/gateway/date.php', - 'Types_Field_Type_Definition_Factory' => $baseDir . '/application/models/field/type/definition_factory.php', - 'Types_Field_Type_Definition_Numeric' => $baseDir . '/application/models/field/gateway/numeric.php', - 'Types_Field_Type_Definition_Radio' => $baseDir . '/application/models/field/gateway/radio.php', - 'Types_Field_Type_Definition_Select' => $baseDir . '/application/models/field/gateway/select.php', - 'Types_Field_Type_Definition_Singular' => $baseDir . '/application/models/field/gateway/singular.php', - 'Types_Field_Utils' => $baseDir . '/application/controllers/field/utils.php', - 'Types_Frontend' => $baseDir . '/application/controllers/frontend.php', - 'Types_Helper_Condition' => $baseDir . '/application/models/helper/condition.php', - 'Types_Helper_Condition_Archive_Exists' => $baseDir . '/application/models/helper/condition/archive/exists.php', - 'Types_Helper_Condition_Archive_Has_Fields' => $baseDir . '/application/models/helper/condition/archive/has_fields.php', - 'Types_Helper_Condition_Archive_Missing' => $baseDir . '/application/models/helper/condition/archive/missing.php', - 'Types_Helper_Condition_Archive_No_Fields' => $baseDir . '/application/models/helper/condition/archive/no_fields.php', - 'Types_Helper_Condition_Archive_No_Support' => $baseDir . '/application/models/helper/condition/archive/no_support.php', - 'Types_Helper_Condition_Archive_Support' => $baseDir . '/application/models/helper/condition/archive/support.php', - 'Types_Helper_Condition_Cred_Active' => $baseDir . '/application/models/helper/condition/cred/active.php', - 'Types_Helper_Condition_Cred_Forms_Exist' => $baseDir . '/application/models/helper/condition/cred/forms_exist.php', - 'Types_Helper_Condition_Cred_Forms_Missing' => $baseDir . '/application/models/helper/condition/cred/forms_missing.php', - 'Types_Helper_Condition_Cred_Missing' => $baseDir . '/application/models/helper/condition/cred/missing.php', - 'Types_Helper_Condition_Layouts_Active' => $baseDir . '/application/models/helper/condition/layouts/active.php', - 'Types_Helper_Condition_Layouts_Archive_Exists' => $baseDir . '/application/models/helper/condition/layouts/archive_exists.php', - 'Types_Helper_Condition_Layouts_Archive_Missing' => $baseDir . '/application/models/helper/condition/layouts/archive_missing.php', - 'Types_Helper_Condition_Layouts_Compatible' => $baseDir . '/application/models/helper/condition/layouts/compatible.php', - 'Types_Helper_Condition_Layouts_Missing' => $baseDir . '/application/models/helper/condition/layouts/missing.php', - 'Types_Helper_Condition_Layouts_Template_Exists' => $baseDir . '/application/models/helper/condition/layouts/template_exists.php', - 'Types_Helper_Condition_Layouts_Template_Missing' => $baseDir . '/application/models/helper/condition/layouts/template_missing.php', - 'Types_Helper_Condition_Screen' => $baseDir . '/application/models/helper/condition/screen.php', - 'Types_Helper_Condition_Single_Exists' => $baseDir . '/application/models/helper/condition/single/exists.php', - 'Types_Helper_Condition_Single_Has_Fields' => $baseDir . '/application/models/helper/condition/single/has_fields.php', - 'Types_Helper_Condition_Single_Missing' => $baseDir . '/application/models/helper/condition/single/missing.php', - 'Types_Helper_Condition_Single_No_Fields' => $baseDir . '/application/models/helper/condition/single/no_fields.php', - 'Types_Helper_Condition_Template' => $baseDir . '/application/models/helper/condition/template.php', - 'Types_Helper_Condition_Type_Fields_Assigned' => $baseDir . '/application/models/helper/condition/type/fields_assigned.php', - 'Types_Helper_Condition_Type_No_Post_Or_Page' => $baseDir . '/application/models/helper/condition/type/no_post_or_page.php', - 'Types_Helper_Condition_Type_Post_Or_Page' => $baseDir . '/application/models/helper/condition/type/post_or_page.php', - 'Types_Helper_Condition_Views_Active' => $baseDir . '/application/models/helper/condition/views/active.php', - 'Types_Helper_Condition_Views_Archive_Exists' => $baseDir . '/application/models/helper/condition/views/archive_exists.php', - 'Types_Helper_Condition_Views_Archive_Missing' => $baseDir . '/application/models/helper/condition/views/archive_missing.php', - 'Types_Helper_Condition_Views_Missing' => $baseDir . '/application/models/helper/condition/views/missing.php', - 'Types_Helper_Condition_Views_Template_Exists' => $baseDir . '/application/models/helper/condition/views/template_exists.php', - 'Types_Helper_Condition_Views_Template_Missing' => $baseDir . '/application/models/helper/condition/views/template_missing.php', - 'Types_Helper_Condition_Views_Views_Exist' => $baseDir . '/application/models/helper/condition/views/views_exist.php', - 'Types_Helper_Condition_Views_Views_Missing' => $baseDir . '/application/models/helper/condition/views/views_missing.php', - 'Types_Helper_Create_Content_Template' => $baseDir . '/application/models/helper/create/content_template.php', - 'Types_Helper_Create_Form' => $baseDir . '/application/models/helper/create/form.php', - 'Types_Helper_Create_Layout' => $baseDir . '/application/models/helper/create/layout.php', - 'Types_Helper_Create_View' => $baseDir . '/application/models/helper/create/view.php', - 'Types_Helper_Create_Wordpress_Archive' => $baseDir . '/application/models/helper/create/wordpress_archive.php', - 'Types_Helper_Output_Interface' => $baseDir . '/application/models/helper/output/interface.php', - 'Types_Helper_Output_Meta_Box' => $baseDir . '/application/models/helper/output/meta_box.php', - 'Types_Helper_Placeholder' => $baseDir . '/application/models/helper/placeholder.php', - 'Types_Helper_Twig' => $baseDir . '/application/models/helper/twig.php', - 'Types_Helper_Url' => $baseDir . '/application/models/helper/url.php', - 'Types_Import_Export' => $baseDir . '/application/controllers/import_export.php', - 'Types_Information_Container' => $baseDir . '/application/models/information/container.php', - 'Types_Information_Controller' => $baseDir . '/application/controllers/information/controller.php', - 'Types_Information_Message' => $baseDir . '/application/models/information/message.php', - 'Types_Information_Message_Post_Type' => $baseDir . '/application/models/information/message/post_type.php', - 'Types_Information_Table' => $baseDir . '/application/models/information/table.php', - 'Types_Interop_Handler_Divi' => $baseDir . '/application/controllers/interop/handler/divi.php', - 'Types_Interop_Handler_Interface' => $baseDir . '/application/controllers/interop/handler_interface.php', - 'Types_Interop_Handler_The7' => $baseDir . '/application/controllers/interop/handler/the7.php', - 'Types_Interop_Handler_Use_Any_Font' => $baseDir . '/application/controllers/interop/handler/use_any_font.php', - 'Types_Interop_Handler_Wpml' => $baseDir . '/application/controllers/interop/handler/wpml.php', - 'Types_Interop_Mediator' => $baseDir . '/application/controllers/interop/mediator.php', - 'Types_Main' => $baseDir . '/application/controllers/main.php', - 'Types_Page_Abstract' => $baseDir . '/application/controllers/page/abstract.php', - 'Types_Page_Dashboard' => $baseDir . '/application/controllers/page/dashboard.php', - 'Types_Page_Extension_Edit_Post' => $baseDir . '/application/controllers/page/extension/edit_post.php', - 'Types_Page_Extension_Edit_Post_Fields' => $baseDir . '/application/controllers/page/extension/edit_post_fields.php', - 'Types_Page_Extension_Edit_Post_Type' => $baseDir . '/application/controllers/page/extension/edit_post_type.php', - 'Types_Page_Extension_Settings' => $baseDir . '/application/controllers/page/extension/settings.php', - 'Types_Page_Field_Control' => $baseDir . '/application/controllers/page/field_control.php', - 'Types_Page_Hidden_Helper' => $baseDir . '/application/controllers/page/hidden/helper.php', - 'Types_Post_Type' => $baseDir . '/application/models/post_type.php', - 'Types_Setting' => $baseDir . '/application/models/setting.php', - 'Types_Setting_Boolean' => $baseDir . '/application/models/setting/boolean.php', - 'Types_Setting_Interface' => $baseDir . '/application/models/setting/interface.php', - 'Types_Setting_Option' => $baseDir . '/application/models/setting/option.php', - 'Types_Setting_Option_Interface' => $baseDir . '/application/models/setting/option/interface.php', - 'Types_Setting_Preset_Information_Table' => $baseDir . '/application/models/setting/preset/information_table.php', - 'Types_Taxonomy' => $baseDir . '/application/models/taxonomy.php', - 'Types_Twig_Autoloader' => $baseDir . '/application/controllers/twig_autoloader.php', - 'Types_Upgrade' => $baseDir . '/application/controllers/upgrade.php', - 'Types_Utils' => $baseDir . '/application/controllers/admin_notice/utils.php', - 'Types_Utils_Post_Type_Option' => $baseDir . '/application/controllers/utils/post_type_option.php', - 'Types_Wpml_Field_Group' => $baseDir . '/application/models/wpml/field_group.php', - 'Types_Wpml_Field_Group_String' => $baseDir . '/application/models/wpml/field/group/string.php', - 'Types_Wpml_Field_Group_String_Description' => $baseDir . '/application/models/wpml/field/group/string/description.php', - 'Types_Wpml_Field_Group_String_Name' => $baseDir . '/application/models/wpml/field/group/string/name.php', - 'Types_Wpml_Interface' => $baseDir . '/application/models/wpml/interface.php', - 'WPToolset_Cake_Validation' => $vendorDir . '/toolset/toolset-common/toolset-forms/lib/CakePHP-Validation.php', - 'WPToolset_Field_Audio' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.audio.php', - 'WPToolset_Field_Button' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.button.php', - 'WPToolset_Field_Checkbox' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.checkbox.php', - 'WPToolset_Field_Checkboxes' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.checkboxes.php', - 'WPToolset_Field_Colorpicker' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.colorpicker.php', - 'WPToolset_Field_Date' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.date.php', - 'WPToolset_Field_Date_Scripts' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.date.scripts.php', - 'WPToolset_Field_Email' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.email.php', - 'WPToolset_Field_Embed' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.embed.php', - 'WPToolset_Field_File' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.file.php', - 'WPToolset_Field_Hidden' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.hidden.php', - 'WPToolset_Field_Image' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.image.php', - 'WPToolset_Field_Integer' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.integer.php', - 'WPToolset_Field_Numeric' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.numeric.php', - 'WPToolset_Field_Password' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.password.php', - 'WPToolset_Field_Phone' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.phone.php', - 'WPToolset_Field_Post' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.post.php', - 'WPToolset_Field_Radios' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.radios.php', - 'WPToolset_Field_Recaptcha' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.recaptcha.php', - 'WPToolset_Field_Recaptcha_v1' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.recaptcha-v1.php', - 'WPToolset_Field_Select' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.select.php', - 'WPToolset_Field_Skype' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.skype.php', - 'WPToolset_Field_Submit' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.submit.php', - 'WPToolset_Field_Taxonomy' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.taxonomy.php', - 'WPToolset_Field_Taxonomyhierarchical' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.taxonomyhierarchical.php', - 'WPToolset_Field_Textarea' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.textarea.php', - 'WPToolset_Field_Textfield' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.textfield.php', - 'WPToolset_Field_Url' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.url.php', - 'WPToolset_Field_Video' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.video.php', - 'WPToolset_Field_Wysiwyg' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.wysiwyg.php', - 'WPToolset_Forms_Bootstrap' => $vendorDir . '/toolset/toolset-common/toolset-forms/bootstrap.php', - 'WPToolset_Forms_Conditional' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.conditional.php', - 'WPToolset_Forms_Conditional_RFG' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.conditional.rfg.php', - 'WPToolset_Forms_Repetitive' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.repetitive.php', - 'WPToolset_Forms_Validation' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.validation.php', - 'WPToolset_Types' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.types.php', - 'WPV_Handle_Users_Functions' => $vendorDir . '/toolset/toolset-common/toolset-forms/classes/class.conditional.php', - 'WPV_wpcf_switch_post_from_attr_id' => $vendorDir . '/toolset/toolset-common/inc/toolset.object.relationship.class.php', - 'xrstf\\Composer52\\AutoloadGenerator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php', - 'xrstf\\Composer52\\Generator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php', -); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_files.php b/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_files.php deleted file mode 100644 index 488b417..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_files.php +++ /dev/null @@ -1,10 +0,0 @@ - $baseDir . '/application/functions.php', -); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_namespaces.php b/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 82c16d7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,11 +0,0 @@ - array($vendorDir . '/xrstf/composer-php52/lib'), - 'Twig_' => array($vendorDir . '/twig/twig/lib'), -); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_psr4.php b/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_psr4.php deleted file mode 100644 index 12ea9cc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,10 +0,0 @@ - array($vendorDir . '/composer/installers/src/Composer/Installers'), -); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_real.php b/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_real.php deleted file mode 100644 index f7f0402..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_real.php +++ /dev/null @@ -1,70 +0,0 @@ -= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit39d4b17bdb5377514bee52a66c64b5fc::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit39d4b17bdb5377514bee52a66c64b5fc::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire39d4b17bdb5377514bee52a66c64b5fc($fileIdentifier, $file); - } - - return $loader; - } -} - -function composerRequire39d4b17bdb5377514bee52a66c64b5fc($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_static.php b/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_static.php deleted file mode 100644 index 7a5d07c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/autoload_static.php +++ /dev/null @@ -1,929 +0,0 @@ - __DIR__ . '/../..' . '/application/functions.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'C' => - array ( - 'Composer\\Installers\\' => 20, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'Composer\\Installers\\' => - array ( - 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers', - ), - ); - - public static $prefixesPsr0 = array ( - 'x' => - array ( - 'xrstf\\Composer52' => - array ( - 0 => __DIR__ . '/..' . '/xrstf/composer-php52/lib', - ), - ), - 'T' => - array ( - 'Twig_' => - array ( - 0 => __DIR__ . '/..' . '/twig/twig/lib', - ), - ), - ); - - public static $classMap = array ( - 'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php', - 'Composer\\Installers\\AimeosInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AimeosInstaller.php', - 'Composer\\Installers\\AnnotateCmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php', - 'Composer\\Installers\\AsgardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AsgardInstaller.php', - 'Composer\\Installers\\AttogramInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AttogramInstaller.php', - 'Composer\\Installers\\BaseInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BaseInstaller.php', - 'Composer\\Installers\\BitrixInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BitrixInstaller.php', - 'Composer\\Installers\\BonefishInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BonefishInstaller.php', - 'Composer\\Installers\\CakePHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php', - 'Composer\\Installers\\ChefInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ChefInstaller.php', - 'Composer\\Installers\\ClanCatsFrameworkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php', - 'Composer\\Installers\\CockpitInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CockpitInstaller.php', - 'Composer\\Installers\\CodeIgniterInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php', - 'Composer\\Installers\\Concrete5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Concrete5Installer.php', - 'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php', - 'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php', - 'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php', - 'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php', - 'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php', - 'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php', - 'Composer\\Installers\\ElggInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ElggInstaller.php', - 'Composer\\Installers\\EliasisInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EliasisInstaller.php', - 'Composer\\Installers\\ExpressionEngineInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php', - 'Composer\\Installers\\EzPlatformInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php', - 'Composer\\Installers\\FuelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelInstaller.php', - 'Composer\\Installers\\FuelphpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php', - 'Composer\\Installers\\GravInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/GravInstaller.php', - 'Composer\\Installers\\HuradInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/HuradInstaller.php', - 'Composer\\Installers\\ImageCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php', - 'Composer\\Installers\\Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Installer.php', - 'Composer\\Installers\\ItopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ItopInstaller.php', - 'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php', - 'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php', - 'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php', - 'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php', - 'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php', - 'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php', - 'Composer\\Installers\\LaravelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LaravelInstaller.php', - 'Composer\\Installers\\LavaLiteInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php', - 'Composer\\Installers\\LithiumInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LithiumInstaller.php', - 'Composer\\Installers\\MODULEWorkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php', - 'Composer\\Installers\\MODXEvoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php', - 'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php', - 'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php', - 'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php', - 'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php', - 'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php', - 'Composer\\Installers\\MicroweberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php', - 'Composer\\Installers\\MoodleInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MoodleInstaller.php', - 'Composer\\Installers\\OctoberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OctoberInstaller.php', - 'Composer\\Installers\\OntoWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php', - 'Composer\\Installers\\OsclassInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OsclassInstaller.php', - 'Composer\\Installers\\OxidInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OxidInstaller.php', - 'Composer\\Installers\\PPIInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PPIInstaller.php', - 'Composer\\Installers\\PhiftyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php', - 'Composer\\Installers\\PhpBBInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php', - 'Composer\\Installers\\PimcoreInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php', - 'Composer\\Installers\\PiwikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PiwikInstaller.php', - 'Composer\\Installers\\PlentymarketsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php', - 'Composer\\Installers\\Plugin' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Plugin.php', - 'Composer\\Installers\\PortoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PortoInstaller.php', - 'Composer\\Installers\\PrestashopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php', - 'Composer\\Installers\\PuppetInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PuppetInstaller.php', - 'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php', - 'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php', - 'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php', - 'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php', - 'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php', - 'Composer\\Installers\\ShopwareInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php', - 'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php', - 'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php', - 'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php', - 'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php', - 'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php', - 'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php', - 'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php', - 'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php', - 'Composer\\Installers\\VanillaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VanillaInstaller.php', - 'Composer\\Installers\\VgmcpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php', - 'Composer\\Installers\\WHMCSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php', - 'Composer\\Installers\\WolfCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php', - 'Composer\\Installers\\WordPressInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WordPressInstaller.php', - 'Composer\\Installers\\YawikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/YawikInstaller.php', - 'Composer\\Installers\\ZendInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZendInstaller.php', - 'Composer\\Installers\\ZikulaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php', - 'Enlimbo_Forms' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.eforms.php', - 'FieldAbstract' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/abstract.field.php', - 'FieldFactory' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.field_factory.php', - 'FormAbstract' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/abstract.form.php', - 'FormFactory' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.form_factory.php', - 'IToolset_Association' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/interface.php', - 'IToolset_Association_Query_Condition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/interface.php', - 'IToolset_Association_Query_Element_Selector' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/element_selector/interface.php', - 'IToolset_Association_Query_Orderby' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/orderby/interface.php', - 'IToolset_Association_Query_Restriction' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/restriction/interface.php', - 'IToolset_Association_Query_Result_Transformation' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/interface.php', - 'IToolset_Cron_Event' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/cron/event_interface.php', - 'IToolset_Element' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/i_element.php', - 'IToolset_Output_Template' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/interface.php', - 'IToolset_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/i_post.php', - 'IToolset_Post_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/i_post_type.php', - 'IToolset_Post_Type_From_Types' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/i_post_type_from_types.php', - 'IToolset_Post_Type_Registered' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/i_post_type_registered.php', - 'IToolset_Potential_Association_Query' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/query_interface.php', - 'IToolset_Query_Condition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/condition/interface.php', - 'IToolset_Relationship_Database_Issue' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/database/issue/interface.php', - 'IToolset_Relationship_Definition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/definition/interface.php', - 'IToolset_Relationship_Origin' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/origin/interface.php', - 'IToolset_Relationship_Query_Cardinality_Match' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/interface.php', - 'IToolset_Relationship_Query_Condition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/interface.php', - 'IToolset_Relationship_Role' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/role/interface.php', - 'IToolset_Relationship_Role_Parent_Child' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/role/parent_child_interface.php', - 'IToolset_Upgrade_Command' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/command_interface.php', - 'OTGS\\Toolset\\Common\\Condition\\Installer\\IsAvailable' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/installer/is_available.php', - 'OTGS\\Toolset\\Common\\Condition\\Installer\\IsToolsetSubscriptionValid' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/installer/is_toolset_subscription_valid.php', - 'OTGS\\Toolset\\Common\\Interop\\HandlerInterface' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/interop/handler_interface.php', - 'OTGS\\Toolset\\Common\\Interop\\Handler\\InstallerCompatibilityReporting' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/interop/handler/installer_compatibility_reporting.php', - 'OTGS\\Toolset\\Common\\Interop\\Mediator' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/interop/mediator.php', - 'OTGS\\Toolset\\Common\\M2M\\Association\\Repository' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/Repository.php', - 'OTGS\\Toolset\\Common\\M2M\\PotentialAssociation\\CardinalityPostQuery' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/cardinality_post_query.php', - 'OTGS\\Toolset\\Common\\M2M\\PotentialAssociation\\JoinManager' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/join_manager.php', - 'OTGS\\Toolset\\Common\\M2M\\PotentialAssociation\\WpQueryAdjustment' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/wp_query_adjustment.php', - 'OTGS\\Toolset\\Common\\M2M\\PublicApiService' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/public_api_service.php', - 'OTGS\\Toolset\\Common\\MaintenanceMode\\Controller' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/maintenance_mode/controller.php', - 'OTGS\\Toolset\\Common\\Utility\\Admin\\Notices\\Builder' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notices/Builder.php', - 'ReCaptchaResponse' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/recaptchalib.php', - 'Toolset_Admin_Bar_Menu' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.admin.bar.menu.class.php', - 'Toolset_Admin_Controller' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/admin.php', - 'Toolset_Admin_Notice_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/abstract.php', - 'Toolset_Admin_Notice_Dismissible' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/dismissible.php', - 'Toolset_Admin_Notice_Error' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/error.php', - 'Toolset_Admin_Notice_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/interface.php', - 'Toolset_Admin_Notice_Layouts_Help' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/layouts/help.php', - 'Toolset_Admin_Notice_Required_Action' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/required/action.php', - 'Toolset_Admin_Notice_Success' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/success.php', - 'Toolset_Admin_Notice_Undismissible' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/undismissible.php', - 'Toolset_Admin_Notice_Warning' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notice/warning.php', - 'Toolset_Admin_Notices_Manager' => __DIR__ . '/..' . '/toolset/toolset-common/utility/admin/notices/manager.php', - 'Toolset_Ajax' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.ajax.class.php', - 'Toolset_Ajax_Handler_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/abstract.php', - 'Toolset_Ajax_Handler_Get_Content_Template_Block_Preview' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_ct_block_preview.php', - 'Toolset_Ajax_Handler_Get_Post_By_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_post_by_id.php', - 'Toolset_Ajax_Handler_Get_Term_By_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_term_by_id.php', - 'Toolset_Ajax_Handler_Get_User_By_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_user_by_id.php', - 'Toolset_Ajax_Handler_Get_View_Block_Preview' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/get_view_block_preview.php', - 'Toolset_Ajax_Handler_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/interface.php', - 'Toolset_Ajax_Handler_Intermediary_Post_Cleanup' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/intermediary_post_cleanup.php', - 'Toolset_Ajax_Handler_Migrate_To_M2M' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/migrate_to_m2m.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Posts_By_Post_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_posts_by_post_type.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Posts_By_Title' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_posts_by_title.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Terms' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_terms.php', - 'Toolset_Ajax_Handler_Select2_Suggest_Users' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/ajax_handler/select2_suggest_users.php', - 'Toolset_ArrayUtils' => __DIR__ . '/..' . '/toolset/toolset-common/utility/utils.php', - 'Toolset_Asset_Manager' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/asset_manager.php', - 'Toolset_Assets_Manager' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.assets.manager.class.php', - 'Toolset_Association' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/association.php', - 'Toolset_Association_Cleanup_Association' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/association.php', - 'Toolset_Association_Cleanup_Cron_Event' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/cron_event.php', - 'Toolset_Association_Cleanup_Cron_Handler' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/cron_handler.php', - 'Toolset_Association_Cleanup_Dangling_Intermediary_Posts' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/dangling_intermediary_posts.php', - 'Toolset_Association_Cleanup_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/factory.php', - 'Toolset_Association_Cleanup_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/post.php', - 'Toolset_Association_Cleanup_Post_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/post_type.php', - 'Toolset_Association_Cleanup_Troubleshooting_Section' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/cleanup/troubleshooting_section.php', - 'Toolset_Association_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/factory.php', - 'Toolset_Association_Intermediary_Post_Persistence' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/intermediary_post_persistence.php', - 'Toolset_Association_Persistence' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/persistence.php', - 'Toolset_Association_Query' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/association_query.php', - 'Toolset_Association_Query_Condition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/abstract.php', - 'Toolset_Association_Query_Condition_Association_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/association_id.php', - 'Toolset_Association_Query_Condition_Element_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/element_id.php', - 'Toolset_Association_Query_Condition_Element_Id_And_Domain' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/element_id_and_domain.php', - 'Toolset_Association_Query_Condition_Element_Status' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/element_status.php', - 'Toolset_Association_Query_Condition_Empty_Intermediary' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/empty_intermediary.php', - 'Toolset_Association_Query_Condition_Exclude_Element' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/exclude_element.php', - 'Toolset_Association_Query_Condition_Exclude_Relationship' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/exclude_relationship.php', - 'Toolset_Association_Query_Condition_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition_factory.php', - 'Toolset_Association_Query_Condition_Has_Active_Relationship' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/has_active_relationship.php', - 'Toolset_Association_Query_Condition_Has_Domain' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/has_domain.php', - 'Toolset_Association_Query_Condition_Has_Domain_And_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/has_domain_and_type.php', - 'Toolset_Association_Query_Condition_Has_Intermediary_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/has_intermediary_id.php', - 'Toolset_Association_Query_Condition_Has_Legacy_Relationship' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/has_legacy_relationship.php', - 'Toolset_Association_Query_Condition_Has_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/has_type.php', - 'Toolset_Association_Query_Condition_Intermediary_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/intermediary_id.php', - 'Toolset_Association_Query_Condition_Postmeta' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/postmeta.php', - 'Toolset_Association_Query_Condition_Relationship_Flag' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/relationship_flag.php', - 'Toolset_Association_Query_Condition_Relationship_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/relationship_id.php', - 'Toolset_Association_Query_Condition_Relationship_Origin' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/relationship_origin.php', - 'Toolset_Association_Query_Condition_Search' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/search.php', - 'Toolset_Association_Query_Condition_Wp_Query' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/condition/wp_query.php', - 'Toolset_Association_Query_Element_Selector_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/element_selector/abstract.php', - 'Toolset_Association_Query_Element_Selector_Default' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/element_selector/default.php', - 'Toolset_Association_Query_Element_Selector_Provider' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/element_selector/provider.php', - 'Toolset_Association_Query_Element_Selector_Wpml' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/element_selector/wpml.php', - 'Toolset_Association_Query_Element_Selector_Wpml_Lang_All' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/element_selector/wpml_lang_all.php', - 'Toolset_Association_Query_Orderby' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/orderby/abstract.php', - 'Toolset_Association_Query_Orderby_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/orderby_factory.php', - 'Toolset_Association_Query_Orderby_Nothing' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/orderby/nothing.php', - 'Toolset_Association_Query_Orderby_Postmeta' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/orderby/postmeta.php', - 'Toolset_Association_Query_Orderby_Title' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/orderby/title.php', - 'Toolset_Association_Query_Result_Transformation_Association_Instance' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/association_instance.php', - 'Toolset_Association_Query_Result_Transformation_Association_Uid' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/association_uid.php', - 'Toolset_Association_Query_Result_Transformation_Element_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/element_id.php', - 'Toolset_Association_Query_Result_Transformation_Element_Instance' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/result_transformation/element_instance.php', - 'Toolset_Association_Query_Sql_Expression_Builder' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/sql_expression_builder.php', - 'Toolset_Association_Query_Table_Join_Manager' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/table_join_manager.php', - 'Toolset_Association_Query_V2' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/association_query_v2.php', - 'Toolset_Association_Query_Wpdb_Wrapper' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/query/wpdb_wrapper.php', - 'Toolset_Association_Translator' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/association/translator.php', - 'Toolset_Blocks' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-blocks/toolset-blocks.php', - 'Toolset_Blocks_Content_Template' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-blocks/blocks/ct/ct.php', - 'Toolset_Blocks_Custom_HTML' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-blocks/blocks/custom-html/custom-html.php', - 'Toolset_Blocks_View' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-blocks/blocks/view/view.php', - 'Toolset_Bootstrap_Loader' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.bootstrap.loader.class.php', - 'Toolset_Common_Autoloader' => __DIR__ . '/..' . '/toolset/toolset-common/utility/autoloader.php', - 'Toolset_Common_Bootstrap' => __DIR__ . '/..' . '/toolset/toolset-common/bootstrap.php', - 'Toolset_Condition_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/interface.php', - 'Toolset_Condition_Plugin_Access_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/access/active.php', - 'Toolset_Condition_Plugin_Access_Missing' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/access/missing.php', - 'Toolset_Condition_Plugin_Cred_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/cred/active.php', - 'Toolset_Condition_Plugin_Cred_Missing' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/cred/missing.php', - 'Toolset_Condition_Plugin_Encrypted_No_Valid_Theme' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/encrypted/no-valid-theme.php', - 'Toolset_Condition_Plugin_Layouts_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/layouts/active.php', - 'Toolset_Condition_Plugin_Layouts_Missing' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/layouts/missing.php', - 'Toolset_Condition_Plugin_Layouts_No_Items' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/layouts/no-items.php', - 'Toolset_Condition_Plugin_Types_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/types/active.php', - 'Toolset_Condition_Plugin_Types_Has_Legacy_Relationships' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/types/has_legacy_relationships.php', - 'Toolset_Condition_Plugin_Types_Missing' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/types/missing.php', - 'Toolset_Condition_Plugin_Types_Ready_For_M2M' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/types/ready_for_m2m.php', - 'Toolset_Condition_Plugin_Views_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/views/active.php', - 'Toolset_Condition_Plugin_Views_Missing' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/views/missing.php', - 'Toolset_Condition_Plugin_Wpml_Doesnt_Support_M2m' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/wpml/doesnt_support_m2m.php', - 'Toolset_Condition_Plugin_Wpml_Is_Active_And_Configured' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/wpml/is_active_and_configured.php', - 'Toolset_Condition_Plugin_Wpml_Is_Current_Language_Default' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/plugin/wpml/is_current_language_default.php', - 'Toolset_Condition_Theme_Avada_Not_Active_Or_Greater_Equal_5_0' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/avada/not-active-or-greater-equal-5-0.php', - 'Toolset_Condition_Theme_Layouts_Support_Native_Available' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/native/available.php', - 'Toolset_Condition_Theme_Layouts_Support_Native_Missing' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/native/missing.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/active.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Available' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/available.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Missing' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/missing.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Not_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/not-active.php', - 'Toolset_Condition_Theme_Layouts_Support_Plugin_Not_Installed' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/not-installed.php', - 'Toolset_Condition_Theme_Layouts_Support_Theme_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/theme/active.php', - 'Toolset_Condition_Theme_Layouts_Support_Theme_Installed' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/theme/installed.php', - 'Toolset_Condition_Theme_Layouts_Support_Theme_Not_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/layouts-support/theme/not-active.php', - 'Toolset_Condition_Theme_Toolset_Based_Active' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/toolset-based/active.php', - 'Toolset_Condition_Theme_Toolset_Based_Inactive' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/theme/toolset-based/inactive.php', - 'Toolset_Condition_User_Role_Admin' => __DIR__ . '/..' . '/toolset/toolset-common/utility/condition/user/role/admin.php', - 'Toolset_Constants' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/constants.php', - 'Toolset_Controller_Admin_Notices' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/admin/notices.php', - 'Toolset_Cron' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/cron/cron.php', - 'Toolset_Cron_Event' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/cron/event.php', - 'Toolset_CssComponent' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.css.component.class.php', - 'Toolset_Date' => __DIR__ . '/..' . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_DateParser' => __DIR__ . '/..' . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Date_Utils' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/date_utils.php', - 'Toolset_DialogBoxes' => __DIR__ . '/..' . '/toolset/toolset-common/utility/dialogs/toolset.dialog-boxes.class.php', - 'Toolset_Element' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/element.php', - 'Toolset_Element_Domain' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/domain.php', - 'Toolset_Element_Exception_Element_Doesnt_Exist' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/exception_element_doesnt_exist.php', - 'Toolset_Element_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/element_factory.php', - 'Toolset_ErrorHandler' => __DIR__ . '/..' . '/toolset/toolset-common/utility/utils.php', - 'Toolset_Export_Import_Screen' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.export.import.screen.class.php', - 'Toolset_Field_Accessor_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/accessor/abstract.php', - 'Toolset_Field_Accessor_Dummy' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/accessor/dummy.php', - 'Toolset_Field_Accessor_Postmeta' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/accessor/postmeta.php', - 'Toolset_Field_Accessor_Postmeta_Field' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/accessor/postmeta_field.php', - 'Toolset_Field_Accessor_Termmeta' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/accessor/termmeta.php', - 'Toolset_Field_Accessor_Termmeta_Field' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/accessor/termmeta_field.php', - 'Toolset_Field_Data_Mapper_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/abstract.php', - 'Toolset_Field_Data_Mapper_Checkbox' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/checkbox.php', - 'Toolset_Field_Data_Mapper_Checkboxes' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/checkboxes.php', - 'Toolset_Field_Data_Mapper_Identity' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/data_mapper/identity.php', - 'Toolset_Field_Data_Saver' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/data_saver.php', - 'Toolset_Field_Definition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition.php', - 'Toolset_Field_Definition_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_abstract.php', - 'Toolset_Field_Definition_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_factory.php', - 'Toolset_Field_Definition_Factory_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_interface.php', - 'Toolset_Field_Definition_Factory_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_post.php', - 'Toolset_Field_Definition_Factory_Term' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_term.php', - 'Toolset_Field_Definition_Factory_User' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_factory_user.php', - 'Toolset_Field_Definition_Generic' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_generic.php', - 'Toolset_Field_Definition_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_interface.php', - 'Toolset_Field_Definition_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_post.php', - 'Toolset_Field_Definition_Term' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_term.php', - 'Toolset_Field_Definition_User' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/definition_user.php', - 'Toolset_Field_Group' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group.php', - 'Toolset_Field_Group_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group/factory.php', - 'Toolset_Field_Group_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group/post.php', - 'Toolset_Field_Group_Post_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group/post_factory.php', - 'Toolset_Field_Group_Term' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group/term.php', - 'Toolset_Field_Group_Term_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group/term_factory.php', - 'Toolset_Field_Group_User' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group/user.php', - 'Toolset_Field_Group_User_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/group/user_factory.php', - 'Toolset_Field_Instance' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/instance.php', - 'Toolset_Field_Instance_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/instance_abstract.php', - 'Toolset_Field_Instance_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/instance_post.php', - 'Toolset_Field_Instance_Term' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/instance_term.php', - 'Toolset_Field_Instance_Unsaved' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/instance_unsaved.php', - 'Toolset_Field_Option_Checkboxes' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/option_checkboxes.php', - 'Toolset_Field_Option_Radio' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/option_radio.php', - 'Toolset_Field_Option_Select' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/option_select.php', - 'Toolset_Field_Renderer_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/abstract.php', - 'Toolset_Field_Renderer_Preview_Address' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/address.php', - 'Toolset_Field_Renderer_Preview_Base' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/base.php', - 'Toolset_Field_Renderer_Preview_Checkbox' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/checkbox.php', - 'Toolset_Field_Renderer_Preview_Checkboxes' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/checkboxes.php', - 'Toolset_Field_Renderer_Preview_Colorpicker' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/colorpicker.php', - 'Toolset_Field_Renderer_Preview_Date' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/date.php', - 'Toolset_Field_Renderer_Preview_File' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/file.php', - 'Toolset_Field_Renderer_Preview_Image' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/image.php', - 'Toolset_Field_Renderer_Preview_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/post.php', - 'Toolset_Field_Renderer_Preview_Radio' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/radio.php', - 'Toolset_Field_Renderer_Preview_Skype' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/skype.php', - 'Toolset_Field_Renderer_Preview_Textfield' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/textfield.php', - 'Toolset_Field_Renderer_Preview_URL' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/preview/url.php', - 'Toolset_Field_Renderer_Purpose' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/purpose.php', - 'Toolset_Field_Renderer_Toolset_Forms' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/toolset_forms.php', - 'Toolset_Field_Renderer_Toolset_Forms_Repeatable_Group' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/renderer/toolset_forms_repeatable_group.php', - 'Toolset_Field_Type_Definition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition.php', - 'Toolset_Field_Type_Definition_Checkbox' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition/checkbox.php', - 'Toolset_Field_Type_Definition_Checkboxes' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition/checkboxes.php', - 'Toolset_Field_Type_Definition_Date' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition/date.php', - 'Toolset_Field_Type_Definition_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition_factory.php', - 'Toolset_Field_Type_Definition_Numeric' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition/numeric.php', - 'Toolset_Field_Type_Definition_Radio' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition/radio.php', - 'Toolset_Field_Type_Definition_Select' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition/select.php', - 'Toolset_Field_Type_Definition_Singular' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/type/definition/singular.php', - 'Toolset_Field_Utils' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/field/utils.php', - 'Toolset_Files' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/files.php', - 'Toolset_Functions' => __DIR__ . '/..' . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Gui_Base' => __DIR__ . '/..' . '/toolset/toolset-common/utility/gui-base/main.php', - 'Toolset_HelpVideo' => __DIR__ . '/..' . '/toolset/toolset-common/utility/help-videos/toolset-help-videos.php', - 'Toolset_HelpVideosFactoryAbstract' => __DIR__ . '/..' . '/toolset/toolset-common/utility/help-videos/toolset-help-videos.php', - 'Toolset_Internal_Compatibility' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.internal.compatibility.class.php', - 'Toolset_Localization' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.localization.class.php', - 'Toolset_Menu' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.menu.class.php', - 'Toolset_Naming_Helper' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/naming_helper.php', - 'Toolset_Object_Relationship' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.object.relationship.class.php', - 'Toolset_Output_Template' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/abstract.php', - 'Toolset_Output_Template_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template_factory.php', - 'Toolset_Output_Template_Phtml' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/phtml.php', - 'Toolset_Output_Template_Repository' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template_repository.php', - 'Toolset_Output_Template_Repository_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template_repository_abstract.php', - 'Toolset_Output_Template_Static' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/static.php', - 'Toolset_Output_Template_Twig' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/output_template/twig.php', - 'Toolset_Parser' => __DIR__ . '/..' . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Post' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/post.php', - 'Toolset_Post_Translation_Set' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/element/post_translation_set.php', - 'Toolset_Post_Type_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/abstract.php', - 'Toolset_Post_Type_Exclude_List' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/excluded_list.php', - 'Toolset_Post_Type_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/factory.php', - 'Toolset_Post_Type_From_Types' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/from_types.php', - 'Toolset_Post_Type_Labels' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/labels.php', - 'Toolset_Post_Type_List' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/list.php', - 'Toolset_Post_Type_Query' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/query.php', - 'Toolset_Post_Type_Query_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/query_factory.php', - 'Toolset_Post_Type_Registered' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/registered.php', - 'Toolset_Post_Type_Repository' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/post_type/repository.php', - 'Toolset_Postmeta_Access_Loader' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/postmeta_access/loader.php', - 'Toolset_Postmeta_Access_M2m' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/postmeta_access/m2m.php', - 'Toolset_Potential_Association_Query_Arguments' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/query_arguments.php', - 'Toolset_Potential_Association_Query_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/query_factory.php', - 'Toolset_Potential_Association_Query_Filter_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/filters/interface.php', - 'Toolset_Potential_Association_Query_Filter_Posts_Author' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/filters/post/author.php', - 'Toolset_Potential_Association_Query_Filter_Search_String' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/filters/search_string.php', - 'Toolset_Potential_Association_Query_Posts' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/query_posts.php', - 'Toolset_Promotion' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.promotion.class.php', - 'Toolset_Public_API_Loader' => __DIR__ . '/..' . '/toolset/toolset-common/inc/public_api/loader.php', - 'Toolset_Query_Comparison_Operator' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/comparison_operator.php', - 'Toolset_Query_Condition_And' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/condition/and.php', - 'Toolset_Query_Condition_Contradiction' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/condition/contradiction.php', - 'Toolset_Query_Condition_Not' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/condition/not.php', - 'Toolset_Query_Condition_Operator' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/condition/operator.php', - 'Toolset_Query_Condition_Or' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/condition/or.php', - 'Toolset_Query_Condition_Tautology' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/condition/tautology.php', - 'Toolset_Regex' => __DIR__ . '/..' . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Relationship_Cardinality' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/cardinality.php', - 'Toolset_Relationship_Controller' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/controller.php', - 'Toolset_Relationship_Database_Issue_Missing_Element' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/database/issue/missing_element.php', - 'Toolset_Relationship_Database_Operations' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/database/operations.php', - 'Toolset_Relationship_Database_Unique_Table_Alias' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/database/unique_table_alias.php', - 'Toolset_Relationship_Definition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/definition/definition.php', - 'Toolset_Relationship_Definition_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/definition/factory.php', - 'Toolset_Relationship_Definition_Persistence' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/definition/persistence.php', - 'Toolset_Relationship_Definition_Repository' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/definition/repository.php', - 'Toolset_Relationship_Definition_Translator' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/definition/translator.php', - 'Toolset_Relationship_Distinct_Post_Query' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/potential_association/distinct_post_query.php', - 'Toolset_Relationship_Driver' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/driver.php', - 'Toolset_Relationship_Driver_Base' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/driver_base.php', - 'Toolset_Relationship_Element_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/element_type.php', - 'Toolset_Relationship_Migration' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/migration/controller.php', - 'Toolset_Relationship_Migration_Associations' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/migration/associations.php', - 'Toolset_Relationship_Migration_Controller' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/migration/controller.php', - 'Toolset_Relationship_Migration_Post_Translation' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/migration/post_translation.php', - 'Toolset_Relationship_Origin_Post_Reference_Field' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/origin/post_reference_field.php', - 'Toolset_Relationship_Origin_Repeatable_Group' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/origin/repeatable_group.php', - 'Toolset_Relationship_Origin_Wizard' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/origin/wizard.php', - 'Toolset_Relationship_Query' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/relationship_query.php', - 'Toolset_Relationship_Query_Base' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query_base.php', - 'Toolset_Relationship_Query_Cache' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query_cache.php', - 'Toolset_Relationship_Query_Cardinality_Match_Conjunction' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/conjunction.php', - 'Toolset_Relationship_Query_Cardinality_Match_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/factory.php', - 'Toolset_Relationship_Query_Cardinality_Match_Operators' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/operators.php', - 'Toolset_Relationship_Query_Cardinality_Match_Single' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/cardinality_match/single.php', - 'Toolset_Relationship_Query_Condition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/abstract.php', - 'Toolset_Relationship_Query_Condition_Exclude_Relationship' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/exclude_relationship.php', - 'Toolset_Relationship_Query_Condition_Exclude_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/exclude_type.php', - 'Toolset_Relationship_Query_Condition_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition_factory.php', - 'Toolset_Relationship_Query_Condition_Has_Active_Types' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/has_active_types.php', - 'Toolset_Relationship_Query_Condition_Has_Cardinality' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/has_cardinality.php', - 'Toolset_Relationship_Query_Condition_Has_Domain' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/has_domain.php', - 'Toolset_Relationship_Query_Condition_Intermediary_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/intermediary_type.php', - 'Toolset_Relationship_Query_Condition_Is_Active' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/is_active.php', - 'Toolset_Relationship_Query_Condition_Is_Boolean_Flag' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/is_boolean_flag.php', - 'Toolset_Relationship_Query_Condition_Is_Legacy' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/is_legacy.php', - 'Toolset_Relationship_Query_Condition_Origin' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/origin.php', - 'Toolset_Relationship_Query_Condition_Type' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/condition/type.php', - 'Toolset_Relationship_Query_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/query/factory.php', - 'Toolset_Relationship_Query_Sql_Expression_Builder' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/sql_expression_builder.php', - 'Toolset_Relationship_Query_V2' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/query/relationship_query_v2.php', - 'Toolset_Relationship_Role' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/role/role.php', - 'Toolset_Relationship_Role_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/role/abstract.php', - 'Toolset_Relationship_Role_Child' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/role/child.php', - 'Toolset_Relationship_Role_Intermediary' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/role/intermediary.php', - 'Toolset_Relationship_Role_Parent' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/role/parent.php', - 'Toolset_Relationship_Scope' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/scope.php', - 'Toolset_Relationship_Service' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/relationship_service.php', - 'Toolset_Relationship_Slug_Validator' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/relationship/slug_validator.php', - 'Toolset_Relationship_Table_Name' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/database/table_name.php', - 'Toolset_Relationship_Utils' => __DIR__ . '/..' . '/toolset/toolset-common/inc/m2m/utils.php', - 'Toolset_Relevanssi_Compatibility' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.relevanssi.compatibility.class.php', - 'Toolset_Renderer' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/renderer/renderer.php', - 'Toolset_Result' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/result.php', - 'Toolset_Result_Set' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/result_set.php', - 'Toolset_Result_Updated' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/result_updated.php', - 'Toolset_Script' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.assets.manager.class.php', - 'Toolset_Settings' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.settings.class.php', - 'Toolset_Settings_Screen' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.settings.screen.class.php', - 'Toolset_Shortcode_Attr_Field' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/field.php', - 'Toolset_Shortcode_Attr_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/interface.php', - 'Toolset_Shortcode_Attr_Item_Gui_Base' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/base.php', - 'Toolset_Shortcode_Attr_Item_Gui_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/factory.php', - 'Toolset_Shortcode_Attr_Item_Gui_M2m' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/m2m.php', - 'Toolset_Shortcode_Attr_Item_Gui_O2m' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/o2m.php', - 'Toolset_Shortcode_Attr_Item_Gui_O2o' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/o2o.php', - 'Toolset_Shortcode_Attr_Item_Gui_Option' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/gui/option.php', - 'Toolset_Shortcode_Attr_Item_Id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/id.php', - 'Toolset_Shortcode_Attr_Item_Legacy' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/legacy.php', - 'Toolset_Shortcode_Attr_Item_M2M' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/shortcode/attr/item/m2m.php', - 'Toolset_Shortcode_Generator' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.shortcode.generator.class.php', - 'Toolset_Shortcode_Transformer' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.shortcode.transformer.class.php', - 'Toolset_Singleton_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/utility/singleton_factory_pre_php_5_6.php', - 'Toolset_Stack' => __DIR__ . '/..' . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Style' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.assets.manager.class.php', - 'Toolset_Template_Dialog_Box' => __DIR__ . '/..' . '/toolset/toolset-common/utility/gui-base/template_dialog_box.php', - 'Toolset_Tokenizer' => __DIR__ . '/..' . '/toolset/toolset-common/expression-parser/parser.php', - 'Toolset_Twig_Autoloader' => __DIR__ . '/..' . '/toolset/toolset-common/utility/gui-base/twig_autoloader.php', - 'Toolset_Twig_Dialog_Box' => __DIR__ . '/..' . '/toolset/toolset-common/utility/gui-base/twig_dialog_box.php', - 'Toolset_Twig_Dialog_Box_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/utility/gui-base/twig_dialog_box_factory.php', - 'Toolset_Twig_Extensions' => __DIR__ . '/..' . '/toolset/toolset-common/utility/gui-base/twig_extensions.php', - 'Toolset_Upgrade_Command_Definition' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/command_definition.php', - 'Toolset_Upgrade_Command_Definition_Repository' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/command_definition_repository.php', - 'Toolset_Upgrade_Command_Delete_Obsolete_Upgrade_Options' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/command/delete_obsolete_version_number_option.php', - 'Toolset_Upgrade_Command_Factory' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/command_factory.php', - 'Toolset_Upgrade_Command_M2M_V1_Database_Structure_Upgrade' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/command/m2m_v1_database_structure_upgrade.php', - 'Toolset_Upgrade_Command_M2M_V2_Database_Structure_Upgrade' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/command/m2m_v2_database_structure_upgrade.php', - 'Toolset_Upgrade_Controller' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/controller.php', - 'Toolset_Upgrade_Executed_Commands' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/upgrade/executed_commands.php', - 'Toolset_User_Editors_Editor_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/abstract.php', - 'Toolset_User_Editors_Editor_Avada' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/avada.php', - 'Toolset_User_Editors_Editor_Basic' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/basic.php', - 'Toolset_User_Editors_Editor_Beaver' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/beaver.php', - 'Toolset_User_Editors_Editor_Divi' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/divi.php', - 'Toolset_User_Editors_Editor_Gutenberg' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/gutenberg.php', - 'Toolset_User_Editors_Editor_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/interface.php', - 'Toolset_User_Editors_Editor_Native' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/native.php', - 'Toolset_User_Editors_Editor_Screen_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/abstract.php', - 'Toolset_User_Editors_Editor_Screen_Avada_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/avada/backend.php', - 'Toolset_User_Editors_Editor_Screen_Basic_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/basic/backend.php', - 'Toolset_User_Editors_Editor_Screen_Beaver_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/beaver/backend.php', - 'Toolset_User_Editors_Editor_Screen_Beaver_Frontend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php', - 'Toolset_User_Editors_Editor_Screen_Beaver_Frontend_Editor' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/beaver/frontend-editor.php', - 'Toolset_User_Editors_Editor_Screen_Divi_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/divi/backend.php', - 'Toolset_User_Editors_Editor_Screen_Divi_Frontend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/divi/frontend.php', - 'Toolset_User_Editors_Editor_Screen_Gutenberg_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.php', - 'Toolset_User_Editors_Editor_Screen_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/interface.php', - 'Toolset_User_Editors_Editor_Screen_Native_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/native/backend.php', - 'Toolset_User_Editors_Editor_Screen_Visual_Composer_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.php', - 'Toolset_User_Editors_Editor_Screen_Visual_Composer_Frontend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/screen/visual-composer/frontend.php', - 'Toolset_User_Editors_Editor_Visual_Composer' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/editor/visual-composer.php', - 'Toolset_User_Editors_Manager' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/manager.php', - 'Toolset_User_Editors_Manager_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/interface.php', - 'Toolset_User_Editors_Medium_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/abstract.php', - 'Toolset_User_Editors_Medium_Content_Template' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/content-template.php', - 'Toolset_User_Editors_Medium_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/interface.php', - 'Toolset_User_Editors_Medium_Screen_Abstract' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/screen/abstract.php', - 'Toolset_User_Editors_Medium_Screen_Content_Template_Backend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/screen/content-template/backend.php', - 'Toolset_User_Editors_Medium_Screen_Content_Template_Frontend' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/screen/content-template/frontend.php', - 'Toolset_User_Editors_Medium_Screen_Content_Template_Frontend_Editor' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.php', - 'Toolset_User_Editors_Medium_Screen_Interface' => __DIR__ . '/..' . '/toolset/toolset-common/user-editors/medium/screen/interface.php', - 'Toolset_Utils' => __DIR__ . '/..' . '/toolset/toolset-common/utility/utils.php', - 'Toolset_VideoDetachedPage' => __DIR__ . '/..' . '/toolset/toolset-common/utility/help-videos/toolset-help-videos.php', - 'Toolset_WPLogger' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.wplogger.class.php', - 'Toolset_WPML_Compatibility' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.wpml.compatibility.class.php', - 'Toolset_Wp_Query_Adjustments' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/abstract.php', - 'Toolset_Wp_Query_Adjustments_Legacy_Relationships' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/legacy_relationships.php', - 'Toolset_Wp_Query_Adjustments_Loader' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/loader.php', - 'Toolset_Wp_Query_Adjustments_M2m' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/m2m.php', - 'Toolset_Wp_Query_Adjustments_Table_Join_Manager' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/wp_query_adjustments/table_join_manager.php', - 'Toolset_Wpdb_User' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/wpdb_user.php', - 'Toolset_Wpml_Utils' => __DIR__ . '/..' . '/toolset/toolset-common/inc/autoloaded/wpml_utils.php', - 'Twig_Autoloader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Autoloader.php', - 'Twig_BaseNodeVisitor' => __DIR__ . '/..' . '/twig/twig/lib/Twig/BaseNodeVisitor.php', - 'Twig_CacheInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/CacheInterface.php', - 'Twig_Cache_Filesystem' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Cache/Filesystem.php', - 'Twig_Cache_Null' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Cache/Null.php', - 'Twig_Compiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Compiler.php', - 'Twig_CompilerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/CompilerInterface.php', - 'Twig_ContainerRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ContainerRuntimeLoader.php', - 'Twig_Environment' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Environment.php', - 'Twig_Error' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error.php', - 'Twig_Error_Loader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Loader.php', - 'Twig_Error_Runtime' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Runtime.php', - 'Twig_Error_Syntax' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Syntax.php', - 'Twig_ExistsLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExistsLoaderInterface.php', - 'Twig_ExpressionParser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExpressionParser.php', - 'Twig_Extension' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension.php', - 'Twig_ExtensionInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExtensionInterface.php', - 'Twig_Extension_Core' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Core.php', - 'Twig_Extension_Debug' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Debug.php', - 'Twig_Extension_Escaper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Escaper.php', - 'Twig_Extension_GlobalsInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/GlobalsInterface.php', - 'Twig_Extension_InitRuntimeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php', - 'Twig_Extension_Optimizer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Optimizer.php', - 'Twig_Extension_Profiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Profiler.php', - 'Twig_Extension_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Sandbox.php', - 'Twig_Extension_Staging' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Staging.php', - 'Twig_Extension_StringLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/StringLoader.php', - 'Twig_FactoryRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php', - 'Twig_FileExtensionEscapingStrategy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php', - 'Twig_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter.php', - 'Twig_FilterCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterCallableInterface.php', - 'Twig_FilterInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterInterface.php', - 'Twig_Filter_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Function.php', - 'Twig_Filter_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Method.php', - 'Twig_Filter_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Node.php', - 'Twig_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function.php', - 'Twig_FunctionCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FunctionCallableInterface.php', - 'Twig_FunctionInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FunctionInterface.php', - 'Twig_Function_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Function.php', - 'Twig_Function_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Method.php', - 'Twig_Function_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Node.php', - 'Twig_Lexer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Lexer.php', - 'Twig_LexerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/LexerInterface.php', - 'Twig_LoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/LoaderInterface.php', - 'Twig_Loader_Array' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Array.php', - 'Twig_Loader_Chain' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Chain.php', - 'Twig_Loader_Filesystem' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Filesystem.php', - 'Twig_Loader_String' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/String.php', - 'Twig_Markup' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Markup.php', - 'Twig_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node.php', - 'Twig_NodeCaptureInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeCaptureInterface.php', - 'Twig_NodeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeInterface.php', - 'Twig_NodeOutputInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeOutputInterface.php', - 'Twig_NodeTraverser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeTraverser.php', - 'Twig_NodeVisitorInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitorInterface.php', - 'Twig_NodeVisitor_Escaper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Escaper.php', - 'Twig_NodeVisitor_Optimizer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Optimizer.php', - 'Twig_NodeVisitor_SafeAnalysis' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php', - 'Twig_NodeVisitor_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Sandbox.php', - 'Twig_Node_AutoEscape' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/AutoEscape.php', - 'Twig_Node_Block' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Block.php', - 'Twig_Node_BlockReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/BlockReference.php', - 'Twig_Node_Body' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Body.php', - 'Twig_Node_CheckSecurity' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/CheckSecurity.php', - 'Twig_Node_Do' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Do.php', - 'Twig_Node_Embed' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Embed.php', - 'Twig_Node_Expression' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression.php', - 'Twig_Node_Expression_Array' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Array.php', - 'Twig_Node_Expression_AssignName' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/AssignName.php', - 'Twig_Node_Expression_Binary' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary.php', - 'Twig_Node_Expression_Binary_Add' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Add.php', - 'Twig_Node_Expression_Binary_And' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/And.php', - 'Twig_Node_Expression_Binary_BitwiseAnd' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php', - 'Twig_Node_Expression_Binary_BitwiseOr' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php', - 'Twig_Node_Expression_Binary_BitwiseXor' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php', - 'Twig_Node_Expression_Binary_Concat' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php', - 'Twig_Node_Expression_Binary_Div' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Div.php', - 'Twig_Node_Expression_Binary_EndsWith' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php', - 'Twig_Node_Expression_Binary_Equal' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php', - 'Twig_Node_Expression_Binary_FloorDiv' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php', - 'Twig_Node_Expression_Binary_Greater' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php', - 'Twig_Node_Expression_Binary_GreaterEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php', - 'Twig_Node_Expression_Binary_In' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/In.php', - 'Twig_Node_Expression_Binary_Less' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Less.php', - 'Twig_Node_Expression_Binary_LessEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php', - 'Twig_Node_Expression_Binary_Matches' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php', - 'Twig_Node_Expression_Binary_Mod' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php', - 'Twig_Node_Expression_Binary_Mul' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php', - 'Twig_Node_Expression_Binary_NotEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php', - 'Twig_Node_Expression_Binary_NotIn' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php', - 'Twig_Node_Expression_Binary_Or' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Or.php', - 'Twig_Node_Expression_Binary_Power' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Power.php', - 'Twig_Node_Expression_Binary_Range' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Range.php', - 'Twig_Node_Expression_Binary_StartsWith' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php', - 'Twig_Node_Expression_Binary_Sub' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php', - 'Twig_Node_Expression_BlockReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/BlockReference.php', - 'Twig_Node_Expression_Call' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Call.php', - 'Twig_Node_Expression_Conditional' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Conditional.php', - 'Twig_Node_Expression_Constant' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Constant.php', - 'Twig_Node_Expression_ExtensionReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php', - 'Twig_Node_Expression_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Filter.php', - 'Twig_Node_Expression_Filter_Default' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Filter/Default.php', - 'Twig_Node_Expression_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Function.php', - 'Twig_Node_Expression_GetAttr' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/GetAttr.php', - 'Twig_Node_Expression_MethodCall' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/MethodCall.php', - 'Twig_Node_Expression_Name' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Name.php', - 'Twig_Node_Expression_NullCoalesce' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php', - 'Twig_Node_Expression_Parent' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Parent.php', - 'Twig_Node_Expression_TempName' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/TempName.php', - 'Twig_Node_Expression_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test.php', - 'Twig_Node_Expression_Test_Constant' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Constant.php', - 'Twig_Node_Expression_Test_Defined' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Defined.php', - 'Twig_Node_Expression_Test_Divisibleby' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php', - 'Twig_Node_Expression_Test_Even' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Even.php', - 'Twig_Node_Expression_Test_Null' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Null.php', - 'Twig_Node_Expression_Test_Odd' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Odd.php', - 'Twig_Node_Expression_Test_Sameas' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php', - 'Twig_Node_Expression_Unary' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary.php', - 'Twig_Node_Expression_Unary_Neg' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php', - 'Twig_Node_Expression_Unary_Not' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Not.php', - 'Twig_Node_Expression_Unary_Pos' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php', - 'Twig_Node_Flush' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Flush.php', - 'Twig_Node_For' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/For.php', - 'Twig_Node_ForLoop' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/ForLoop.php', - 'Twig_Node_If' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/If.php', - 'Twig_Node_Import' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Import.php', - 'Twig_Node_Include' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Include.php', - 'Twig_Node_Macro' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Macro.php', - 'Twig_Node_Module' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Module.php', - 'Twig_Node_Print' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Print.php', - 'Twig_Node_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Sandbox.php', - 'Twig_Node_SandboxedPrint' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SandboxedPrint.php', - 'Twig_Node_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Set.php', - 'Twig_Node_SetTemp' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SetTemp.php', - 'Twig_Node_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Spaceless.php', - 'Twig_Node_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Text.php', - 'Twig_Node_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/With.php', - 'Twig_Parser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Parser.php', - 'Twig_ParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ParserInterface.php', - 'Twig_Profiler_Dumper_Blackfire' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php', - 'Twig_Profiler_Dumper_Html' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Html.php', - 'Twig_Profiler_Dumper_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Text.php', - 'Twig_Profiler_NodeVisitor_Profiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php', - 'Twig_Profiler_Node_EnterProfile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php', - 'Twig_Profiler_Node_LeaveProfile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php', - 'Twig_Profiler_Profile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Profile.php', - 'Twig_RuntimeLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/RuntimeLoaderInterface.php', - 'Twig_Sandbox_SecurityError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityError.php', - 'Twig_Sandbox_SecurityNotAllowedFilterError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php', - 'Twig_Sandbox_SecurityNotAllowedFunctionError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php', - 'Twig_Sandbox_SecurityNotAllowedMethodError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php', - 'Twig_Sandbox_SecurityNotAllowedPropertyError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php', - 'Twig_Sandbox_SecurityNotAllowedTagError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php', - 'Twig_Sandbox_SecurityPolicy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php', - 'Twig_Sandbox_SecurityPolicyInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php', - 'Twig_SimpleFilter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleFilter.php', - 'Twig_SimpleFunction' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleFunction.php', - 'Twig_SimpleTest' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleTest.php', - 'Twig_Source' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Source.php', - 'Twig_SourceContextLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php', - 'Twig_Template' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Template.php', - 'Twig_TemplateInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateInterface.php', - 'Twig_TemplateWrapper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateWrapper.php', - 'Twig_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test.php', - 'Twig_TestCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestCallableInterface.php', - 'Twig_TestInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestInterface.php', - 'Twig_Test_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Function.php', - 'Twig_Test_IntegrationTestCase' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/IntegrationTestCase.php', - 'Twig_Test_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Method.php', - 'Twig_Test_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Node.php', - 'Twig_Test_NodeTestCase' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/NodeTestCase.php', - 'Twig_Token' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Token.php', - 'Twig_TokenParser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser.php', - 'Twig_TokenParserBroker' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserBroker.php', - 'Twig_TokenParserBrokerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserBrokerInterface.php', - 'Twig_TokenParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserInterface.php', - 'Twig_TokenParser_AutoEscape' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/AutoEscape.php', - 'Twig_TokenParser_Block' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Block.php', - 'Twig_TokenParser_Do' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Do.php', - 'Twig_TokenParser_Embed' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Embed.php', - 'Twig_TokenParser_Extends' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Extends.php', - 'Twig_TokenParser_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Filter.php', - 'Twig_TokenParser_Flush' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Flush.php', - 'Twig_TokenParser_For' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/For.php', - 'Twig_TokenParser_From' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/From.php', - 'Twig_TokenParser_If' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/If.php', - 'Twig_TokenParser_Import' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Import.php', - 'Twig_TokenParser_Include' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Include.php', - 'Twig_TokenParser_Macro' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Macro.php', - 'Twig_TokenParser_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Sandbox.php', - 'Twig_TokenParser_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Set.php', - 'Twig_TokenParser_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Spaceless.php', - 'Twig_TokenParser_Use' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Use.php', - 'Twig_TokenParser_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/With.php', - 'Twig_TokenStream' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenStream.php', - 'Twig_Util_DeprecationCollector' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/DeprecationCollector.php', - 'Twig_Util_TemplateDirIterator' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php', - 'Types_Admin' => __DIR__ . '/../..' . '/application/controllers/admin.php', - 'Types_Admin_Menu' => __DIR__ . '/../..' . '/application/controllers/admin_menu.php', - 'Types_Admin_Notices_Free_Version' => __DIR__ . '/../..' . '/application/controllers/admin_notice/free-version.php', - 'Types_Ajax' => __DIR__ . '/../..' . '/application/controllers/ajax.php', - 'Types_Ajax_Handler_Abstract' => __DIR__ . '/../..' . '/application/controllers/ajax/handler/abstract.php', - 'Types_Ajax_Handler_Check_Slug_Conflicts' => __DIR__ . '/../..' . '/application/controllers/ajax/handler/check_slug_conflicts.php', - 'Types_Ajax_Handler_Field_Control_Action' => __DIR__ . '/../..' . '/application/controllers/ajax/handler/field_control_action.php', - 'Types_Ajax_Handler_Interface' => __DIR__ . '/../..' . '/application/controllers/ajax/handler_interface.php', - 'Types_Ajax_Handler_Settings_Action' => __DIR__ . '/../..' . '/application/controllers/ajax/handler/settings_action.php', - 'Types_Api' => __DIR__ . '/../..' . '/application/controllers/api.php', - 'Types_Api_Handler_Filter_Get_Field_Group_Ids_By_Post_Type' => __DIR__ . '/../..' . '/application/controllers/api/handler/filter_get_field_group_ids_by_post_type.php', - 'Types_Api_Handler_Import_From_Zip_File' => __DIR__ . '/../..' . '/application/controllers/api/handler/import_from_zip_file.php', - 'Types_Api_Handler_Interface' => __DIR__ . '/../..' . '/application/controllers/api/handler/interface.php', - 'Types_Api_Handler_Query_Groups' => __DIR__ . '/../..' . '/application/controllers/api/handler/query_groups.php', - 'Types_Asset_Help_Tab_Loader' => __DIR__ . '/../..' . '/application/controllers/asset/help_tab_loader.php', - 'Types_Asset_Manager' => __DIR__ . '/../..' . '/application/controllers/asset/manager.php', - 'Types_Assets' => __DIR__ . '/../..' . '/application/controllers/assets.php', - 'Types_Dialog_Box' => __DIR__ . '/../..' . '/application/controllers/dialog_box.php', - 'Types_Embedded' => __DIR__ . '/../..' . '/application/controllers/embedded.php', - 'Types_Field_Group' => __DIR__ . '/../..' . '/application/models/field/group.php', - 'Types_Field_Group_Factory' => __DIR__ . '/../..' . '/application/models/field/group/factory.php', - 'Types_Field_Group_Post' => __DIR__ . '/../..' . '/application/models/field/group/post.php', - 'Types_Field_Group_Post_Factory' => __DIR__ . '/../..' . '/application/models/field/group/post_factory.php', - 'Types_Field_Group_Term' => __DIR__ . '/../..' . '/application/models/field/group/term.php', - 'Types_Field_Group_Term_Factory' => __DIR__ . '/../..' . '/application/models/field/group/term_factory.php', - 'Types_Field_Group_User' => __DIR__ . '/../..' . '/application/models/field/group/user.php', - 'Types_Field_Group_User_Factory' => __DIR__ . '/../..' . '/application/models/field/group/user_factory.php', - 'Types_Field_Type_Converter' => __DIR__ . '/../..' . '/application/controllers/field/type_converter.php', - 'Types_Field_Type_Definition' => __DIR__ . '/../..' . '/application/models/field/type/definition.php', - 'Types_Field_Type_Definition_Checkbox' => __DIR__ . '/../..' . '/application/models/field/gateway/checkbox.php', - 'Types_Field_Type_Definition_Checkboxes' => __DIR__ . '/../..' . '/application/models/field/gateway/checkboxes.php', - 'Types_Field_Type_Definition_Date' => __DIR__ . '/../..' . '/application/models/field/gateway/date.php', - 'Types_Field_Type_Definition_Factory' => __DIR__ . '/../..' . '/application/models/field/type/definition_factory.php', - 'Types_Field_Type_Definition_Numeric' => __DIR__ . '/../..' . '/application/models/field/gateway/numeric.php', - 'Types_Field_Type_Definition_Radio' => __DIR__ . '/../..' . '/application/models/field/gateway/radio.php', - 'Types_Field_Type_Definition_Select' => __DIR__ . '/../..' . '/application/models/field/gateway/select.php', - 'Types_Field_Type_Definition_Singular' => __DIR__ . '/../..' . '/application/models/field/gateway/singular.php', - 'Types_Field_Utils' => __DIR__ . '/../..' . '/application/controllers/field/utils.php', - 'Types_Frontend' => __DIR__ . '/../..' . '/application/controllers/frontend.php', - 'Types_Helper_Condition' => __DIR__ . '/../..' . '/application/models/helper/condition.php', - 'Types_Helper_Condition_Archive_Exists' => __DIR__ . '/../..' . '/application/models/helper/condition/archive/exists.php', - 'Types_Helper_Condition_Archive_Has_Fields' => __DIR__ . '/../..' . '/application/models/helper/condition/archive/has_fields.php', - 'Types_Helper_Condition_Archive_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/archive/missing.php', - 'Types_Helper_Condition_Archive_No_Fields' => __DIR__ . '/../..' . '/application/models/helper/condition/archive/no_fields.php', - 'Types_Helper_Condition_Archive_No_Support' => __DIR__ . '/../..' . '/application/models/helper/condition/archive/no_support.php', - 'Types_Helper_Condition_Archive_Support' => __DIR__ . '/../..' . '/application/models/helper/condition/archive/support.php', - 'Types_Helper_Condition_Cred_Active' => __DIR__ . '/../..' . '/application/models/helper/condition/cred/active.php', - 'Types_Helper_Condition_Cred_Forms_Exist' => __DIR__ . '/../..' . '/application/models/helper/condition/cred/forms_exist.php', - 'Types_Helper_Condition_Cred_Forms_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/cred/forms_missing.php', - 'Types_Helper_Condition_Cred_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/cred/missing.php', - 'Types_Helper_Condition_Layouts_Active' => __DIR__ . '/../..' . '/application/models/helper/condition/layouts/active.php', - 'Types_Helper_Condition_Layouts_Archive_Exists' => __DIR__ . '/../..' . '/application/models/helper/condition/layouts/archive_exists.php', - 'Types_Helper_Condition_Layouts_Archive_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/layouts/archive_missing.php', - 'Types_Helper_Condition_Layouts_Compatible' => __DIR__ . '/../..' . '/application/models/helper/condition/layouts/compatible.php', - 'Types_Helper_Condition_Layouts_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/layouts/missing.php', - 'Types_Helper_Condition_Layouts_Template_Exists' => __DIR__ . '/../..' . '/application/models/helper/condition/layouts/template_exists.php', - 'Types_Helper_Condition_Layouts_Template_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/layouts/template_missing.php', - 'Types_Helper_Condition_Screen' => __DIR__ . '/../..' . '/application/models/helper/condition/screen.php', - 'Types_Helper_Condition_Single_Exists' => __DIR__ . '/../..' . '/application/models/helper/condition/single/exists.php', - 'Types_Helper_Condition_Single_Has_Fields' => __DIR__ . '/../..' . '/application/models/helper/condition/single/has_fields.php', - 'Types_Helper_Condition_Single_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/single/missing.php', - 'Types_Helper_Condition_Single_No_Fields' => __DIR__ . '/../..' . '/application/models/helper/condition/single/no_fields.php', - 'Types_Helper_Condition_Template' => __DIR__ . '/../..' . '/application/models/helper/condition/template.php', - 'Types_Helper_Condition_Type_Fields_Assigned' => __DIR__ . '/../..' . '/application/models/helper/condition/type/fields_assigned.php', - 'Types_Helper_Condition_Type_No_Post_Or_Page' => __DIR__ . '/../..' . '/application/models/helper/condition/type/no_post_or_page.php', - 'Types_Helper_Condition_Type_Post_Or_Page' => __DIR__ . '/../..' . '/application/models/helper/condition/type/post_or_page.php', - 'Types_Helper_Condition_Views_Active' => __DIR__ . '/../..' . '/application/models/helper/condition/views/active.php', - 'Types_Helper_Condition_Views_Archive_Exists' => __DIR__ . '/../..' . '/application/models/helper/condition/views/archive_exists.php', - 'Types_Helper_Condition_Views_Archive_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/views/archive_missing.php', - 'Types_Helper_Condition_Views_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/views/missing.php', - 'Types_Helper_Condition_Views_Template_Exists' => __DIR__ . '/../..' . '/application/models/helper/condition/views/template_exists.php', - 'Types_Helper_Condition_Views_Template_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/views/template_missing.php', - 'Types_Helper_Condition_Views_Views_Exist' => __DIR__ . '/../..' . '/application/models/helper/condition/views/views_exist.php', - 'Types_Helper_Condition_Views_Views_Missing' => __DIR__ . '/../..' . '/application/models/helper/condition/views/views_missing.php', - 'Types_Helper_Create_Content_Template' => __DIR__ . '/../..' . '/application/models/helper/create/content_template.php', - 'Types_Helper_Create_Form' => __DIR__ . '/../..' . '/application/models/helper/create/form.php', - 'Types_Helper_Create_Layout' => __DIR__ . '/../..' . '/application/models/helper/create/layout.php', - 'Types_Helper_Create_View' => __DIR__ . '/../..' . '/application/models/helper/create/view.php', - 'Types_Helper_Create_Wordpress_Archive' => __DIR__ . '/../..' . '/application/models/helper/create/wordpress_archive.php', - 'Types_Helper_Output_Interface' => __DIR__ . '/../..' . '/application/models/helper/output/interface.php', - 'Types_Helper_Output_Meta_Box' => __DIR__ . '/../..' . '/application/models/helper/output/meta_box.php', - 'Types_Helper_Placeholder' => __DIR__ . '/../..' . '/application/models/helper/placeholder.php', - 'Types_Helper_Twig' => __DIR__ . '/../..' . '/application/models/helper/twig.php', - 'Types_Helper_Url' => __DIR__ . '/../..' . '/application/models/helper/url.php', - 'Types_Import_Export' => __DIR__ . '/../..' . '/application/controllers/import_export.php', - 'Types_Information_Container' => __DIR__ . '/../..' . '/application/models/information/container.php', - 'Types_Information_Controller' => __DIR__ . '/../..' . '/application/controllers/information/controller.php', - 'Types_Information_Message' => __DIR__ . '/../..' . '/application/models/information/message.php', - 'Types_Information_Message_Post_Type' => __DIR__ . '/../..' . '/application/models/information/message/post_type.php', - 'Types_Information_Table' => __DIR__ . '/../..' . '/application/models/information/table.php', - 'Types_Interop_Handler_Divi' => __DIR__ . '/../..' . '/application/controllers/interop/handler/divi.php', - 'Types_Interop_Handler_Interface' => __DIR__ . '/../..' . '/application/controllers/interop/handler_interface.php', - 'Types_Interop_Handler_The7' => __DIR__ . '/../..' . '/application/controllers/interop/handler/the7.php', - 'Types_Interop_Handler_Use_Any_Font' => __DIR__ . '/../..' . '/application/controllers/interop/handler/use_any_font.php', - 'Types_Interop_Handler_Wpml' => __DIR__ . '/../..' . '/application/controllers/interop/handler/wpml.php', - 'Types_Interop_Mediator' => __DIR__ . '/../..' . '/application/controllers/interop/mediator.php', - 'Types_Main' => __DIR__ . '/../..' . '/application/controllers/main.php', - 'Types_Page_Abstract' => __DIR__ . '/../..' . '/application/controllers/page/abstract.php', - 'Types_Page_Dashboard' => __DIR__ . '/../..' . '/application/controllers/page/dashboard.php', - 'Types_Page_Extension_Edit_Post' => __DIR__ . '/../..' . '/application/controllers/page/extension/edit_post.php', - 'Types_Page_Extension_Edit_Post_Fields' => __DIR__ . '/../..' . '/application/controllers/page/extension/edit_post_fields.php', - 'Types_Page_Extension_Edit_Post_Type' => __DIR__ . '/../..' . '/application/controllers/page/extension/edit_post_type.php', - 'Types_Page_Extension_Settings' => __DIR__ . '/../..' . '/application/controllers/page/extension/settings.php', - 'Types_Page_Field_Control' => __DIR__ . '/../..' . '/application/controllers/page/field_control.php', - 'Types_Page_Hidden_Helper' => __DIR__ . '/../..' . '/application/controllers/page/hidden/helper.php', - 'Types_Post_Type' => __DIR__ . '/../..' . '/application/models/post_type.php', - 'Types_Setting' => __DIR__ . '/../..' . '/application/models/setting.php', - 'Types_Setting_Boolean' => __DIR__ . '/../..' . '/application/models/setting/boolean.php', - 'Types_Setting_Interface' => __DIR__ . '/../..' . '/application/models/setting/interface.php', - 'Types_Setting_Option' => __DIR__ . '/../..' . '/application/models/setting/option.php', - 'Types_Setting_Option_Interface' => __DIR__ . '/../..' . '/application/models/setting/option/interface.php', - 'Types_Setting_Preset_Information_Table' => __DIR__ . '/../..' . '/application/models/setting/preset/information_table.php', - 'Types_Taxonomy' => __DIR__ . '/../..' . '/application/models/taxonomy.php', - 'Types_Twig_Autoloader' => __DIR__ . '/../..' . '/application/controllers/twig_autoloader.php', - 'Types_Upgrade' => __DIR__ . '/../..' . '/application/controllers/upgrade.php', - 'Types_Utils' => __DIR__ . '/../..' . '/application/controllers/admin_notice/utils.php', - 'Types_Utils_Post_Type_Option' => __DIR__ . '/../..' . '/application/controllers/utils/post_type_option.php', - 'Types_Wpml_Field_Group' => __DIR__ . '/../..' . '/application/models/wpml/field_group.php', - 'Types_Wpml_Field_Group_String' => __DIR__ . '/../..' . '/application/models/wpml/field/group/string.php', - 'Types_Wpml_Field_Group_String_Description' => __DIR__ . '/../..' . '/application/models/wpml/field/group/string/description.php', - 'Types_Wpml_Field_Group_String_Name' => __DIR__ . '/../..' . '/application/models/wpml/field/group/string/name.php', - 'Types_Wpml_Interface' => __DIR__ . '/../..' . '/application/models/wpml/interface.php', - 'WPToolset_Cake_Validation' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/lib/CakePHP-Validation.php', - 'WPToolset_Field_Audio' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.audio.php', - 'WPToolset_Field_Button' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.button.php', - 'WPToolset_Field_Checkbox' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.checkbox.php', - 'WPToolset_Field_Checkboxes' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.checkboxes.php', - 'WPToolset_Field_Colorpicker' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.colorpicker.php', - 'WPToolset_Field_Date' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.date.php', - 'WPToolset_Field_Date_Scripts' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.date.scripts.php', - 'WPToolset_Field_Email' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.email.php', - 'WPToolset_Field_Embed' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.embed.php', - 'WPToolset_Field_File' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.file.php', - 'WPToolset_Field_Hidden' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.hidden.php', - 'WPToolset_Field_Image' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.image.php', - 'WPToolset_Field_Integer' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.integer.php', - 'WPToolset_Field_Numeric' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.numeric.php', - 'WPToolset_Field_Password' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.password.php', - 'WPToolset_Field_Phone' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.phone.php', - 'WPToolset_Field_Post' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.post.php', - 'WPToolset_Field_Radios' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.radios.php', - 'WPToolset_Field_Recaptcha' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.recaptcha.php', - 'WPToolset_Field_Recaptcha_v1' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.recaptcha-v1.php', - 'WPToolset_Field_Select' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.select.php', - 'WPToolset_Field_Skype' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.skype.php', - 'WPToolset_Field_Submit' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.submit.php', - 'WPToolset_Field_Taxonomy' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.taxonomy.php', - 'WPToolset_Field_Taxonomyhierarchical' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.taxonomyhierarchical.php', - 'WPToolset_Field_Textarea' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.textarea.php', - 'WPToolset_Field_Textfield' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.textfield.php', - 'WPToolset_Field_Url' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.url.php', - 'WPToolset_Field_Video' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.video.php', - 'WPToolset_Field_Wysiwyg' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.wysiwyg.php', - 'WPToolset_Forms_Bootstrap' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/bootstrap.php', - 'WPToolset_Forms_Conditional' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.conditional.php', - 'WPToolset_Forms_Conditional_RFG' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.conditional.rfg.php', - 'WPToolset_Forms_Repetitive' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.repetitive.php', - 'WPToolset_Forms_Validation' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.validation.php', - 'WPToolset_Types' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.types.php', - 'WPV_Handle_Users_Functions' => __DIR__ . '/..' . '/toolset/toolset-common/toolset-forms/classes/class.conditional.php', - 'WPV_wpcf_switch_post_from_attr_id' => __DIR__ . '/..' . '/toolset/toolset-common/inc/toolset.object.relationship.class.php', - 'xrstf\\Composer52\\AutoloadGenerator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php', - 'xrstf\\Composer52\\Generator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit39d4b17bdb5377514bee52a66c64b5fc::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit39d4b17bdb5377514bee52a66c64b5fc::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit39d4b17bdb5377514bee52a66c64b5fc::$prefixesPsr0; - $loader->classMap = ComposerStaticInit39d4b17bdb5377514bee52a66c64b5fc::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/composer/installed.json b/backend/wordpress/wp-content/plugins/types/vendor/composer/installed.json deleted file mode 100644 index e650f40..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/composer/installed.json +++ /dev/null @@ -1,566 +0,0 @@ -[ - { - "name": "composer/installers", - "version": "v1.4.0", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", - "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "4.1.*" - }, - "time": "2017-08-09T07:53:48+00:00", - "type": "composer-plugin", - "extra": { - "class": "Composer\\Installers\\Plugin", - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\Installers\\": "src/Composer/Installers" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "https://composer.github.io/installers/", - "keywords": [ - "Craft", - "Dolibarr", - "Eliasis", - "Hurad", - "ImageCMS", - "Kanboard", - "Lan Management System", - "MODX Evo", - "Mautic", - "Maya", - "OXID", - "Plentymarkets", - "Porto", - "RadPHP", - "SMF", - "Thelia", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "attogram", - "bitrix", - "cakephp", - "chef", - "cockpit", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "eZ Platform", - "elgg", - "expressionengine", - "fuelphp", - "grav", - "installer", - "itop", - "joomla", - "kohana", - "laravel", - "lavalite", - "lithium", - "magento", - "mako", - "mediawiki", - "modulework", - "moodle", - "osclass", - "phpbb", - "piwik", - "ppi", - "puppet", - "reindex", - "roundcube", - "shopware", - "silverstripe", - "sydes", - "symfony", - "typo3", - "wordpress", - "yawik", - "zend", - "zikula" - ] - }, - { - "name": "otgs/icons", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://git.onthegosystems.com/otgs-public/otgs-icons.git", - "reference": "622ab3c0549b70c87fa20de1c302ffcc07ea8f9c" - }, - "time": "2018-04-06T08:47:19+00:00", - "type": "library", - "installation-source": "source", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0" - ], - "description": "Toolset and WPML icons" - }, - { - "name": "otgs/installer", - "version": "1.8.20", - "version_normalized": "1.8.20.0", - "source": { - "type": "git", - "url": "ssh://git@git.onthegosystems.com:10022/installer/installer.git", - "reference": "b0e7b74f6f2c8436529fb84f11ca0e636d6ae4dd" - }, - "require": { - "composer/installers": "~1.0", - "otgs/icons": "dev-master", - "php": ">=5.2.0", - "roave/security-advisories": "dev-master", - "twig/twig": "~1.32.0", - "xrstf/composer-php52": "1.*" - }, - "require-dev": { - "otgs/build-tools": "~0.1", - "otgs/build-tools-ci": "~0.7", - "otgs/unit-tests-framework": "~1.2.0", - "sebastian/phpcpd": "^3.0" - }, - "time": "2018-06-13T17:26:51+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev", - "dev-develop": "1.8.x-dev" - } - }, - "installation-source": "source", - "scripts": { - "test": [ - "phpunit" - ], - "post-install-cmd": [ - "xrstf\\Composer52\\Generator::onPostInstallCmd", - "OTGS\\Composer\\Scripts\\Install::PHPCSStandards" - ], - "post-update-cmd": [ - "xrstf\\Composer52\\Generator::onPostInstallCmd", - "OTGS\\Composer\\Scripts\\Install::PHPCSStandards" - ], - "post-autoload-dump": [ - "xrstf\\Composer52\\Generator::onPostInstallCmd" - ] - }, - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Mihai Grigori", - "email": "mihai@wpml.org", - "homepage": "http://www.wp-types.com" - } - ], - "description": "Installs and updates WPML and Toolset dependencies automatically", - "homepage": "https://git.onthegosystems.com/installer/installer", - "keywords": [ - "install", - "plugins", - "update", - "utils" - ] - }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "43f7f8243b81e3fd843b150a30a6d0a91167d4f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/43f7f8243b81e3fd843b150a30a6d0a91167d4f5", - "reference": "43f7f8243b81e3fd843b150a30a6d0a91167d4f5", - "shasum": "" - }, - "conflict": { - "adodb/adodb-php": "<5.20.6", - "amphp/artax": ">=2,<2.0.6|<1.0.6", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=2,<2.4.99|>=1.3,<1.3.18|>=3,<3.0.15|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3.1,<3.1.4", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<2.1", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1.0.0-alpha11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.28", - "contao/core-bundle": ">=4,<4.4.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=8,<8.3.7", - "drupal/drupal": ">=8,<8.3.7", - "ezsystems/ezpublish-legacy": ">=2017.8,<2017.8.1.1|>=5.4,<5.4.10.1|>=5.3,<5.3.12.2", - "firebase/php-jwt": "<2", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", - "joomla/session": "<1.3.1", - "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", - "magento/magento1ee": ">=1.9,<1.14.3.2", - "magento/magento2ce": ">=2,<2.2", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "onelogin/php-saml": "<2.10.4", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "phpmailer/phpmailer": ">=5,<5.2.24", - "phpxmlrpc/extras": "<6.0.1", - "pusher/pusher-php-server": "<2.2.1", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "shopware/shopware": "<5.2.25", - "silverstripe/cms": ">=3.1,<3.1.11|>=3,<=3.0.11", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.3", - "silverstripe/userforms": "<3", - "simplesamlphp/saml2": "<1.8.1|>=1.9,<1.9.1|>=1.10,<1.10.3|>=2,<2.3.3", - "simplesamlphp/simplesamlphp": "<1.14.16", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "socalnick/scn-social-auth": "<1.15.2", - "squizlabs/php_codesniffer": ">=1,<2.8.1", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "symfony/dependency-injection": ">=2,<2.0.17", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.7", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", - "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5|>=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9", - "symfony/security-core": ">=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5|>=2.8,<2.8.6|>=3,<3.0.6|>=2.4,<2.6.13|>=2.7,<2.7.9", - "symfony/security-http": ">=2.4,<2.7.13|>=2.3,<2.3.41|>=2.8,<2.8.6|>=3,<3.0.6", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.13|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5|>=2.8,<2.8.6|>=3,<3.0.6", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", - "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", - "typo3/flow": ">=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5|>=1.1,<1.1.1|>=2,<2.0.1|>=1,<1.0.4", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "willdurand/js-translation-bundle": "<2.1.1", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.5", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.4", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-diactoros": ">=1,<1.0.4", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" - }, - "time": "2017-10-31T23:55:04+00:00", - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it" - }, - { - "name": "toolset/onthego-resources", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "ssh://git@git.onthegosystems.com:10022/toolset/onthego-resources.git", - "reference": "060d3ba99dfb3a81ec5eaaf7464b2b6132c17ffd" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.5" - }, - "time": "2017-02-22T13:50:47+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev", - "dev-develop": "1.2.x-dev" - } - }, - "installation-source": "source", - "scripts": { - "test": [ - "phpunit" - ] - }, - "license": [ - "GPL-2.0" - ], - "authors": [ - { - "name": "Bruce Pearson, Juan de Paco, Riccardo Strobbia", - "email": "riccardo.s@icanlocalize.com", - "homepage": "http://www.wp-types.com" - } - ], - "description": "Branding resources for Toolset plugins", - "homepage": "https://git.onthegosystems.com/toolset/onthego-resources", - "keywords": [ - "CSS", - "icons", - "utils", - "vectors" - ] - }, - { - "name": "toolset/toolset-common", - "version": "2.8.1", - "version_normalized": "2.8.1.0", - "source": { - "type": "git", - "url": "ssh://git@git.onthegosystems.com:10022/toolset/toolset-common.git", - "reference": "ff9291e1a518f4b3c4ba36bd1a211751d370b8b5" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "10up/wp_mock": "~0.2.0", - "otgs/build-tools-ci": "~0.7.0", - "otgs/unit-tests-framework": "~1.2.0", - "phpunit/php-token-stream": "<2.0", - "sebastian/phpcpd": "^3.0" - }, - "time": "2018-06-06T11:29:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev", - "dev-develop": "1.6.x-dev", - "dev-feature/toolset-common-41": "1.6.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "classmap": [ - "expression-parser/", - "inc/", - "toolset-forms/", - "toolset-blocks/", - "user-editors/", - "utility/", - "bootstrap.php" - ] - }, - "autoload-dev": { - "classmap": [ - "tests/res/stubs" - ] - }, - "scripts": { - "test": [ - "phpunit" - ], - "post-install-cmd": [ - "OTGS\\Composer\\Scripts\\Install::PHPCSStandards" - ], - "post-update-cmd": [ - "OTGS\\Composer\\Scripts\\Install::PHPCSStandards" - ] - }, - "license": [ - "GPL-2.0" - ], - "authors": [ - { - "name": "Bruce Pearson, Juan de Paco, Riccardo Strobbia, Francesco Livolsi, Jan Štětina, Christian Glingener", - "email": "juan.d@onthegosystems.com", - "homepage": "https://toolset.com" - } - ], - "description": "A set of libraries for Toolset Plugins", - "homepage": "https://git.onthegosystems.com/toolset/toolset-common", - "keywords": [ - "models", - "types-fields", - "utils", - "visual-editor" - ] - }, - { - "name": "twig/twig", - "version": "v1.32.0", - "version_normalized": "1.32.0.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9935b662e24d6e634da88901ab534cc12e8c728f", - "reference": "9935b662e24d6e634da88901ab534cc12e8c728f", - "shasum": "" - }, - "require": { - "php": ">=5.2.7" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~3.2" - }, - "time": "2017-02-27T00:07:03+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.32-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ] - }, - { - "name": "xrstf/composer-php52", - "version": "v1.0.20", - "version_normalized": "1.0.20.0", - "source": { - "type": "git", - "url": "https://github.com/composer-php52/composer-php52.git", - "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer-php52/composer-php52/zipball/bd41459d5e27df8d33057842b32377c39e97a5a8", - "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8", - "shasum": "" - }, - "time": "2016-04-16T21:52:24+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-default": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "xrstf\\Composer52": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ] - } -] diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/css/otgs-icons.css b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/css/otgs-icons.css deleted file mode 100644 index dcd5db2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/css/otgs-icons.css +++ /dev/null @@ -1,196 +0,0 @@ -@charset "UTF-8"; - -@font-face { - font-family: "otgs-icons"; - src:url("fonts/otgs-icons.eot"); - src:url("fonts/otgs-icons.eot?#iefix") format("embedded-opentype"), - url("fonts/otgs-icons.woff") format("woff"), - url("fonts/otgs-icons.ttf") format("truetype"), - url("fonts/otgs-icons.svg#otgs-icons") format("svg"); - font-weight: normal; - font-style: normal; - -} - -[data-icon]:before { - font-family: "otgs-icons" !important; - content: attr(data-icon); - font-style: normal !important; - font-weight: normal !important; - font-variant: normal !important; - text-transform: none !important; - speak: none; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -[class^="otgs-ico-"]:before, -[class*=" otgs-ico-"]:before { - font-family: "otgs-icons" !important; - font-style: normal !important; - font-weight: normal !important; - font-variant: normal !important; - text-transform: none !important; - speak: none; - line-height: 1; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.otgs-ico-note-add:before { - content: "\61"; -} -.otgs-ico-note-add-o:before { - content: "\62"; -} -.otgs-ico-translated:before { - content: "\63"; -} -.otgs-ico-yes:before { - content: "\64"; -} -.otgs-ico-in-progress:before { - content: "\65"; -} -.otgs-ico-copy:before { - content: "\66"; -} -.otgs-ico-copy-o:before { - content: "\67"; -} -.otgs-ico-note-edit:before { - content: "\69"; -} -.otgs-ico-note-edit-o:before { - content: "\6a"; -} -.otgs-ico-add:before { - content: "\6b"; -} -.otgs-ico-refresh:before { - content: "\6c"; -} -.otgs-ico-no:before { - content: "\6e"; -} -.otgs-ico-not-translated:before { - content: "\6f"; -} -.otgs-ico-delete:before { - content: "\70"; -} -.otgs-ico-waiting:before { - content: "\71"; -} -.otgs-ico-warning:before { - content: "\73"; -} -.otgs-ico-original:before { - content: "\74"; -} -.otgs-ico-needs-update:before { - content: "\75"; -} -.otgs-ico-cred:before { - content: "\77"; -} -.otgs-ico-layouts:before { - content: "\78"; -} -.otgs-ico-module-manager:before { - content: "\79"; -} -.otgs-ico-toolset:before { - content: "\7a"; -} -.otgs-ico-types:before { - content: "\41"; -} -.otgs-ico-views:before { - content: "\42"; -} -.otgs-ico-edit:before { - content: "\68"; -} -.otgs-ico-duplicate:before { - content: "\6d"; -} -.otgs-ico-basket:before { - content: "\72"; -} -.otgs-ico-discoverwp:before { - content: "\43"; -} -.otgs-ico-wpml:before { - content: "\44"; -} -.otgs-ico-otgs:before { - content: "\45"; -} -.otgs-ico-wrench:before { - content: "\46"; -} -.otgs-ico-link:before { - content: "\47"; -} -.otgs-ico-envelope-o:before { - content: "\48"; -} -.otgs-ico-user:before { - content: "\49"; -} -.otgs-ico-wpml-cms-nav:before { - content: "\4a"; -} -.otgs-ico-wpml-media:before { - content: "\4b"; -} -.otgs-ico-wpml-string-translation:before { - content: "\4c"; -} -.otgs-ico-wpml-translation-management:before { - content: "\4d"; -} -.otgs-ico-picture:before { - content: "\4e"; -} -.otgs-ico-toolset-training:before { - content: "\4f"; -} -.otgs-ico-access-title:before { - content: "\50"; -} -.otgs-ico-views-title:before { - content: "\51"; -} -.otgs-ico-cred-title:before { - content: "\52"; -} -.otgs-ico-layouts-title:before { - content: "\53"; -} -.otgs-ico-types-title:before { - content: "\54"; -} -.otgs-ico-module-manager-title:before { - content: "\55"; -} -.otgs-ico-access:before { - content: "\76"; -} -.otgs-ico-bullhorn:before { - content: "\56"; -} -.otgs-ico-comment:before { - content: "\57"; -} -.otgs-ico-quote:before { - content: "\58"; -} -.otgs-ico-thumbsup:before { - content: "\59"; -} -.otgs-ico-star:before { - content: "\5a"; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.eot b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.eot deleted file mode 100644 index b6dbc81..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.eot and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.svg deleted file mode 100644 index f79248b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - -Generated by Fontastic.me - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.ttf b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.ttf deleted file mode 100644 index 33deb97..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.ttf and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.woff b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.woff deleted file mode 100644 index 041b20a..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/fonts/otgs-icons.woff and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/icons-overview.html b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/icons-overview.html deleted file mode 100644 index 7382cef..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/icons-overview.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - Font Reference - otgs-icons - - - - - -
-

otgs-icons

-

This font was created withFontastic

-

CSS mapping

-
    -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • - - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
-

Character mapping

-
    -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
  • -
    - -
  • -
-
- - - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/otgs-icons.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/otgs-icons.php deleted file mode 100644 index e0d1f51..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/otgs-icons.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon-128x128.png deleted file mode 100644 index 860f89a..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon-256x256.png deleted file mode 100644 index d0d0449..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon.svg deleted file mode 100644 index d424e94..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/bootstrap/icon.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon-128x128.png deleted file mode 100644 index 92988db..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon-256x256.png deleted file mode 100644 index 414c7e6..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon.svg deleted file mode 100644 index 44eda73..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/cred/icon.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon-128x128.png deleted file mode 100644 index acbfdee..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon-256x256.png deleted file mode 100644 index 05a7b38..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon.svg deleted file mode 100644 index 160abad..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/layouts/icon.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon-128x128.png deleted file mode 100644 index aab71aa..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon-256x256.png deleted file mode 100644 index 70cb9fa..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon.svg deleted file mode 100644 index f12beb0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/module-manager/icon.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon-128x128.png deleted file mode 100644 index 4845541..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon-256x256.png deleted file mode 100644 index fcc023e..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon.svg deleted file mode 100644 index e008041..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/packager/icon.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon-128x128.png deleted file mode 100644 index 22258a1..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon-256x256.png deleted file mode 100644 index 9fc2efb..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon.svg deleted file mode 100644 index 73d6321..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/ref-sites/icon.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon-128x128.png deleted file mode 100644 index 1ab24b8..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon-256x256.png deleted file mode 100644 index 605d9c8..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon.svg deleted file mode 100644 index 8bf3f21..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/support/icon.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon-128x128.png deleted file mode 100644 index f5342c0..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon-256x256.png deleted file mode 100644 index 1c3123c..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon.svg deleted file mode 100644 index 2506ca8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/toolset-core/icon.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon-128x128.png deleted file mode 100644 index 6d264c9..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon-256x256.png deleted file mode 100644 index 75b8b34..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon.svg deleted file mode 100644 index 2c6f822..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/types/icon.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon-128x128.png deleted file mode 100644 index e3b7ae5..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon-256x256.png deleted file mode 100644 index 1a1596f..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon.svg deleted file mode 100644 index fee36de..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/toolset/views/icon.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon-128.x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon-128.x128.png deleted file mode 100644 index 25c5dba..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon-128.x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon-256x256.png deleted file mode 100644 index 34eed37..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon.svg deleted file mode 100644 index ee55b2a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/acfml/icon.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon-128x128.png deleted file mode 100644 index 3dcee7d..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon-256x256.png deleted file mode 100644 index c7ac292..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon.svg deleted file mode 100644 index f524f99..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/bpml/icon.svg +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon-128x128.png deleted file mode 100644 index 4376550..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon-256x256.png deleted file mode 100644 index c922780..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon.svg deleted file mode 100644 index 833bb0b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/gfml/icon.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon-128x128.png deleted file mode 100644 index 7cc451f..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon-256x256.png deleted file mode 100644 index a3fd06d..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon.svg deleted file mode 100644 index f286eea..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wcml/icon.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon-128.x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon-128.x128.png deleted file mode 100644 index 19f40fb..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon-128.x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon-256x256.png deleted file mode 100644 index 9630b72..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon.svg deleted file mode 100644 index a13f762..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-all-import/icon.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon-128x128.png deleted file mode 100644 index 4fffe00..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon-256x256.png deleted file mode 100644 index 792981d..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon.svg deleted file mode 100644 index e71f164..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-cms-nav/icon.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon-128x128.png deleted file mode 100644 index 928e375..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon-256x256.png deleted file mode 100644 index 488ad87..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon.svg deleted file mode 100644 index 5608751..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-core/icon.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon-128x128.png deleted file mode 100644 index 4495b04..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon-256x256.png deleted file mode 100644 index 5e0487c..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon.svg deleted file mode 100644 index b046e29..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-media/icon.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon-128x128.png deleted file mode 100644 index 9b8a036..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon-256x256.png deleted file mode 100644 index 92c8a8d..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon.svg deleted file mode 100644 index d036aa2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-sl/icon.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon-128x128.png deleted file mode 100644 index 03da94f..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon-256x256.png deleted file mode 100644 index 3a2a0e6..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon.svg deleted file mode 100644 index 0786af9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-st/icon.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon-128x128.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon-128x128.png deleted file mode 100644 index d2b9c9a..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon-128x128.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon-256x256.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon-256x256.png deleted file mode 100644 index b047ec7..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon-256x256.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon.svg b/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon.svg deleted file mode 100644 index 88eed3e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/icons/plugin-icons/wpml/wpml-tm/icon.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/README.md b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/README.md deleted file mode 100644 index 0570e13..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# OTGS WP Installer - -OTGS WP Installer is a library that allows you to install and upgrade plugins and themes developed by OnTheGoSystems. - -## Installation - -First, add OTGS WP Installer as a dependency with [Composer](http://getcomposer.org): - -```bash -composer require --dev otgs/installer:dev-master -``` - -Make sure that your bootstrap file is loading the composer autoloader: - -```php -require_once 'vendor/autoload.php'; -``` - -Then, load the OTGS WP Installer bootstrap. Before the `plugins_loaded` action add: - -```php -include 'vendor/otgs/installer/loader.php'; -``` - -If you're not using composer to install this library, just unpack the archive anywhere inside the plugin or theme folder and then include the bootstrap file and mentioned in the paragraph above. - -Optionally, you can specify parameters to configure showing a dedicated UI under `Plugins -> Install New` or to load specific repositories. -By default, all repositories configrede in `repositories.xml` will be loaded: -* wpml - [WPML.org](http://wpml.org) -* toolset - [WP-Types.com](http://wp-types.com) - -```php -WP_Installer_Setup( $wp_installer_instance, - array( - 'plugins_install_tab' => '1', // optional, default value: 0 - 'repositories_include' => array( 'wpml' ) // optional, default to empty (show all) - ) -); -``` - -After `init`, configure display the OTGS WP Installer UI like in the example below: - -```php -WP_Installer_Show_Products( - array( - 'template' => 'compact', //required - 'product_name' => 'WPML', - 'box_title' => 'Multilingual Avada', - 'name' => 'Avada', //name of theme/plugin - 'box_description' => 'Avada theme is fully compatible with WPML - the WordPress Multilingual plugin. WPML lets - you add languages to your existing sites and includes advanced translation management.', - 'repository' => 'wpml', // required - 'package' => 'multilingual-cms', // required - 'product' => 'multilingual-cms' // required - ) -); -``` - -* `template` two options available: default and compact. Default will be the same GUI as on the Plugins -> Install new page while compact is a smaller version that can be fit in a different already existing screen -* `repository` only one product of a specific product package from a specific repository can be shown -* `package` only one product of a specific product package from a specific repository can be shown -* `product` only one product of a specific product package from a specific repository can be shown - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/changelog.txt b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/changelog.txt deleted file mode 100644 index bf5549d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/changelog.txt +++ /dev/null @@ -1,231 +0,0 @@ -= 1.8.20 = -* Display a link for Toolset Types upgrade if there is an available paid update -* Do not include the plugin in the list of updates if it is not part of the current user subscription - -= 1.8.19 = -* Fixed a bug that was preventing Types from being downloaded from wordpress.org - -= 1.8.18 = -* Fixed a scenario where the `get_plugins` function might not be defined yet - -= 1.8.17 = -* Implemented a notice for non-subscription users if an update is available on our site, without blocking updates from wordpress.org - -= 1.8.16 = -* Improved sending of components data to be sent separately than the product registration - -= 1.8.15 = -* Fixed message displayed even after sitekey gets validated -* Resolved PHP Notice Undefined index: version in specific client's dump -* Fixed incorrect comparison in the verification of subscriptions -* Improved incorrect message when trying to download a plugin but the connection times out - -= 1.8.14.1 = -* Fixed Warning when components storage cache is empty - -= 1.8.14 = -* Optionally collect some site information and send to our Toolset and WPML servers, such as PHP version, theme and plugins -* Resolved PHP fatal error when Types release/3.0 was active with WPML 3.9.4 -* Skipped sending reports when site key is missing -* Changed the UI allowing users to send site's data -* Send Installer reports when user clicks in "How to translate" link -* Fixed Uncaught exception cURL error 35 -* Fixed a PHP notice when two instances of Installer exist -* Refactored HTML to be more reusable and improved JS -* Replaced Installer setting from plugins list with an action -* Added Custom autoloader for Twig -* Started using only one version number for Installer -* Sanitized return of phpversion() in order to avoid registration issues when the option to send plugin/theme info is enabled -* Include Installer reports settings class in the beginning -* Removed autoloaded classes: replaced with custom autoloader only in `bootstrap.php` -* Included a check for equivalent subscription type for each plugin/product -* Added icons into upgrade response for WPML/Toolset plugins - -= 1.8.10 = -* Removed wrongly added dependencies and repositories - -= 1.8.8 = -* Fixed some conflicts - -= 1.8.7 = -* Updated version numbers to all files - -= 1.8.6 = -* Bug fix: When Windows file paths were longer than 256 chars updating of plugins wasn't possible -* Bug fix: PHP 7.2 warnings - -= 1.8.2 = -* Bug fix: registration warning was shown for free plugins - -= 1.8.1 = -* Fixed a bug potentially making the downloads list under the Commercial not display correctly - -= 1.8 = -* Added support for update channels (beta, developement and production) - -= 1.7.17 = -* Fixed some warnings and notices - -= 1.7.16 = -* Fixed a bug with plugins list showing twice for the Toolset repository -* Replaced get_locale() with get_user_locale() -* Added WP_Installer_API::get_registering_user_id() - -= 1.7.15 = -* Bug fix: New search, results not visible with WordPress 4.6 when searching from installer page -* Bug fix: A js error was showing on the admin pages: `pagenow` is undefined -* Added support for equivalent subscriptions - -= 1.7.14 = -* Refactoring for compliance with Envato market - -= 1.7.13 = -* Added sanitization for some inputs -* Fixed PHP notice being logged when installing a plugin from the WP plugins directory - -= 1.7.12 = -* Allow to set the site keys in PHP (as constants) -* Fixed an issue with unregistered sites gets wrong info (or error) when clicking "View version x.y.x details" link - -= 1.7.11 = -* Fixed styling for 'must-register' warnings on the plugins page - -= 1.7.10 = -* Fixed a notice that was appearing when the site key registration failed - -= 1.7.9 = -* Save the client_id value from the site_key_validation API call response and make it available via WP_Installer_API::get_ts_client_id API call - -= 1.7.8 = -* Small fix for hiding the WPML registration notice - -= 1.7.7 = -* Fixed js error showing up during registration -* Styles update for unified WPML messages - -= 1.7.6 = -* Updated error messages when validating site keys and stopped removing site keys in case of communication errors -* Added a note for users who renewed or purchased new subscriptions and who need to revalidate their subscription from their websites -* Fixed a problem with the registrations for multi-site setups when WordPress was installed in a separate folder - -= 1.7.5 = -* Fixed a bug causing registration to not be recognized for the entire network in the multi-site mode - -= 1.7.4 = -* Use https for wp-types API - -= 1.7.3 = -* Added a dependencies class and check for the windows paths length exception -* Bug fix: all downloads showed up twice on the plugins list whe upgrading from WPML 3.3 - -= 1.7.2 = -* Added an exception to handle the case when Types embedded is installer from Toolset Installer and its included Installer version overrides the one running the Toolset setup wizard - -= 1.7.1 = -* Added an exception for the case of Types 1.8.9 (Installer 1.7.0) together with older WPML (older Installer) - -= 1.7.0 = -* New format for the products data file. -* Other fixes - -= 1.6.8 = -* Sanitized an input that was a potential security issue - -= 1.6.7 = -* Fixed a bug causing repeated calls to the Toolset api to validate the user subscription -* Use https for API urls - -= 1.6.6 = -* Fixed the 'Call to undefined function get_plugins()' issue - -= 1.6.5 = -* Added configuration file for composer -* Updated how free plugins are shown on the plugins list (commercial tab) -* API calls for manipulating translation service preferences -* Support for hosting custom Installer packages on wpml.org -* Fixed a warning that was showing when using the OTGS_DISABLE_AUTO_UPDATES constant before any product data was downloaded -* Changed the frequency with which product updates are checked automatically (24 hours) -* Improved reporting for version numbers - -= 1.6.4 = -* Enabled the OTGS_DISABLE_AUTO_UPDATES constant for theme update checks -* Fixed a bug that was causing Register links to show for all installed plugins - -= 1.6.3 = -* Fixed performance issue related to themes upgrade logic - -= 1.6 = -* Improved the way plugins are matched: not just by the folder name (slug) but also by name -* Added support for installing and upgrading themes from repositories (currently: Toolset themes) -* Added support for 'alias' plugins on the toolset and wpml repositories (currently: Types) -* Enhanced the progress animation during plugins downloading - -= 1.5.6 = -* Updated the translations -* Fix for WPML 3.2 conditional upgrade logic - -= 1.5.5 = -* Fixed the logic for the high_priority parameter -* Fixed js bug causing a conflict with NextGen -* Fixed bug preventing users to install and upgrade Types when they didn't have a Toolset subscription -* Fixed bug preventing users to upgrade from the embedded Types to the full version - -= 1.5.4 = -* Option to disable auto-updates -* Escaped urls generated with add_query_arg - -= 1.5.3 = -* Fixed bug in WP_Installer::custom_plugins_api_call (filter for plugins_api) causing conflicts with other filters for plugins_api - -= 1.5.2 = -* More meaningful errors when plugin downloads fail -* WordPress 4.2 compatibility -* Performance improvements (will not load in places where it's not needed and not make unnecessary requests to the CDN) -* Support putting deps.xml config file in the theme folder (root) -* Included code for importing data for toolset plugins -* Use CloudFront urls for products list files - -= 1.5.1 = -* Fix for allowing embedded plugins to be updated -* Logic for the migration from embedded plugins to full plugins - -= 1.5 = -* Support for embedded plugins -* Bug fix: When user registers site key with trailing slash, downloads might not work -* Tweak: Set a higher timeout limit for the http requests to CDN and API -* API function: link to specific repository -* API function: get product price -* New method for defining affiliate info (with backwards compatibility) - -= 1.4 = -* Show explicit error in case of connectivity issues while validating a key. -* Bug fix: Downloading plugins in bulk was broken by plugin that had a redirect after activation -* Display friendly error message when WordPress does not have permissions to write to the plugins folder -* Added support for configuration files to auto-download required plugins and theme keys -* Changed the "Update this info" button to "Check for updates" (it refreshes the subscription info and checks for updates) -* Support for high_priority parameter that allows setting priority for an Installer instance when more with the same version number exist. -* Config files from different instances are combined (define repositories in different instances) -* Updated support for conditional updates display for ICL users -* More friendly error reporting and handling when using an invalid site key or the plugins archives are not valid. - - -= 1.3.1 = -* Support for conditional release notification (ICanLocalize) - -= 1.3 = -* Added a new repository: Toolset -* The product packages can be displayed hierarchically and ordered -* The link to automatically create site keys will follow through login on the account site (e.g. wpml.org, wp-types.com) -* Fixed animation issues (not showing in most browsers) when downloading plugins. -* Created an admin screen on the repository end (icl-mpp) to sho registration stats (site keys, site keys usage, components usage etc..). -* Bug fix: Renew and Upgrade buttons were not entirely clickable -* Bug fix: Action buttons (buy, renew, upgrade) were not displayed correctly when WPML was not active (Installer embedded in theme) -* Support for site-wide registration. Products can be registered on the network instead of on each site separately. -* Users are able to add either http or https version for any site urls. There will be one site key that will work with both http and https versions. - -= 1.2 = -* Added pagination for site keys list of Account -> My Sites -* Reversed the order in which the site keys are displayed. -* Fixed problem with WPML registration information (site key) not being saved when the option_value field in the wp_options table used a different charset than the default WordPress charset defined in wp-config.php -* Allow registering new sites by clicking a link in the WordPress admin instead of copying and pasting the site url in the Account -> My Sites section -* Display more detailed debug information related to connectivity issues with the WPML repository diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/dist/css/ui/styles.css b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/dist/css/ui/styles.css deleted file mode 100644 index 3a357ce..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/dist/css/ui/styles.css +++ /dev/null @@ -1,104 +0,0 @@ -.otgs-installer-component-setting { - margin: 1em 0; } - .otgs-installer-component-setting h4 { - margin: 0; } - .otgs-settings-container .otgs-installer-component-setting .spinner { - position: absolute; - margin: 5px 0 0; } - -.otgs-on-off-switch + .otgs-switch__onoff, -.otgs-switch__onoff + .otgs-on-off-switch { - -webkit-margin-start: 7px; - -moz-margin-start: 7px; - margin-inline-start: 7px; } - -/* ON/OFF Switch */ -.otgs-switch__onoff { - position: relative; - width: 55px; - display: inline-block; - vertical-align: middle; - -webkit-box-flex: 0; - -ms-flex: 0 0 55px; - flex: 0 0 55px; } - .otgs-switch__onoff.otgs-pull-right { - right: 0; } - .otgs-switch__onoff .otgs-switch__onoff-label { - display: block; - overflow: hidden; - cursor: pointer; - border: 1px solid #e6e6e6; - border-radius: 16px; - margin: 0; } - .otgs-switch__onoff .otgs-switch__onoff-inner { - width: 200%; - margin-left: -100%; - -webkit-transition: margin 0.15s ease-in-out; - transition: margin 0.15s ease-in-out; } - .otgs-switch__onoff .otgs-switch__onoff-inner:before, .otgs-switch__onoff .otgs-switch__onoff-inner:after { - float: left; - width: 50%; - height: 22px; - padding: 0; - line-height: 22px; - font-size: 11px; - -webkit-box-sizing: border-box; - box-sizing: border-box; } - .otgs-switch__onoff .otgs-switch__onoff-inner:before { - content: "ON"; - padding-left: 10px; - background-color: #21759b; - color: #fff; } - .otgs-switch__onoff .otgs-switch__onoff-inner:after { - content: "OFF"; - padding-right: 8px; - background-color: #fafafa; - color: #3D3D3D; - text-align: right; } - .otgs-switch__onoff .otgs-switch__onoff-switch { - width: 18px; - height: 18px; - margin: 0; - background: #fff; - -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); - box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); - border-radius: 50%; - position: absolute; - top: 3px; - bottom: 0; - right: 34px; - -webkit-transition: right 0.15s ease-in-out; - transition: right 0.15s ease-in-out; } - -.otgs-toggle-group { - position: relative; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; } - .otgs-toggle-group .otgs-switch__onoff-inner { - display: block; } - .otgs-toggle-group input[type=checkbox] { - display: none; } - .otgs-toggle-group input[type=checkbox]:checked ~ .otgs-switch__onoff .otgs-switch__onoff-label .otgs-switch__onoff-inner { - margin-left: 0; } - .otgs-toggle-group input[type=checkbox]:checked ~ .otgs-switch__onoff .otgs-switch__onoff-label .otgs-switch__onoff-switch { - right: 3px; - -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); - box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); } - .otgs-toggle-group input[type=checkbox]:focus ~ .otgs-switch__onoff { - outline: thin dotted #333; } - .otgs-toggle-group .otgs-on-off-switch { - cursor: pointer; - display: inline-block; } - -.otgs-external-link:after { - font-family: dashicons !important; - content: "\A0\F504"; - vertical-align: baseline; - line-height: 1; - display: inline-block; } - -/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zY3NzL3VpL3Njc3MvdWkvc3R5bGVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JBO0VBQ0MsY0FBYSxFQVViO0VBWEQ7SUFHRSxVQUFTLEVBQ1Q7RUFDRDtJQUVFLG1CQUFrQjtJQUNsQixnQkFBaUIsRUFDakI7O0FBSUg7O0VBRUMsMEJBQXlCO0VBQ3RCLHVCQUFzQjtFQUNqQix5QkFBd0IsRUFDaEM7O0FBRUQsbUJBQW1CO0FBQ25CO0VBQ0MsbUJBQXdCO0VBQ3hCLFlBM0JrQjtFQTRCbEIsc0JBQTRCO0VBQzVCLHVCQUFzQjtFQUN0QixvQkFBNkI7RUFDekIsbUJBL0JjO0VBZ0NWLGVBaENVLEVBZ0dsQjtFQXZFRDtJQVVFLFNBQVEsRUFDUjtFQVhGO0lBY0UsZUFBb0I7SUFDcEIsaUJBQXFCO0lBQ3JCLGdCQUFzQjtJQUN0QiwwQkFBNEM7SUFDNUMsb0JBQWlDO0lBQ2pDLFVBQWdCLEVBQ2hCO0VBcEJGO0lBdUJFLFlBQWlCO0lBQ2pCLG1CQUFrQjtJQUNsQiw2Q0FBd0Q7SUFDeEQscUNBQWdELEVBNEJoRDtJQXRERjtNQThCRyxZQUFpQjtNQUNqQixXQUFnQjtNQUNoQixhQXhEcUM7TUF5RHJDLFdBQWM7TUFDZCxrQkExRHFDO01BMkRyQyxnQkFBaUI7TUFDakIsK0JBQStCO01BQ3ZCLHVCQUF1QixFQUMvQjtJQXRDSDtNQXlDRyxjQUFzQjtNQUN0QixtQkFBc0I7TUFDdEIsMEJBM0VnQjtNQTRFaEIsWUFoRlMsRUFpRlQ7SUE3Q0g7TUFnREcsZUFBdUI7TUFDdkIsbUJBQXFCO01BQ3JCLDBCQUFvQztNQUNwQyxlQXRGZTtNQXVGZixrQkFBdUIsRUFDdkI7RUFyREg7SUF5REUsWUFuRmtCO0lBb0ZsQixhQXBGa0I7SUFxRmxCLFVBQWdCO0lBQ2hCLGlCQWhHVTtJQWlHViwrQ0FBZ0Q7SUFDeEMsdUNBQXdDO0lBQ2hELG1CQUFrQjtJQUNsQixtQkFBdUI7SUFDdkIsU0FBa0I7SUFDbEIsVUFBZ0I7SUFDaEIsWUFBa0M7SUFDbEMsNENBQXlEO0lBQ3pELG9DQUFpRCxFQUNqRDs7QUFHRjtFQUNDLG1CQUFxQjtFQUNyQixxQkFBd0I7RUFDeEIscUJBQXdCO0VBQ3hCLGNBQWlCO0VBQ2pCLDBCQUF5QjtFQUNyQix1QkFBc0I7RUFDbEIsb0JBQW1CLEVBNEIzQjtFQW5DRDtJQVVFLGVBQWMsRUFDZDtFQVhGO0lBY0UsY0FBYSxFQWViO0lBN0JGO01BaUJHLGVBQWMsRUFDZDtJQWxCSDtNQXFCRyxXQUFlO01BQ2YsK0NBQTZDO01BQ3JDLHVDQUFxQyxFQUM3QztJQXhCSDtNQTJCRywwQkFBeUIsRUFDekI7RUE1Qkg7SUFnQ0UsZ0JBQWdCO0lBQ2hCLHNCQUFxQixFQUNyQjs7QUFHRjtFQUNDLGtDQUFvQztFQUNwQyxvQkFBNEI7RUFDNUIseUJBQXdCO0VBQ3hCLGVBQWlCO0VBQ2pCLHNCQUE0QixFQUM1QiIsImZpbGUiOiJjc3MvdWkvc3R5bGVzLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIENPTE9SU1xuJHdoaXRlOiAjZmZmO1xuJGRhcmtncmF5OiAjM0QzRDNEO1xuJGJhc2UtZ3JheTogIzQ1NTU1RjtcbiRncmF5LXNhdHVyYXRlLTg1OiBzYXR1cmF0ZSgkYmFzZS1ncmF5LCA4NSUpO1xuJG90Z3MtYmx1ZTogIzIxNzU5YjtcblxuLy8gVFJBTlNJVElPTiBTUEVFRFNcbiR0cmFuc2l0aW9uLWZhc3Q6IDAuMTVzO1xuXG4vLyBPTiBPRkYgU1dJVENIXG4kc3dpdGNoLWhlaWdodDogMThweDtcbiRzd2l0Y2gtd2lkdGg6IDU1cHg7XG4kc3dpdGNoLWdyb3VwLWhlaWdodDogJHN3aXRjaC1oZWlnaHQgKyA0O1xuJHRvZ2dsZS1ncm91cC1oZWlnaHQ6ICRzd2l0Y2gtaGVpZ2h0ICsgNTtcblxuLm90Z3MtaW5zdGFsbGVyLWNvbXBvbmVudC1zZXR0aW5nIHtcblx0bWFyZ2luOiAxZW0gMDtcblx0aDQge1xuXHRcdG1hcmdpbjogMDtcblx0fVxuXHQub3Rncy1zZXR0aW5ncy1jb250YWluZXIgJiB7XG5cdFx0LnNwaW5uZXIge1xuXHRcdFx0cG9zaXRpb246IGFic29sdXRlO1xuXHRcdFx0bWFyZ2luOiAgIDVweCAwIDA7XG5cdFx0fVxuXHR9XG59XG5cbi5vdGdzLW9uLW9mZi1zd2l0Y2ggKyAub3Rncy1zd2l0Y2hfX29ub2ZmLFxuLm90Z3Mtc3dpdGNoX19vbm9mZiArIC5vdGdzLW9uLW9mZi1zd2l0Y2gge1xuXHQtd2Via2l0LW1hcmdpbi1zdGFydDogN3B4O1xuXHQgICAtbW96LW1hcmdpbi1zdGFydDogN3B4O1xuXHQgICAgICAgIG1hcmdpbi1pbmxpbmUtc3RhcnQ6IDdweDtcbn1cblxuLyogT04vT0ZGIFN3aXRjaCAqL1xuLm90Z3Mtc3dpdGNoX19vbm9mZiB7XG5cdHBvc2l0aW9uOiAgICAgICByZWxhdGl2ZTtcblx0d2lkdGg6ICAgICAgICAgICRzd2l0Y2gtd2lkdGg7XG5cdGRpc3BsYXk6ICAgICAgICBpbmxpbmUtYmxvY2s7XG5cdHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7XG5cdC13ZWJraXQtYm94LWZsZXg6ICAgICAgICAgICAwO1xuXHQgICAgLW1zLWZsZXg6ICAgICAgICAgICAwIDAgJHN3aXRjaC13aWR0aDtcblx0ICAgICAgICBmbGV4OiAgICAgICAgICAgMCAwICRzd2l0Y2gtd2lkdGg7XG5cblx0Ji5vdGdzLXB1bGwtcmlnaHQge1xuXHRcdHJpZ2h0OiAwO1xuXHR9XG5cblx0Lm90Z3Mtc3dpdGNoX19vbm9mZi1sYWJlbCB7XG5cdFx0ZGlzcGxheTogICAgICAgYmxvY2s7XG5cdFx0b3ZlcmZsb3c6ICAgICAgaGlkZGVuO1xuXHRcdGN1cnNvcjogICAgICAgIHBvaW50ZXI7XG5cdFx0Ym9yZGVyOiAgICAgICAgMXB4IHNvbGlkIGRhcmtlbigkd2hpdGUsIDEwJSk7XG5cdFx0Ym9yZGVyLXJhZGl1czogJHN3aXRjaC1oZWlnaHQgLSAyO1xuXHRcdG1hcmdpbjogICAgICAgIDA7XG5cdH1cblxuXHQub3Rncy1zd2l0Y2hfX29ub2ZmLWlubmVyIHtcblx0XHR3aWR0aDogICAgICAgMjAwJTtcblx0XHRtYXJnaW4tbGVmdDogLTEwMCU7XG5cdFx0LXdlYmtpdC10cmFuc2l0aW9uOiAgbWFyZ2luICR0cmFuc2l0aW9uLWZhc3QgZWFzZS1pbi1vdXQ7XG5cdFx0dHJhbnNpdGlvbjogIG1hcmdpbiAkdHJhbnNpdGlvbi1mYXN0IGVhc2UtaW4tb3V0O1xuXG5cdFx0JjpiZWZvcmUsXG5cdFx0JjphZnRlciB7XG5cdFx0XHRmbG9hdDogICAgICAgbGVmdDtcblx0XHRcdHdpZHRoOiAgICAgICA1MCU7XG5cdFx0XHRoZWlnaHQ6ICAgICAgJHN3aXRjaC1ncm91cC1oZWlnaHQ7XG5cdFx0XHRwYWRkaW5nOiAgICAgMDtcblx0XHRcdGxpbmUtaGVpZ2h0OiAkc3dpdGNoLWdyb3VwLWhlaWdodDtcblx0XHRcdGZvbnQtc2l6ZTogICAxMXB4O1xuXHRcdFx0LXdlYmtpdC1ib3gtc2l6aW5nOiAgYm9yZGVyLWJveDtcblx0XHRcdCAgICAgICAgYm94LXNpemluZzogIGJvcmRlci1ib3g7XG5cdFx0fVxuXG5cdFx0JjpiZWZvcmUge1xuXHRcdFx0Y29udGVudDogICAgICAgICAgXCJPTlwiO1xuXHRcdFx0cGFkZGluZy1sZWZ0OiAgICAgMTBweDtcblx0XHRcdGJhY2tncm91bmQtY29sb3I6ICRvdGdzLWJsdWU7XG5cdFx0XHRjb2xvcjogICAgICAgICAgICAkd2hpdGU7XG5cdFx0fVxuXG5cdFx0JjphZnRlciB7XG5cdFx0XHRjb250ZW50OiAgICAgICAgICBcIk9GRlwiO1xuXHRcdFx0cGFkZGluZy1yaWdodDogICAgOHB4O1xuXHRcdFx0YmFja2dyb3VuZC1jb2xvcjogZGFya2VuKCR3aGl0ZSwgMiUpO1xuXHRcdFx0Y29sb3I6ICAgICAgICAgICAgJGRhcmtncmF5O1xuXHRcdFx0dGV4dC1hbGlnbjogICAgICAgcmlnaHQ7XG5cdFx0fVxuXHR9XG5cblx0Lm90Z3Mtc3dpdGNoX19vbm9mZi1zd2l0Y2gge1xuXHRcdHdpZHRoOiAgICAgICAgICRzd2l0Y2gtaGVpZ2h0O1xuXHRcdGhlaWdodDogICAgICAgICRzd2l0Y2gtaGVpZ2h0O1xuXHRcdG1hcmdpbjogICAgICAgIDA7XG5cdFx0YmFja2dyb3VuZDogICAgJHdoaXRlO1xuXHRcdC13ZWJraXQtYm94LXNoYWRvdzogICAgMCAwIDNweCByZ2JhKDAsIDAsIDAsIC4zKTtcblx0XHQgICAgICAgIGJveC1zaGFkb3c6ICAgIDAgMCAzcHggcmdiYSgwLCAwLCAwLCAuMyk7XG5cdFx0Ym9yZGVyLXJhZGl1czogNTAlO1xuXHRcdHBvc2l0aW9uOiAgICAgIGFic29sdXRlO1xuXHRcdHRvcDogICAgICAgICAgIDNweDtcblx0XHRib3R0b206ICAgICAgICAwO1xuXHRcdHJpZ2h0OiAgICAgICAgICRzd2l0Y2gtaGVpZ2h0ICsgMTY7XG5cdFx0LXdlYmtpdC10cmFuc2l0aW9uOiAgICByaWdodCAkdHJhbnNpdGlvbi1mYXN0IGVhc2UtaW4tb3V0O1xuXHRcdHRyYW5zaXRpb246ICAgIHJpZ2h0ICR0cmFuc2l0aW9uLWZhc3QgZWFzZS1pbi1vdXQ7XG5cdH1cbn1cblxuLm90Z3MtdG9nZ2xlLWdyb3VwIHtcblx0cG9zaXRpb246ICAgIHJlbGF0aXZlO1xuXHRkaXNwbGF5OiAgICAgLXdlYmtpdC1ib3g7XG5cdGRpc3BsYXk6ICAgICAtbXMtZmxleGJveDtcblx0ZGlzcGxheTogICAgIGZsZXg7XG5cdC13ZWJraXQtYm94LWFsaWduOiBjZW50ZXI7XG5cdCAgICAtbXMtZmxleC1hbGlnbjogY2VudGVyO1xuXHQgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5cblx0Lm90Z3Mtc3dpdGNoX19vbm9mZi1pbm5lciB7XG5cdFx0ZGlzcGxheTogYmxvY2s7XG5cdH1cblxuXHRpbnB1dFt0eXBlPWNoZWNrYm94XSB7XG5cdFx0ZGlzcGxheTogbm9uZTtcblxuXHRcdCY6Y2hlY2tlZCB+IC5vdGdzLXN3aXRjaF9fb25vZmYgLm90Z3Mtc3dpdGNoX19vbm9mZi1sYWJlbCAub3Rncy1zd2l0Y2hfX29ub2ZmLWlubmVyIHtcblx0XHRcdG1hcmdpbi1sZWZ0OiAwO1xuXHRcdH1cblxuXHRcdCY6Y2hlY2tlZCB+IC5vdGdzLXN3aXRjaF9fb25vZmYgLm90Z3Mtc3dpdGNoX19vbm9mZi1sYWJlbCAub3Rncy1zd2l0Y2hfX29ub2ZmLXN3aXRjaCB7XG5cdFx0XHRyaWdodDogICAgICAzcHg7XG5cdFx0XHQtd2Via2l0LWJveC1zaGFkb3c6IDAgMCAzcHggcmdiYSgwLCAwLCAwLCAuNSk7XG5cdFx0XHQgICAgICAgIGJveC1zaGFkb3c6IDAgMCAzcHggcmdiYSgwLCAwLCAwLCAuNSk7XG5cdFx0fVxuXG5cdFx0Jjpmb2N1cyB+IC5vdGdzLXN3aXRjaF9fb25vZmYge1xuXHRcdFx0b3V0bGluZTogdGhpbiBkb3R0ZWQgIzMzMztcblx0XHR9XG5cdH1cblxuXHQub3Rncy1vbi1vZmYtc3dpdGNoIHtcblx0XHRjdXJzb3I6ICBwb2ludGVyO1xuXHRcdGRpc3BsYXk6IGlubGluZS1ibG9jaztcblx0fVxufVxuXG4ub3Rncy1leHRlcm5hbC1saW5rOmFmdGVyIHtcblx0Zm9udC1mYW1pbHk6ICAgIGRhc2hpY29ucyAhaW1wb3J0YW50O1xuXHRjb250ZW50OiAgICAgICAgXCJcXDAwYTBcXGY1MDRcIjtcblx0dmVydGljYWwtYWxpZ246IGJhc2VsaW5lO1xuXHRsaW5lLWhlaWdodDogICAgMTtcblx0ZGlzcGxheTogICAgICAgIGlubGluZS1ibG9jaztcbn0iXSwic291cmNlUm9vdCI6IiJ9*/ \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/dist/js/ui/app.js b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/dist/js/ui/app.js deleted file mode 100644 index 1a6882e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/dist/js/ui/app.js +++ /dev/null @@ -1,701 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./js/ui/Switcher.js": -/*!***************************!*\ - !*** ./js/ui/Switcher.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Switcher = function Switcher(element) { - _classCallCheck(this, Switcher); - - var checkBoxContainer = element.parentElement; - var heading = checkBoxContainer.getElementsByClassName('heading'); - var label = checkBoxContainer.getElementsByTagName('label').item(0); - - if (label) { - label.classList.add('otgs-on-off-switch'); - } - - var toggleGroup = document.createElement('label'); - toggleGroup.classList.add('otgs-toggle-group'); - toggleGroup.appendChild(element); - toggleGroup.appendChild(label); - - var switcherContainer = document.createElement('span'); - switcherContainer.classList.add('otgs-switch__onoff'); - var switcherBorder = document.createElement('span'); - switcherBorder.classList.add('otgs-switch__onoff-label'); - var switcherInner = document.createElement('span'); - switcherInner.classList.add('otgs-switch__onoff-inner'); - var switcherSwitch = document.createElement('span'); - switcherSwitch.classList.add('otgs-switch__onoff-switch'); - - switcherBorder.appendChild(switcherInner); - switcherBorder.appendChild(switcherSwitch); - - switcherContainer.appendChild(switcherBorder); - - toggleGroup.appendChild(switcherContainer); - - checkBoxContainer.appendChild(toggleGroup); - - if (heading.length) { - heading.item(heading.length - 1).parentNode.insertBefore(toggleGroup, heading.item(heading.length - 1).nextSibling); - } else { - checkBoxContainer.insertBefore(toggleGroup, checkBoxContainer.firstChild); - } -}; - -exports.default = Switcher; - -/***/ }), - -/***/ "./js/ui/UI.js": -/*!*********************!*\ - !*** ./js/ui/UI.js ***! - \*********************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -__webpack_require__(/*! ../../scss/ui/styles.scss */ "./scss/ui/styles.scss"); - -var _Switcher = __webpack_require__(/*! ./Switcher */ "./js/ui/Switcher.js"); - -var _Switcher2 = _interopRequireDefault(_Switcher); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var UI = function UI(element) { - _classCallCheck(this, UI); - - var checkBoxes = element.querySelectorAll('input[type="checkbox"]'); - - if (checkBoxes) { - Array.from(checkBoxes).map(function (checkBox) { - return new _Switcher2.default(checkBox); - }); - } -}; - -exports.default = UI; - -/***/ }), - -/***/ "./js/ui/app.js": -/*!**********************!*\ - !*** ./js/ui/app.js ***! - \**********************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _UI = __webpack_require__(/*! ./UI */ "./js/ui/UI.js"); - -var _UI2 = _interopRequireDefault(_UI); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -window.addEventListener('DOMContentLoaded', function () { - - var otgsUIElements = document.querySelectorAll('.otgs-ui'); - - if (otgsUIElements) { - Array.from(otgsUIElements).map(function (otgsUI) { - return new _UI2.default(otgsUI); - }); - } -}); - -/***/ }), - -/***/ "./node_modules/whatwg-fetch/fetch.js": -/*!********************************************!*\ - !*** ./node_modules/whatwg-fetch/fetch.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -(function(self) { - 'use strict'; - - if (self.fetch) { - return - } - - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: 'FileReader' in self && 'Blob' in self && (function() { - try { - new Blob() - return true - } catch(e) { - return false - } - })(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - } - - if (support.arrayBuffer) { - var viewClasses = [ - '[object Int8Array]', - '[object Uint8Array]', - '[object Uint8ClampedArray]', - '[object Int16Array]', - '[object Uint16Array]', - '[object Int32Array]', - '[object Uint32Array]', - '[object Float32Array]', - '[object Float64Array]' - ] - - var isDataView = function(obj) { - return obj && DataView.prototype.isPrototypeOf(obj) - } - - var isArrayBufferView = ArrayBuffer.isView || function(obj) { - return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 - } - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name) - } - if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name') - } - return name.toLowerCase() - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value) - } - return value - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function() { - var value = items.shift() - return {done: value === undefined, value: value} - } - } - - if (support.iterable) { - iterator[Symbol.iterator] = function() { - return iterator - } - } - - return iterator - } - - function Headers(headers) { - this.map = {} - - if (headers instanceof Headers) { - headers.forEach(function(value, name) { - this.append(name, value) - }, this) - } else if (Array.isArray(headers)) { - headers.forEach(function(header) { - this.append(header[0], header[1]) - }, this) - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function(name) { - this.append(name, headers[name]) - }, this) - } - } - - Headers.prototype.append = function(name, value) { - name = normalizeName(name) - value = normalizeValue(value) - var oldValue = this.map[name] - this.map[name] = oldValue ? oldValue+','+value : value - } - - Headers.prototype['delete'] = function(name) { - delete this.map[normalizeName(name)] - } - - Headers.prototype.get = function(name) { - name = normalizeName(name) - return this.has(name) ? this.map[name] : null - } - - Headers.prototype.has = function(name) { - return this.map.hasOwnProperty(normalizeName(name)) - } - - Headers.prototype.set = function(name, value) { - this.map[normalizeName(name)] = normalizeValue(value) - } - - Headers.prototype.forEach = function(callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this) - } - } - } - - Headers.prototype.keys = function() { - var items = [] - this.forEach(function(value, name) { items.push(name) }) - return iteratorFor(items) - } - - Headers.prototype.values = function() { - var items = [] - this.forEach(function(value) { items.push(value) }) - return iteratorFor(items) - } - - Headers.prototype.entries = function() { - var items = [] - this.forEach(function(value, name) { items.push([name, value]) }) - return iteratorFor(items) - } - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')) - } - body.bodyUsed = true - } - - function fileReaderReady(reader) { - return new Promise(function(resolve, reject) { - reader.onload = function() { - resolve(reader.result) - } - reader.onerror = function() { - reject(reader.error) - } - }) - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader() - var promise = fileReaderReady(reader) - reader.readAsArrayBuffer(blob) - return promise - } - - function readBlobAsText(blob) { - var reader = new FileReader() - var promise = fileReaderReady(reader) - reader.readAsText(blob) - return promise - } - - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf) - var chars = new Array(view.length) - - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]) - } - return chars.join('') - } - - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0) - } else { - var view = new Uint8Array(buf.byteLength) - view.set(new Uint8Array(buf)) - return view.buffer - } - } - - function Body() { - this.bodyUsed = false - - this._initBody = function(body) { - this._bodyInit = body - if (!body) { - this._bodyText = '' - } else if (typeof body === 'string') { - this._bodyText = body - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString() - } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer) - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]) - } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { - this._bodyArrayBuffer = bufferClone(body) - } else { - throw new Error('unsupported BodyInit type') - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8') - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type) - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8') - } - } - } - - if (support.blob) { - this.blob = function() { - var rejected = consumed(this) - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob') - } else { - return Promise.resolve(new Blob([this._bodyText])) - } - } - - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) - } else { - return this.blob().then(readBlobAsArrayBuffer) - } - } - } - - this.text = function() { - var rejected = consumed(this) - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text') - } else { - return Promise.resolve(this._bodyText) - } - } - - if (support.formData) { - this.formData = function() { - return this.text().then(decode) - } - } - - this.json = function() { - return this.text().then(JSON.parse) - } - - return this - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] - - function normalizeMethod(method) { - var upcased = method.toUpperCase() - return (methods.indexOf(upcased) > -1) ? upcased : method - } - - function Request(input, options) { - options = options || {} - var body = options.body - - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError('Already read') - } - this.url = input.url - this.credentials = input.credentials - if (!options.headers) { - this.headers = new Headers(input.headers) - } - this.method = input.method - this.mode = input.mode - if (!body && input._bodyInit != null) { - body = input._bodyInit - input.bodyUsed = true - } - } else { - this.url = String(input) - } - - this.credentials = options.credentials || this.credentials || 'omit' - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers) - } - this.method = normalizeMethod(options.method || this.method || 'GET') - this.mode = options.mode || this.mode || null - this.referrer = null - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests') - } - this._initBody(body) - } - - Request.prototype.clone = function() { - return new Request(this, { body: this._bodyInit }) - } - - function decode(body) { - var form = new FormData() - body.trim().split('&').forEach(function(bytes) { - if (bytes) { - var split = bytes.split('=') - var name = split.shift().replace(/\+/g, ' ') - var value = split.join('=').replace(/\+/g, ' ') - form.append(decodeURIComponent(name), decodeURIComponent(value)) - } - }) - return form - } - - function parseHeaders(rawHeaders) { - var headers = new Headers() - rawHeaders.split(/\r?\n/).forEach(function(line) { - var parts = line.split(':') - var key = parts.shift().trim() - if (key) { - var value = parts.join(':').trim() - headers.append(key, value) - } - }) - return headers - } - - Body.call(Request.prototype) - - function Response(bodyInit, options) { - if (!options) { - options = {} - } - - this.type = 'default' - this.status = 'status' in options ? options.status : 200 - this.ok = this.status >= 200 && this.status < 300 - this.statusText = 'statusText' in options ? options.statusText : 'OK' - this.headers = new Headers(options.headers) - this.url = options.url || '' - this._initBody(bodyInit) - } - - Body.call(Response.prototype) - - Response.prototype.clone = function() { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }) - } - - Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}) - response.type = 'error' - return response - } - - var redirectStatuses = [301, 302, 303, 307, 308] - - Response.redirect = function(url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code') - } - - return new Response(null, {status: status, headers: {location: url}}) - } - - self.Headers = Headers - self.Request = Request - self.Response = Response - - self.fetch = function(input, init) { - return new Promise(function(resolve, reject) { - var request = new Request(input, init) - var xhr = new XMLHttpRequest() - - xhr.onload = function() { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || '') - } - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL') - var body = 'response' in xhr ? xhr.response : xhr.responseText - resolve(new Response(body, options)) - } - - xhr.onerror = function() { - reject(new TypeError('Network request failed')) - } - - xhr.ontimeout = function() { - reject(new TypeError('Network request failed')) - } - - xhr.open(request.method, request.url, true) - - if (request.credentials === 'include') { - xhr.withCredentials = true - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob' - } - - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value) - }) - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit) - }) - } - self.fetch.polyfill = true -})(typeof self !== 'undefined' ? self : this); - - -/***/ }), - -/***/ "./scss/ui/styles.scss": -/*!*****************************!*\ - !*** ./scss/ui/styles.scss ***! - \*****************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// removed by extract-text-webpack-plugin - -/***/ }), - -/***/ 0: -/*!*****************************************!*\ - !*** multi whatwg-fetch ./js/ui/app.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(/*! whatwg-fetch */"./node_modules/whatwg-fetch/fetch.js"); -module.exports = __webpack_require__(/*! ./js/ui/app.js */"./js/ui/app.js"); - - -/***/ }) - -/******/ }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vLy4vanMvdWkvU3dpdGNoZXIuanMiLCJ3ZWJwYWNrOi8vLy4vanMvdWkvVUkuanMiLCJ3ZWJwYWNrOi8vLy4vanMvdWkvYXBwLmpzIiwid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy93aGF0d2ctZmV0Y2gvZmV0Y2guanMiLCJ3ZWJwYWNrOi8vLy4vc2Nzcy91aS9zdHlsZXMuc2NzcyJdLCJuYW1lcyI6WyJTd2l0Y2hlciIsImVsZW1lbnQiLCJjaGVja0JveENvbnRhaW5lciIsInBhcmVudEVsZW1lbnQiLCJoZWFkaW5nIiwiZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSIsImxhYmVsIiwiZ2V0RWxlbWVudHNCeVRhZ05hbWUiLCJpdGVtIiwiY2xhc3NMaXN0IiwiYWRkIiwidG9nZ2xlR3JvdXAiLCJkb2N1bWVudCIsImNyZWF0ZUVsZW1lbnQiLCJhcHBlbmRDaGlsZCIsInN3aXRjaGVyQ29udGFpbmVyIiwic3dpdGNoZXJCb3JkZXIiLCJzd2l0Y2hlcklubmVyIiwic3dpdGNoZXJTd2l0Y2giLCJsZW5ndGgiLCJwYXJlbnROb2RlIiwiaW5zZXJ0QmVmb3JlIiwibmV4dFNpYmxpbmciLCJmaXJzdENoaWxkIiwiVUkiLCJjaGVja0JveGVzIiwicXVlcnlTZWxlY3RvckFsbCIsIkFycmF5IiwiZnJvbSIsIm1hcCIsImNoZWNrQm94Iiwid2luZG93IiwiYWRkRXZlbnRMaXN0ZW5lciIsIm90Z3NVSUVsZW1lbnRzIiwib3Rnc1VJIl0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7OztBQUdBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQUs7QUFDTDtBQUNBOztBQUVBO0FBQ0E7QUFDQSx5REFBaUQsY0FBYztBQUMvRDs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxtQ0FBMkIsMEJBQTBCLEVBQUU7QUFDdkQseUNBQWlDLGVBQWU7QUFDaEQ7QUFDQTtBQUNBOztBQUVBO0FBQ0EsOERBQXNELCtEQUErRDs7QUFFckg7QUFDQTs7O0FBR0E7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lDbkVNQSxRLEdBQ0wsa0JBQWFDLE9BQWIsRUFBc0I7QUFBQTs7QUFDckIsS0FBTUMsb0JBQW9CRCxRQUFRRSxhQUFsQztBQUNBLEtBQU1DLFVBQVVGLGtCQUFrQkcsc0JBQWxCLENBQXlDLFNBQXpDLENBQWhCO0FBQ0EsS0FBTUMsUUFBUUosa0JBQWtCSyxvQkFBbEIsQ0FBdUMsT0FBdkMsRUFBZ0RDLElBQWhELENBQXFELENBQXJELENBQWQ7O0FBRUEsS0FBSUYsS0FBSixFQUFXO0FBQ1ZBLFFBQU1HLFNBQU4sQ0FBZ0JDLEdBQWhCLENBQW9CLG9CQUFwQjtBQUNBOztBQUVELEtBQU1DLGNBQWNDLFNBQVNDLGFBQVQsQ0FBdUIsT0FBdkIsQ0FBcEI7QUFDQUYsYUFBWUYsU0FBWixDQUFzQkMsR0FBdEIsQ0FBMEIsbUJBQTFCO0FBQ0FDLGFBQVlHLFdBQVosQ0FBd0JiLE9BQXhCO0FBQ0FVLGFBQVlHLFdBQVosQ0FBd0JSLEtBQXhCOztBQUVBLEtBQU1TLG9CQUFvQkgsU0FBU0MsYUFBVCxDQUF1QixNQUF2QixDQUExQjtBQUNBRSxtQkFBa0JOLFNBQWxCLENBQTRCQyxHQUE1QixDQUFnQyxvQkFBaEM7QUFDQSxLQUFNTSxpQkFBaUJKLFNBQVNDLGFBQVQsQ0FBdUIsTUFBdkIsQ0FBdkI7QUFDQUcsZ0JBQWVQLFNBQWYsQ0FBeUJDLEdBQXpCLENBQTZCLDBCQUE3QjtBQUNBLEtBQU1PLGdCQUFnQkwsU0FBU0MsYUFBVCxDQUF1QixNQUF2QixDQUF0QjtBQUNBSSxlQUFjUixTQUFkLENBQXdCQyxHQUF4QixDQUE0QiwwQkFBNUI7QUFDQSxLQUFNUSxpQkFBaUJOLFNBQVNDLGFBQVQsQ0FBdUIsTUFBdkIsQ0FBdkI7QUFDQUssZ0JBQWVULFNBQWYsQ0FBeUJDLEdBQXpCLENBQTZCLDJCQUE3Qjs7QUFFQU0sZ0JBQWVGLFdBQWYsQ0FBMkJHLGFBQTNCO0FBQ0FELGdCQUFlRixXQUFmLENBQTJCSSxjQUEzQjs7QUFFQUgsbUJBQWtCRCxXQUFsQixDQUE4QkUsY0FBOUI7O0FBRUFMLGFBQVlHLFdBQVosQ0FBd0JDLGlCQUF4Qjs7QUFFQWIsbUJBQWtCWSxXQUFsQixDQUE4QkgsV0FBOUI7O0FBRUEsS0FBSVAsUUFBUWUsTUFBWixFQUFvQjtBQUNuQmYsVUFBUUksSUFBUixDQUFhSixRQUFRZSxNQUFSLEdBQWlCLENBQTlCLEVBQWlDQyxVQUFqQyxDQUNFQyxZQURGLENBQ2VWLFdBRGYsRUFDNEJQLFFBQVFJLElBQVIsQ0FBYUosUUFBUWUsTUFBUixHQUFpQixDQUE5QixFQUFpQ0csV0FEN0Q7QUFFQSxFQUhELE1BR087QUFDTnBCLG9CQUFrQm1CLFlBQWxCLENBQStCVixXQUEvQixFQUE0Q1Qsa0JBQWtCcUIsVUFBOUQ7QUFDQTtBQUNELEM7O2tCQUlhdkIsUTs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FDM0NmOztBQUNBOzs7Ozs7OztJQUVNd0IsRSxHQUNMLFlBQWF2QixPQUFiLEVBQXNCO0FBQUE7O0FBQ3JCLEtBQU13QixhQUFheEIsUUFBUXlCLGdCQUFSLENBQXlCLHdCQUF6QixDQUFuQjs7QUFFQSxLQUFHRCxVQUFILEVBQWU7QUFDZEUsUUFBTUMsSUFBTixDQUFXSCxVQUFYLEVBQXVCSSxHQUF2QixDQUEyQjtBQUFBLFVBQVksSUFBSTdCLGtCQUFKLENBQWE4QixRQUFiLENBQVo7QUFBQSxHQUEzQjtBQUNBO0FBQ0QsQzs7a0JBR2FOLEU7Ozs7Ozs7Ozs7Ozs7O0FDYmY7Ozs7OztBQUVBTyxPQUFPQyxnQkFBUCxDQUF3QixrQkFBeEIsRUFBNEMsWUFBTTs7QUFFakQsS0FBTUMsaUJBQWlCckIsU0FBU2MsZ0JBQVQsQ0FBMEIsVUFBMUIsQ0FBdkI7O0FBRUEsS0FBSU8sY0FBSixFQUFvQjtBQUNuQk4sUUFBTUMsSUFBTixDQUFXSyxjQUFYLEVBQTJCSixHQUEzQixDQUErQjtBQUFBLFVBQVUsSUFBSUwsWUFBSixDQUFPVSxNQUFQLENBQVY7QUFBQSxHQUEvQjtBQUNBO0FBQ0QsQ0FQRCxFOzs7Ozs7Ozs7OztBQ0ZBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsT0FBTztBQUNQO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsZ0JBQWdCO0FBQ2hCO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsT0FBTztBQUNQLEtBQUs7QUFDTDtBQUNBO0FBQ0EsT0FBTztBQUNQLEtBQUs7QUFDTDtBQUNBO0FBQ0EsT0FBTztBQUNQO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSx3Q0FBd0MsbUJBQW1CO0FBQzNEO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLGtDQUFrQyxvQkFBb0I7QUFDdEQ7QUFDQTs7QUFFQTtBQUNBO0FBQ0Esd0NBQXdDLDRCQUE0QjtBQUNwRTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQSxtQkFBbUIsaUJBQWlCO0FBQ3BDO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxPQUFPO0FBQ1A7QUFDQSxPQUFPO0FBQ1A7QUFDQSxPQUFPO0FBQ1A7QUFDQSxPQUFPO0FBQ1A7QUFDQSxPQUFPO0FBQ1A7QUFDQTtBQUNBO0FBQ0EsT0FBTztBQUNQO0FBQ0EsT0FBTztBQUNQO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLHVEQUF1RDtBQUN2RCxTQUFTO0FBQ1Q7QUFDQSxTQUFTO0FBQ1QsOEVBQThFO0FBQzlFO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBLFNBQVM7QUFDVDtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLE9BQU87QUFDUDtBQUNBLE9BQU87QUFDUDtBQUNBLE9BQU87QUFDUDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsOEJBQThCLHVCQUF1QjtBQUNyRDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTDs7QUFFQTtBQUNBLHVDQUF1QywwQkFBMEI7QUFDakU7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLCtCQUErQiwwQkFBMEIsZUFBZTtBQUN4RTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxPQUFPOztBQUVQO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQSxDQUFDOzs7Ozs7Ozs7Ozs7QUM1Y0QseUMiLCJmaWxlIjoianMvdWkvYXBwLmpzIiwic291cmNlc0NvbnRlbnQiOlsiIFx0Ly8gVGhlIG1vZHVsZSBjYWNoZVxuIFx0dmFyIGluc3RhbGxlZE1vZHVsZXMgPSB7fTtcblxuIFx0Ly8gVGhlIHJlcXVpcmUgZnVuY3Rpb25cbiBcdGZ1bmN0aW9uIF9fd2VicGFja19yZXF1aXJlX18obW9kdWxlSWQpIHtcblxuIFx0XHQvLyBDaGVjayBpZiBtb2R1bGUgaXMgaW4gY2FjaGVcbiBcdFx0aWYoaW5zdGFsbGVkTW9kdWxlc1ttb2R1bGVJZF0pIHtcbiBcdFx0XHRyZXR1cm4gaW5zdGFsbGVkTW9kdWxlc1ttb2R1bGVJZF0uZXhwb3J0cztcbiBcdFx0fVxuIFx0XHQvLyBDcmVhdGUgYSBuZXcgbW9kdWxlIChhbmQgcHV0IGl0IGludG8gdGhlIGNhY2hlKVxuIFx0XHR2YXIgbW9kdWxlID0gaW5zdGFsbGVkTW9kdWxlc1ttb2R1bGVJZF0gPSB7XG4gXHRcdFx0aTogbW9kdWxlSWQsXG4gXHRcdFx0bDogZmFsc2UsXG4gXHRcdFx0ZXhwb3J0czoge31cbiBcdFx0fTtcblxuIFx0XHQvLyBFeGVjdXRlIHRoZSBtb2R1bGUgZnVuY3Rpb25cbiBcdFx0bW9kdWxlc1ttb2R1bGVJZF0uY2FsbChtb2R1bGUuZXhwb3J0cywgbW9kdWxlLCBtb2R1bGUuZXhwb3J0cywgX193ZWJwYWNrX3JlcXVpcmVfXyk7XG5cbiBcdFx0Ly8gRmxhZyB0aGUgbW9kdWxlIGFzIGxvYWRlZFxuIFx0XHRtb2R1bGUubCA9IHRydWU7XG5cbiBcdFx0Ly8gUmV0dXJuIHRoZSBleHBvcnRzIG9mIHRoZSBtb2R1bGVcbiBcdFx0cmV0dXJuIG1vZHVsZS5leHBvcnRzO1xuIFx0fVxuXG5cbiBcdC8vIGV4cG9zZSB0aGUgbW9kdWxlcyBvYmplY3QgKF9fd2VicGFja19tb2R1bGVzX18pXG4gXHRfX3dlYnBhY2tfcmVxdWlyZV9fLm0gPSBtb2R1bGVzO1xuXG4gXHQvLyBleHBvc2UgdGhlIG1vZHVsZSBjYWNoZVxuIFx0X193ZWJwYWNrX3JlcXVpcmVfXy5jID0gaW5zdGFsbGVkTW9kdWxlcztcblxuIFx0Ly8gZGVmaW5lIGdldHRlciBmdW5jdGlvbiBmb3IgaGFybW9ueSBleHBvcnRzXG4gXHRfX3dlYnBhY2tfcmVxdWlyZV9fLmQgPSBmdW5jdGlvbihleHBvcnRzLCBuYW1lLCBnZXR0ZXIpIHtcbiBcdFx0aWYoIV9fd2VicGFja19yZXF1aXJlX18ubyhleHBvcnRzLCBuYW1lKSkge1xuIFx0XHRcdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBuYW1lLCB7XG4gXHRcdFx0XHRjb25maWd1cmFibGU6IGZhbHNlLFxuIFx0XHRcdFx0ZW51bWVyYWJsZTogdHJ1ZSxcbiBcdFx0XHRcdGdldDogZ2V0dGVyXG4gXHRcdFx0fSk7XG4gXHRcdH1cbiBcdH07XG5cbiBcdC8vIGRlZmluZSBfX2VzTW9kdWxlIG9uIGV4cG9ydHNcbiBcdF9fd2VicGFja19yZXF1aXJlX18uciA9IGZ1bmN0aW9uKGV4cG9ydHMpIHtcbiBcdFx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICdfX2VzTW9kdWxlJywgeyB2YWx1ZTogdHJ1ZSB9KTtcbiBcdH07XG5cbiBcdC8vIGdldERlZmF1bHRFeHBvcnQgZnVuY3Rpb24gZm9yIGNvbXBhdGliaWxpdHkgd2l0aCBub24taGFybW9ueSBtb2R1bGVzXG4gXHRfX3dlYnBhY2tfcmVxdWlyZV9fLm4gPSBmdW5jdGlvbihtb2R1bGUpIHtcbiBcdFx0dmFyIGdldHRlciA9IG1vZHVsZSAmJiBtb2R1bGUuX19lc01vZHVsZSA/XG4gXHRcdFx0ZnVuY3Rpb24gZ2V0RGVmYXVsdCgpIHsgcmV0dXJuIG1vZHVsZVsnZGVmYXVsdCddOyB9IDpcbiBcdFx0XHRmdW5jdGlvbiBnZXRNb2R1bGVFeHBvcnRzKCkgeyByZXR1cm4gbW9kdWxlOyB9O1xuIFx0XHRfX3dlYnBhY2tfcmVxdWlyZV9fLmQoZ2V0dGVyLCAnYScsIGdldHRlcik7XG4gXHRcdHJldHVybiBnZXR0ZXI7XG4gXHR9O1xuXG4gXHQvLyBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGxcbiBcdF9fd2VicGFja19yZXF1aXJlX18ubyA9IGZ1bmN0aW9uKG9iamVjdCwgcHJvcGVydHkpIHsgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIHByb3BlcnR5KTsgfTtcblxuIFx0Ly8gX193ZWJwYWNrX3B1YmxpY19wYXRoX19cbiBcdF9fd2VicGFja19yZXF1aXJlX18ucCA9IFwiXCI7XG5cblxuIFx0Ly8gTG9hZCBlbnRyeSBtb2R1bGUgYW5kIHJldHVybiBleHBvcnRzXG4gXHRyZXR1cm4gX193ZWJwYWNrX3JlcXVpcmVfXyhfX3dlYnBhY2tfcmVxdWlyZV9fLnMgPSAwKTtcbiIsImNsYXNzIFN3aXRjaGVyIHtcblx0Y29uc3RydWN0b3IgKGVsZW1lbnQpIHtcblx0XHRjb25zdCBjaGVja0JveENvbnRhaW5lciA9IGVsZW1lbnQucGFyZW50RWxlbWVudDtcblx0XHRjb25zdCBoZWFkaW5nID0gY2hlY2tCb3hDb250YWluZXIuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgnaGVhZGluZycpO1xuXHRcdGNvbnN0IGxhYmVsID0gY2hlY2tCb3hDb250YWluZXIuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2xhYmVsJykuaXRlbSgwKTtcblxuXHRcdGlmIChsYWJlbCkge1xuXHRcdFx0bGFiZWwuY2xhc3NMaXN0LmFkZCgnb3Rncy1vbi1vZmYtc3dpdGNoJyk7XG5cdFx0fVxuXG5cdFx0Y29uc3QgdG9nZ2xlR3JvdXAgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdsYWJlbCcpO1xuXHRcdHRvZ2dsZUdyb3VwLmNsYXNzTGlzdC5hZGQoJ290Z3MtdG9nZ2xlLWdyb3VwJyk7XG5cdFx0dG9nZ2xlR3JvdXAuYXBwZW5kQ2hpbGQoZWxlbWVudCk7XG5cdFx0dG9nZ2xlR3JvdXAuYXBwZW5kQ2hpbGQobGFiZWwpO1xuXG5cdFx0Y29uc3Qgc3dpdGNoZXJDb250YWluZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzcGFuJyk7XG5cdFx0c3dpdGNoZXJDb250YWluZXIuY2xhc3NMaXN0LmFkZCgnb3Rncy1zd2l0Y2hfX29ub2ZmJyk7XG5cdFx0Y29uc3Qgc3dpdGNoZXJCb3JkZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzcGFuJyk7XG5cdFx0c3dpdGNoZXJCb3JkZXIuY2xhc3NMaXN0LmFkZCgnb3Rncy1zd2l0Y2hfX29ub2ZmLWxhYmVsJyk7XG5cdFx0Y29uc3Qgc3dpdGNoZXJJbm5lciA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ3NwYW4nKTtcblx0XHRzd2l0Y2hlcklubmVyLmNsYXNzTGlzdC5hZGQoJ290Z3Mtc3dpdGNoX19vbm9mZi1pbm5lcicpO1xuXHRcdGNvbnN0IHN3aXRjaGVyU3dpdGNoID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3BhbicpO1xuXHRcdHN3aXRjaGVyU3dpdGNoLmNsYXNzTGlzdC5hZGQoJ290Z3Mtc3dpdGNoX19vbm9mZi1zd2l0Y2gnKTtcblxuXHRcdHN3aXRjaGVyQm9yZGVyLmFwcGVuZENoaWxkKHN3aXRjaGVySW5uZXIpO1xuXHRcdHN3aXRjaGVyQm9yZGVyLmFwcGVuZENoaWxkKHN3aXRjaGVyU3dpdGNoKTtcblxuXHRcdHN3aXRjaGVyQ29udGFpbmVyLmFwcGVuZENoaWxkKHN3aXRjaGVyQm9yZGVyKTtcblxuXHRcdHRvZ2dsZUdyb3VwLmFwcGVuZENoaWxkKHN3aXRjaGVyQ29udGFpbmVyKTtcblxuXHRcdGNoZWNrQm94Q29udGFpbmVyLmFwcGVuZENoaWxkKHRvZ2dsZUdyb3VwKTtcblxuXHRcdGlmIChoZWFkaW5nLmxlbmd0aCkge1xuXHRcdFx0aGVhZGluZy5pdGVtKGhlYWRpbmcubGVuZ3RoIC0gMSkucGFyZW50Tm9kZVxuXHRcdFx0XHQuaW5zZXJ0QmVmb3JlKHRvZ2dsZUdyb3VwLCBoZWFkaW5nLml0ZW0oaGVhZGluZy5sZW5ndGggLSAxKS5uZXh0U2libGluZyk7XG5cdFx0fSBlbHNlIHtcblx0XHRcdGNoZWNrQm94Q29udGFpbmVyLmluc2VydEJlZm9yZSh0b2dnbGVHcm91cCwgY2hlY2tCb3hDb250YWluZXIuZmlyc3RDaGlsZCk7XG5cdFx0fVxuXHR9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgU3dpdGNoZXI7IiwiaW1wb3J0ICcuLi8uLi9zY3NzL3VpL3N0eWxlcy5zY3NzJztcbmltcG9ydCBTd2l0Y2hlciBmcm9tICcuL1N3aXRjaGVyJztcblxuY2xhc3MgVUkge1xuXHRjb25zdHJ1Y3RvciAoZWxlbWVudCkge1xuXHRcdGNvbnN0IGNoZWNrQm94ZXMgPSBlbGVtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJ2lucHV0W3R5cGU9XCJjaGVja2JveFwiXScpO1xuXG5cdFx0aWYoY2hlY2tCb3hlcykge1xuXHRcdFx0QXJyYXkuZnJvbShjaGVja0JveGVzKS5tYXAoY2hlY2tCb3ggPT4gbmV3IFN3aXRjaGVyKGNoZWNrQm94KSk7XG5cdFx0fVxuXHR9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFVJOyIsImltcG9ydCBVSSBmcm9tICcuL1VJJztcblxud2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ0RPTUNvbnRlbnRMb2FkZWQnLCAoKSA9PiB7XG5cblx0Y29uc3Qgb3Rnc1VJRWxlbWVudHMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcub3Rncy11aScpO1xuXG5cdGlmIChvdGdzVUlFbGVtZW50cykge1xuXHRcdEFycmF5LmZyb20ob3Rnc1VJRWxlbWVudHMpLm1hcChvdGdzVUkgPT4gbmV3IFVJKG90Z3NVSSkpO1xuXHR9XG59KTsiLCIoZnVuY3Rpb24oc2VsZikge1xuICAndXNlIHN0cmljdCc7XG5cbiAgaWYgKHNlbGYuZmV0Y2gpIHtcbiAgICByZXR1cm5cbiAgfVxuXG4gIHZhciBzdXBwb3J0ID0ge1xuICAgIHNlYXJjaFBhcmFtczogJ1VSTFNlYXJjaFBhcmFtcycgaW4gc2VsZixcbiAgICBpdGVyYWJsZTogJ1N5bWJvbCcgaW4gc2VsZiAmJiAnaXRlcmF0b3InIGluIFN5bWJvbCxcbiAgICBibG9iOiAnRmlsZVJlYWRlcicgaW4gc2VsZiAmJiAnQmxvYicgaW4gc2VsZiAmJiAoZnVuY3Rpb24oKSB7XG4gICAgICB0cnkge1xuICAgICAgICBuZXcgQmxvYigpXG4gICAgICAgIHJldHVybiB0cnVlXG4gICAgICB9IGNhdGNoKGUpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICB9XG4gICAgfSkoKSxcbiAgICBmb3JtRGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgfVxuXG4gIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgXVxuXG4gICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICAgIHJldHVybiBvYmogJiYgRGF0YVZpZXcucHJvdG90eXBlLmlzUHJvdG90eXBlT2Yob2JqKVxuICAgIH1cblxuICAgIHZhciBpc0FycmF5QnVmZmVyVmlldyA9IEFycmF5QnVmZmVyLmlzVmlldyB8fCBmdW5jdGlvbihvYmopIHtcbiAgICAgIHJldHVybiBvYmogJiYgdmlld0NsYXNzZXMuaW5kZXhPZihPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSkgPiAtMVxuICAgIH1cbiAgfVxuXG4gIGZ1bmN0aW9uIG5vcm1hbGl6ZU5hbWUobmFtZSkge1xuICAgIGlmICh0eXBlb2YgbmFtZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgIG5hbWUgPSBTdHJpbmcobmFtZSlcbiAgICB9XG4gICAgaWYgKC9bXmEtejAtOVxcLSMkJSYnKisuXFxeX2B8fl0vaS50ZXN0KG5hbWUpKSB7XG4gICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdJbnZhbGlkIGNoYXJhY3RlciBpbiBoZWFkZXIgZmllbGQgbmFtZScpXG4gICAgfVxuICAgIHJldHVybiBuYW1lLnRvTG93ZXJDYXNlKClcbiAgfVxuXG4gIGZ1bmN0aW9uIG5vcm1hbGl6ZVZhbHVlKHZhbHVlKSB7XG4gICAgaWYgKHR5cGVvZiB2YWx1ZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgIHZhbHVlID0gU3RyaW5nKHZhbHVlKVxuICAgIH1cbiAgICByZXR1cm4gdmFsdWVcbiAgfVxuXG4gIC8vIEJ1aWxkIGEgZGVzdHJ1Y3RpdmUgaXRlcmF0b3IgZm9yIHRoZSB2YWx1ZSBsaXN0XG4gIGZ1bmN0aW9uIGl0ZXJhdG9yRm9yKGl0ZW1zKSB7XG4gICAgdmFyIGl0ZXJhdG9yID0ge1xuICAgICAgbmV4dDogZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciB2YWx1ZSA9IGl0ZW1zLnNoaWZ0KClcbiAgICAgICAgcmV0dXJuIHtkb25lOiB2YWx1ZSA9PT0gdW5kZWZpbmVkLCB2YWx1ZTogdmFsdWV9XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHN1cHBvcnQuaXRlcmFibGUpIHtcbiAgICAgIGl0ZXJhdG9yW1N5bWJvbC5pdGVyYXRvcl0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIGl0ZXJhdG9yXG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGl0ZXJhdG9yXG4gIH1cblxuICBmdW5jdGlvbiBIZWFkZXJzKGhlYWRlcnMpIHtcbiAgICB0aGlzLm1hcCA9IHt9XG5cbiAgICBpZiAoaGVhZGVycyBpbnN0YW5jZW9mIEhlYWRlcnMpIHtcbiAgICAgIGhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkge1xuICAgICAgICB0aGlzLmFwcGVuZChuYW1lLCB2YWx1ZSlcbiAgICAgIH0sIHRoaXMpXG4gICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KGhlYWRlcnMpKSB7XG4gICAgICBoZWFkZXJzLmZvckVhY2goZnVuY3Rpb24oaGVhZGVyKSB7XG4gICAgICAgIHRoaXMuYXBwZW5kKGhlYWRlclswXSwgaGVhZGVyWzFdKVxuICAgICAgfSwgdGhpcylcbiAgICB9IGVsc2UgaWYgKGhlYWRlcnMpIHtcbiAgICAgIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKGhlYWRlcnMpLmZvckVhY2goZnVuY3Rpb24obmFtZSkge1xuICAgICAgICB0aGlzLmFwcGVuZChuYW1lLCBoZWFkZXJzW25hbWVdKVxuICAgICAgfSwgdGhpcylcbiAgICB9XG4gIH1cblxuICBIZWFkZXJzLnByb3RvdHlwZS5hcHBlbmQgPSBmdW5jdGlvbihuYW1lLCB2YWx1ZSkge1xuICAgIG5hbWUgPSBub3JtYWxpemVOYW1lKG5hbWUpXG4gICAgdmFsdWUgPSBub3JtYWxpemVWYWx1ZSh2YWx1ZSlcbiAgICB2YXIgb2xkVmFsdWUgPSB0aGlzLm1hcFtuYW1lXVxuICAgIHRoaXMubWFwW25hbWVdID0gb2xkVmFsdWUgPyBvbGRWYWx1ZSsnLCcrdmFsdWUgOiB2YWx1ZVxuICB9XG5cbiAgSGVhZGVycy5wcm90b3R5cGVbJ2RlbGV0ZSddID0gZnVuY3Rpb24obmFtZSkge1xuICAgIGRlbGV0ZSB0aGlzLm1hcFtub3JtYWxpemVOYW1lKG5hbWUpXVxuICB9XG5cbiAgSGVhZGVycy5wcm90b3R5cGUuZ2V0ID0gZnVuY3Rpb24obmFtZSkge1xuICAgIG5hbWUgPSBub3JtYWxpemVOYW1lKG5hbWUpXG4gICAgcmV0dXJuIHRoaXMuaGFzKG5hbWUpID8gdGhpcy5tYXBbbmFtZV0gOiBudWxsXG4gIH1cblxuICBIZWFkZXJzLnByb3RvdHlwZS5oYXMgPSBmdW5jdGlvbihuYW1lKSB7XG4gICAgcmV0dXJuIHRoaXMubWFwLmhhc093blByb3BlcnR5KG5vcm1hbGl6ZU5hbWUobmFtZSkpXG4gIH1cblxuICBIZWFkZXJzLnByb3RvdHlwZS5zZXQgPSBmdW5jdGlvbihuYW1lLCB2YWx1ZSkge1xuICAgIHRoaXMubWFwW25vcm1hbGl6ZU5hbWUobmFtZSldID0gbm9ybWFsaXplVmFsdWUodmFsdWUpXG4gIH1cblxuICBIZWFkZXJzLnByb3RvdHlwZS5mb3JFYWNoID0gZnVuY3Rpb24oY2FsbGJhY2ssIHRoaXNBcmcpIHtcbiAgICBmb3IgKHZhciBuYW1lIGluIHRoaXMubWFwKSB7XG4gICAgICBpZiAodGhpcy5tYXAuaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgY2FsbGJhY2suY2FsbCh0aGlzQXJnLCB0aGlzLm1hcFtuYW1lXSwgbmFtZSwgdGhpcylcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBIZWFkZXJzLnByb3RvdHlwZS5rZXlzID0gZnVuY3Rpb24oKSB7XG4gICAgdmFyIGl0ZW1zID0gW11cbiAgICB0aGlzLmZvckVhY2goZnVuY3Rpb24odmFsdWUsIG5hbWUpIHsgaXRlbXMucHVzaChuYW1lKSB9KVxuICAgIHJldHVybiBpdGVyYXRvckZvcihpdGVtcylcbiAgfVxuXG4gIEhlYWRlcnMucHJvdG90eXBlLnZhbHVlcyA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciBpdGVtcyA9IFtdXG4gICAgdGhpcy5mb3JFYWNoKGZ1bmN0aW9uKHZhbHVlKSB7IGl0ZW1zLnB1c2godmFsdWUpIH0pXG4gICAgcmV0dXJuIGl0ZXJhdG9yRm9yKGl0ZW1zKVxuICB9XG5cbiAgSGVhZGVycy5wcm90b3R5cGUuZW50cmllcyA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciBpdGVtcyA9IFtdXG4gICAgdGhpcy5mb3JFYWNoKGZ1bmN0aW9uKHZhbHVlLCBuYW1lKSB7IGl0ZW1zLnB1c2goW25hbWUsIHZhbHVlXSkgfSlcbiAgICByZXR1cm4gaXRlcmF0b3JGb3IoaXRlbXMpXG4gIH1cblxuICBpZiAoc3VwcG9ydC5pdGVyYWJsZSkge1xuICAgIEhlYWRlcnMucHJvdG90eXBlW1N5bWJvbC5pdGVyYXRvcl0gPSBIZWFkZXJzLnByb3RvdHlwZS5lbnRyaWVzXG4gIH1cblxuICBmdW5jdGlvbiBjb25zdW1lZChib2R5KSB7XG4gICAgaWYgKGJvZHkuYm9keVVzZWQpIHtcbiAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICB9XG4gICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgfVxuXG4gIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgIH1cbiAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICB9XG4gICAgfSlcbiAgfVxuXG4gIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgcmV0dXJuIHByb21pc2VcbiAgfVxuXG4gIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgIHJldHVybiBwcm9taXNlXG4gIH1cblxuICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICB9XG4gICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gIH1cblxuICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgfSBlbHNlIHtcbiAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgcmV0dXJuIHZpZXcuYnVmZmVyXG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gQm9keSgpIHtcbiAgICB0aGlzLmJvZHlVc2VkID0gZmFsc2VcblxuICAgIHRoaXMuX2luaXRCb2R5ID0gZnVuY3Rpb24oYm9keSkge1xuICAgICAgdGhpcy5fYm9keUluaXQgPSBib2R5XG4gICAgICBpZiAoIWJvZHkpIHtcbiAgICAgICAgdGhpcy5fYm9keVRleHQgPSAnJ1xuICAgICAgfSBlbHNlIGlmICh0eXBlb2YgYm9keSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgdGhpcy5fYm9keVRleHQgPSBib2R5XG4gICAgICB9IGVsc2UgaWYgKHN1cHBvcnQuYmxvYiAmJiBCbG9iLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgIHRoaXMuX2JvZHlCbG9iID0gYm9keVxuICAgICAgfSBlbHNlIGlmIChzdXBwb3J0LmZvcm1EYXRhICYmIEZvcm1EYXRhLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgIHRoaXMuX2JvZHlGb3JtRGF0YSA9IGJvZHlcbiAgICAgIH0gZWxzZSBpZiAoc3VwcG9ydC5zZWFyY2hQYXJhbXMgJiYgVVJMU2VhcmNoUGFyYW1zLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgIHRoaXMuX2JvZHlUZXh0ID0gYm9keS50b1N0cmluZygpXG4gICAgICB9IGVsc2UgaWYgKHN1cHBvcnQuYXJyYXlCdWZmZXIgJiYgc3VwcG9ydC5ibG9iICYmIGlzRGF0YVZpZXcoYm9keSkpIHtcbiAgICAgICAgdGhpcy5fYm9keUFycmF5QnVmZmVyID0gYnVmZmVyQ2xvbmUoYm9keS5idWZmZXIpXG4gICAgICAgIC8vIElFIDEwLTExIGNhbid0IGhhbmRsZSBhIERhdGFWaWV3IGJvZHkuXG4gICAgICAgIHRoaXMuX2JvZHlJbml0ID0gbmV3IEJsb2IoW3RoaXMuX2JvZHlBcnJheUJ1ZmZlcl0pXG4gICAgICB9IGVsc2UgaWYgKHN1cHBvcnQuYXJyYXlCdWZmZXIgJiYgKEFycmF5QnVmZmVyLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpIHx8IGlzQXJyYXlCdWZmZXJWaWV3KGJvZHkpKSkge1xuICAgICAgICB0aGlzLl9ib2R5QXJyYXlCdWZmZXIgPSBidWZmZXJDbG9uZShib2R5KVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bnN1cHBvcnRlZCBCb2R5SW5pdCB0eXBlJylcbiAgICAgIH1cblxuICAgICAgaWYgKCF0aGlzLmhlYWRlcnMuZ2V0KCdjb250ZW50LXR5cGUnKSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ3RleHQvcGxhaW47Y2hhcnNldD1VVEYtOCcpXG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUJsb2IgJiYgdGhpcy5fYm9keUJsb2IudHlwZSkge1xuICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoJ2NvbnRlbnQtdHlwZScsIHRoaXMuX2JvZHlCbG9iLnR5cGUpXG4gICAgICAgIH0gZWxzZSBpZiAoc3VwcG9ydC5zZWFyY2hQYXJhbXMgJiYgVVJMU2VhcmNoUGFyYW1zLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgfVxuXG4gICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgfVxuICAgIH1cblxuICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICB9XG5cbiAgICByZXR1cm4gdGhpc1xuICB9XG5cbiAgLy8gSFRUUCBtZXRob2RzIHdob3NlIGNhcGl0YWxpemF0aW9uIHNob3VsZCBiZSBub3JtYWxpemVkXG4gIHZhciBtZXRob2RzID0gWydERUxFVEUnLCAnR0VUJywgJ0hFQUQnLCAnT1BUSU9OUycsICdQT1NUJywgJ1BVVCddXG5cbiAgZnVuY3Rpb24gbm9ybWFsaXplTWV0aG9kKG1ldGhvZCkge1xuICAgIHZhciB1cGNhc2VkID0gbWV0aG9kLnRvVXBwZXJDYXNlKClcbiAgICByZXR1cm4gKG1ldGhvZHMuaW5kZXhPZih1cGNhc2VkKSA+IC0xKSA/IHVwY2FzZWQgOiBtZXRob2RcbiAgfVxuXG4gIGZ1bmN0aW9uIFJlcXVlc3QoaW5wdXQsIG9wdGlvbnMpIHtcbiAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fVxuICAgIHZhciBib2R5ID0gb3B0aW9ucy5ib2R5XG5cbiAgICBpZiAoaW5wdXQgaW5zdGFuY2VvZiBSZXF1ZXN0KSB7XG4gICAgICBpZiAoaW5wdXQuYm9keVVzZWQpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQWxyZWFkeSByZWFkJylcbiAgICAgIH1cbiAgICAgIHRoaXMudXJsID0gaW5wdXQudXJsXG4gICAgICB0aGlzLmNyZWRlbnRpYWxzID0gaW5wdXQuY3JlZGVudGlhbHNcbiAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKGlucHV0LmhlYWRlcnMpXG4gICAgICB9XG4gICAgICB0aGlzLm1ldGhvZCA9IGlucHV0Lm1ldGhvZFxuICAgICAgdGhpcy5tb2RlID0gaW5wdXQubW9kZVxuICAgICAgaWYgKCFib2R5ICYmIGlucHV0Ll9ib2R5SW5pdCAhPSBudWxsKSB7XG4gICAgICAgIGJvZHkgPSBpbnB1dC5fYm9keUluaXRcbiAgICAgICAgaW5wdXQuYm9keVVzZWQgPSB0cnVlXG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMudXJsID0gU3RyaW5nKGlucHV0KVxuICAgIH1cblxuICAgIHRoaXMuY3JlZGVudGlhbHMgPSBvcHRpb25zLmNyZWRlbnRpYWxzIHx8IHRoaXMuY3JlZGVudGlhbHMgfHwgJ29taXQnXG4gICAgaWYgKG9wdGlvbnMuaGVhZGVycyB8fCAhdGhpcy5oZWFkZXJzKSB7XG4gICAgICB0aGlzLmhlYWRlcnMgPSBuZXcgSGVhZGVycyhvcHRpb25zLmhlYWRlcnMpXG4gICAgfVxuICAgIHRoaXMubWV0aG9kID0gbm9ybWFsaXplTWV0aG9kKG9wdGlvbnMubWV0aG9kIHx8IHRoaXMubWV0aG9kIHx8ICdHRVQnKVxuICAgIHRoaXMubW9kZSA9IG9wdGlvbnMubW9kZSB8fCB0aGlzLm1vZGUgfHwgbnVsbFxuICAgIHRoaXMucmVmZXJyZXIgPSBudWxsXG5cbiAgICBpZiAoKHRoaXMubWV0aG9kID09PSAnR0VUJyB8fCB0aGlzLm1ldGhvZCA9PT0gJ0hFQUQnKSAmJiBib2R5KSB7XG4gICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdCb2R5IG5vdCBhbGxvd2VkIGZvciBHRVQgb3IgSEVBRCByZXF1ZXN0cycpXG4gICAgfVxuICAgIHRoaXMuX2luaXRCb2R5KGJvZHkpXG4gIH1cblxuICBSZXF1ZXN0LnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gIH1cblxuICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgIGlmIChieXRlcykge1xuICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgfVxuICAgIH0pXG4gICAgcmV0dXJuIGZvcm1cbiAgfVxuXG4gIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgfVxuICAgIH0pXG4gICAgcmV0dXJuIGhlYWRlcnNcbiAgfVxuXG4gIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgIGlmICghb3B0aW9ucykge1xuICAgICAgb3B0aW9ucyA9IHt9XG4gICAgfVxuXG4gICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKVxuICAgIHRoaXMudXJsID0gb3B0aW9ucy51cmwgfHwgJydcbiAgICB0aGlzLl9pbml0Qm9keShib2R5SW5pdClcbiAgfVxuXG4gIEJvZHkuY2FsbChSZXNwb25zZS5wcm90b3R5cGUpXG5cbiAgUmVzcG9uc2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIG5ldyBSZXNwb25zZSh0aGlzLl9ib2R5SW5pdCwge1xuICAgICAgc3RhdHVzOiB0aGlzLnN0YXR1cyxcbiAgICAgIHN0YXR1c1RleHQ6IHRoaXMuc3RhdHVzVGV4dCxcbiAgICAgIGhlYWRlcnM6IG5ldyBIZWFkZXJzKHRoaXMuaGVhZGVycyksXG4gICAgICB1cmw6IHRoaXMudXJsXG4gICAgfSlcbiAgfVxuXG4gIFJlc3BvbnNlLmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgdmFyIHJlc3BvbnNlID0gbmV3IFJlc3BvbnNlKG51bGwsIHtzdGF0dXM6IDAsIHN0YXR1c1RleHQ6ICcnfSlcbiAgICByZXNwb25zZS50eXBlID0gJ2Vycm9yJ1xuICAgIHJldHVybiByZXNwb25zZVxuICB9XG5cbiAgdmFyIHJlZGlyZWN0U3RhdHVzZXMgPSBbMzAxLCAzMDIsIDMwMywgMzA3LCAzMDhdXG5cbiAgUmVzcG9uc2UucmVkaXJlY3QgPSBmdW5jdGlvbih1cmwsIHN0YXR1cykge1xuICAgIGlmIChyZWRpcmVjdFN0YXR1c2VzLmluZGV4T2Yoc3RhdHVzKSA9PT0gLTEpIHtcbiAgICAgIHRocm93IG5ldyBSYW5nZUVycm9yKCdJbnZhbGlkIHN0YXR1cyBjb2RlJylcbiAgICB9XG5cbiAgICByZXR1cm4gbmV3IFJlc3BvbnNlKG51bGwsIHtzdGF0dXM6IHN0YXR1cywgaGVhZGVyczoge2xvY2F0aW9uOiB1cmx9fSlcbiAgfVxuXG4gIHNlbGYuSGVhZGVycyA9IEhlYWRlcnNcbiAgc2VsZi5SZXF1ZXN0ID0gUmVxdWVzdFxuICBzZWxmLlJlc3BvbnNlID0gUmVzcG9uc2VcblxuICBzZWxmLmZldGNoID0gZnVuY3Rpb24oaW5wdXQsIGluaXQpIHtcbiAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICB2YXIgcmVxdWVzdCA9IG5ldyBSZXF1ZXN0KGlucHV0LCBpbml0KVxuICAgICAgdmFyIHhociA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpXG5cbiAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgc3RhdHVzOiB4aHIuc3RhdHVzLFxuICAgICAgICAgIHN0YXR1c1RleHQ6IHhoci5zdGF0dXNUZXh0LFxuICAgICAgICAgIGhlYWRlcnM6IHBhcnNlSGVhZGVycyh4aHIuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkgfHwgJycpXG4gICAgICAgIH1cbiAgICAgICAgb3B0aW9ucy51cmwgPSAncmVzcG9uc2VVUkwnIGluIHhociA/IHhoci5yZXNwb25zZVVSTCA6IG9wdGlvbnMuaGVhZGVycy5nZXQoJ1gtUmVxdWVzdC1VUkwnKVxuICAgICAgICB2YXIgYm9keSA9ICdyZXNwb25zZScgaW4geGhyID8geGhyLnJlc3BvbnNlIDogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgIH1cblxuICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgIH1cblxuICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgfVxuXG4gICAgICB4aHIub3BlbihyZXF1ZXN0Lm1ldGhvZCwgcmVxdWVzdC51cmwsIHRydWUpXG5cbiAgICAgIGlmIChyZXF1ZXN0LmNyZWRlbnRpYWxzID09PSAnaW5jbHVkZScpIHtcbiAgICAgICAgeGhyLndpdGhDcmVkZW50aWFscyA9IHRydWVcbiAgICAgIH1cblxuICAgICAgaWYgKCdyZXNwb25zZVR5cGUnIGluIHhociAmJiBzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgeGhyLnJlc3BvbnNlVHlwZSA9ICdibG9iJ1xuICAgICAgfVxuXG4gICAgICByZXF1ZXN0LmhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkge1xuICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcihuYW1lLCB2YWx1ZSlcbiAgICAgIH0pXG5cbiAgICAgIHhoci5zZW5kKHR5cGVvZiByZXF1ZXN0Ll9ib2R5SW5pdCA9PT0gJ3VuZGVmaW5lZCcgPyBudWxsIDogcmVxdWVzdC5fYm9keUluaXQpXG4gICAgfSlcbiAgfVxuICBzZWxmLmZldGNoLnBvbHlmaWxsID0gdHJ1ZVxufSkodHlwZW9mIHNlbGYgIT09ICd1bmRlZmluZWQnID8gc2VsZiA6IHRoaXMpO1xuIiwiLy8gcmVtb3ZlZCBieSBleHRyYWN0LXRleHQtd2VicGFjay1wbHVnaW4iXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-dependencies.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-dependencies.php deleted file mode 100644 index 9979508..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-dependencies.php +++ /dev/null @@ -1,291 +0,0 @@ -is_win_paths_exception[ $repository_id ] ) ) { - - $this->is_win_paths_exception[ $repository_id ] = false; - - if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) { - - $windows_max_path_length = 256; - $longest_path['wpml'] = 109; - $longest_path['toolset'] = 99; - - $margin = 15; - - $upgrade_path_length = strlen( WP_CONTENT_DIR . '/upgrade' ); - - $installer_settings = WP_Installer()->settings; - - if ( isset($installer_settings['repositories'][$repository_id]['data']) && is_array( $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'] ) ) { - $a_plugin = current( $installer_settings['repositories'][$repository_id]['data']['downloads']['plugins'] ); - $url = WP_Installer()->append_site_key_to_download_url( $a_plugin['url'], 'xxxxxx', $repository_id ); - $tmpfname = wp_tempnam( $url ); - - $tmpname_length = strlen( basename( $tmpfname ) ) - 4; // -.tmp - - if ( $upgrade_path_length + $tmpname_length + $longest_path[ $repository_id ] + $margin > $windows_max_path_length ) { - - $this->is_win_paths_exception[ $repository_id ] = true; - - } - - } - - - } - - } - - return $this->is_win_paths_exception[ $repository_id ]; - - } - - public function is_uploading_allowed() { - - if ( ! isset( $this->uploading_allowed ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - require_once WP_Installer()->plugin_path() . '/includes/class-installer-upgrader-skins.php'; - - $upgrader_skins = new Installer_Upgrader_Skins(); //use our custom (mute) Skin - $upgrader = new Plugin_Upgrader( $upgrader_skins ); - - ob_start(); - $res = $upgrader->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); - ob_end_clean(); - - if ( ! $res || is_wp_error( $res ) ) { - $this->uploading_allowed = false; - } else { - $this->uploading_allowed = true; - } - } - - return $this->uploading_allowed; - - } - - public function cant_download( $repository_id ) { - - return ! $this->is_uploading_allowed() || $this->is_win_paths_exception( $repository_id ); - - } - - public function win_paths_exception_message() { - return __( 'Downloading is not possible. WordPress cannot create required folders because of the - 256 characters limitation of the current Windows environment.', 'installer' ); - } - - public function prevent_plugins_update_on_plugins_page() { - - $plugins = get_site_transient( 'update_plugins' ); - if ( isset( $plugins->response ) && is_array( $plugins->response ) ) { - $plugins_with_updates = array_keys( $plugins->response ); - } - - if ( ! empty( $plugins_with_updates ) ) { - - $plugins = get_plugins(); - - $installer_settings = WP_Installer()->settings; - if ( isset( $installer_settings['repositories'] ) ) { - foreach ( $installer_settings['repositories'] as $repository_id => $repository ) { - - if ( $this->is_win_paths_exception( $repository_id ) ) { - - $repositories_plugins = array(); - foreach ( $repository['data']['packages'] as $package ) { - foreach ( $package['products'] as $product ) { - foreach ( $product['plugins'] as $plugin_slug ) { - $download = $installer_settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - if ( empty( $download['free-on-wporg'] ) ) { - $repositories_plugins[ $download['slug'] ] = $download['name']; - } - } - } - } - - foreach ( $plugins as $plugin_id => $plugin ) { - - if ( in_array( $plugin_id, $plugins_with_updates ) ) { - - $wp_plugin_slug = dirname( $plugin_id ); - if ( empty( $wp_plugin_slug ) ) { - $wp_plugin_slug = basename( $plugin_id, '.php' ); - } - - foreach ( $repositories_plugins as $slug => $name ) { - if ( $wp_plugin_slug == $slug || $name == $plugin['Name'] || $name == $plugin['Title'] ) { //match order: slug, name, title - - remove_action( "after_plugin_row_$plugin_id", 'wp_plugin_update_row', 10, 2 ); - add_action( "after_plugin_row_$plugin_id", array( - $this, - 'wp_plugin_update_row_win_exception', - ), 10, 2 ); - - } - } - - } - - } - - } - - - } - } - - } - - } - - public function wp_plugin_update_row_win_exception() { - $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); - echo ''; - echo '
' . $this->win_paths_exception_message() . '
'; - echo ''; - } - - public function prevent_plugins_update_on_updates_screen() { - - if ( isset( $_REQUEST['action'] ) ) { - - $action = isset( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; - - $installer_settings = WP_Installer()->settings; - - //bulk mode - if ( 'update-selected' == $action ) { - - global $plugins; - - if ( isset( $plugins ) && is_array( $plugins ) ) { - - foreach ( $plugins as $k => $plugin ) { - - $wp_plugin_slug = dirname( $plugin ); - - foreach ( $installer_settings['repositories'] as $repository_id => $repository ) { - - if ( $this->is_win_paths_exception( $repository_id ) ) { - - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $installer_settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( $download['slug'] == $wp_plugin_slug && empty( $download['free-on-wporg'] ) ) { - - echo '

' . $this->win_paths_exception_message() . - ' (' . $download['name'] . ')' . '

'; - unset( $plugins[ $k ] ); - - break( 3 ); - - } - - } - - } - - } - - - } - - } - - } - - } - - } - - - if ( 'upgrade-plugin' == $action || 'update-plugin' == $action ) { - - $plugin = isset( $_REQUEST['plugin'] ) ? trim( sanitize_text_field( $_REQUEST['plugin'] ) ) : ''; - - $wp_plugin_slug = dirname( $plugin ); - - foreach ( $installer_settings['repositories'] as $repository_id => $repository ) { - - if ( $this->is_win_paths_exception( $repository_id ) ) { - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - $download = $installer_settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - //match by folder, will change to match by name and folder - if ( $download['slug'] == $wp_plugin_slug && empty ( $download['free-on-wporg'] ) ) { - - echo '

' . $this->win_paths_exception_message() . '

'; - - echo '
'; - echo '

' . __( 'Update Plugin' ) . '

'; - echo '' . __( 'Return to the updates page', 'installer' ) . ''; - echo '
'; - require_once( ABSPATH . 'wp-admin/admin-footer.php' ); - exit; - - } - - } - - } - - } - } - - } - - } - } - - } - - -} - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-theme.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-theme.php deleted file mode 100644 index d3a1327..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-theme.php +++ /dev/null @@ -1,979 +0,0 @@ -get_repositories(); - - //Get repos with themes - $repos_with_themes = $this->installer_theme_reposities_that_has_themes( $installer_repositories ); - - if ( is_array( $repos_with_themes ) ) { - //Assign to property - $this->installer_repo_with_themes = $repos_with_themes; - - //Let's looped through repos with themes - foreach ( $repos_with_themes as $k => $repo ) { - - //$repo could be 'toolset' or 'wpml' - //Assign each repo with theme to property - $this->theme_repo[] = $repo; - - if ( (isset($installer_repositories[$repo]['api-url'])) && (isset($installer_repositories[$repo]['products'])) ) { - - //Define the rest of the properties based on the given repo - $this->repository_api[$repo] = $installer_repositories[$repo]['api-url']; - $this->repository_theme_products[$repo] = $installer_repositories[$repo]['products']; - $this->installer_site_url[$repo] = WP_Installer()->get_installer_site_url( $repo ); - $this->installer_site_key[$repo] = WP_Installer()->get_site_key( $repo ); - $this->theme_user_registration[$repo] = false; - - if ( WP_Installer()->repository_has_valid_subscription( $repo ) ) { - - $this->installer_theme_subscription_type = WP_Installer()->get_subscription_type_for_repository( $repo ); - $this->installer_themes_option[$repo] = 'wp_installer_' . $repo . '_themes'; - $this->installer_themes_available_updates[$repo] = 'wp_installer_' . $repo . '_updated_themes'; - $this->installer_theme_active_tab = ''; - - //We only set themes available to this validated subscription - $this->installer_theme_available( $repo, $this->installer_theme_subscription_type ); - - add_action( 'installer_themes_support_set_up', array($this, 'installer_theme_sets_active_tab_on_init'), 10 ); - $this->theme_user_registration[$repo] = true; - } - - /** We are ready.. let's initialize .... */ - $this->init(); - } - } - add_action( 'installer_themes_support_set_up', array($this, 'installer_theme_loaded_hooks') ); - } - } - - /** Init */ - public function init() { - add_action( 'admin_enqueue_scripts', array($this, 'installer_theme_enqueue_scripts') ); - add_filter( 'themes_api', array($this, 'installer_theme_api_override'), 10, 3 ); - add_filter( 'themes_api_result', array($this, 'installer_theme_api_override_response'), 10, 3 ); - add_filter( 'site_transient_update_themes', array($this, 'installer_theme_upgrade_check'), 10, 1 ); - add_action( 'http_api_debug', array($this, 'installer_theme_sync_native_wp_api'), 10, 5 ); - add_filter( 'installer_theme_hook_response_theme', array($this, 'installer_theme_add_num_ratings'), 10, 1 ); - add_filter( 'themes_update_check_locales', array($this, 'installer_theme_sync_call_wp_theme_api'), 10, 1 ); - add_filter( 'admin_url', array($this, 'installer_theme_add_query_arg_tab'), 10, 3 ); - add_filter( 'network_admin_url', array($this, 'installer_theme_add_query_arg_tab'), 10, 2 ); - add_action( 'wp_ajax_installer_theme_frontend_selected_tab', array($this, 'installer_theme_frontend_selected_tab'), 0 ); - add_action( 'wp_loaded', array($this, 'installer_themes_support_set_up_func') ); - } - - /** Enqueue scripts */ - public function installer_theme_enqueue_scripts() { - $current_screen = $this->installer_theme_current_screen(); - $commercial_plugin_screen = $this->installer_theme_is_commercial_plugin_screen( $current_screen ); - if ( ('theme-install' == $current_screen) || ($commercial_plugin_screen) || ('theme-install-network' == $current_screen) ) { - $repo_with_themes = $this->installer_repo_with_themes; - $js_array = array(); - if ( is_array( $repo_with_themes ) ) { - foreach ( $repo_with_themes as $k => $v ) { - - //Hyperlink text - $theme_repo_name = $this->installer_theme_get_repo_product_name( $v ); - $the_hyperlink_text = esc_js( $theme_repo_name ); - - if ( is_multisite() ) { - $admin_url_passed = network_admin_url(); - } else { - $admin_url_passed = admin_url(); - } - - //Define - $js_array[$v] = array( - 'the_hyperlink_text' => $the_hyperlink_text, - 'registration_status' => $this->theme_user_registration[$v], - 'is_commercial_plugin_tab' => $commercial_plugin_screen, - 'registration_url' => $admin_url_passed . 'plugin-install.php?tab=commercial#installer_repo_' . $v - ); - - } - } - - if ( !(empty($js_array)) ) { - wp_enqueue_script( 'installer-theme-install', WP_Installer()->res_url() . '/res/js/installer_theme_install.js', array('jquery', 'installer-admin'), WP_Installer()->version() ); - $installer_ajax_url = admin_url( 'admin-ajax.php' ); - - if ( is_ssl() ) { - $installer_ajax_url = str_replace( 'http://', 'https://', $installer_ajax_url ); - } else { - $installer_ajax_url = str_replace( 'https://', 'http://', $installer_ajax_url ); - } - - //Case where user is subscribed to a subscription that does not have themes - $subscription_js_check = $this->installer_theme_subscription_does_not_have_theme( $js_array ); - - wp_localize_script( 'installer-theme-install', 'installer_theme_install_localize', - array( - 'js_array_installer' => $js_array, - 'ajaxurl' => $installer_ajax_url, - 'no_associated_themes' => $subscription_js_check, - 'installer_theme_frontend_selected_tab_nonce' => wp_create_nonce( 'installer_theme_frontend_selected_tab' ) - ) - ); - } - } - } - - /** Case where user is subscribed to a subscription that does not have themes */ - protected function installer_theme_subscription_does_not_have_theme( $js_array ) { - - $any_subscription_has_theme = array(); - $number_of_registrations = array(); - - //Step1, we looped through JS array - foreach ( $js_array as $repo_slug => $js_details ) { - - //Step2, checked if user is registered - if ( isset($this->theme_user_registration[$repo_slug]) ) { - $registration_status = $this->theme_user_registration[$repo_slug]; - if ( $registration_status ) { - - //Registered - $number_of_registrations[] = $repo_slug; - - //Step3, we checked if the $repo_slug has available theme - $themes_available = false; - if ( isset($this->installer_themes[$repo_slug]) ) { - $themes_available = $this->installer_themes[$repo_slug]; - if ( !(empty($themes_available)) ) { - //This subscription has theme - $themes_available = true; - } - } - - if ( $themes_available ) { - $any_subscription_has_theme[] = $repo_slug; - } - } - } - - } - - //Step4, we are done looping, check if there are any repos that have themes - if ( empty($registration_status) ) { - - //No registration on any repos - return FALSE; - - } elseif ( !(empty($registration_status)) ) { - - //Has some registration on some repos - //We then checked if this user has any active subscriptions - if ( empty($any_subscription_has_theme) ) { - //No subscription - return TRUE; - } else { - //Has subscription found - return FALSE; - } - } - } - - /** Check if its the commercial plugin screen */ - private function installer_theme_is_commercial_plugin_screen( $current_screen ) { - $commercial = false; - if ( ('plugin-install' == $current_screen) || ('plugin-install-network' == $current_screen) ) { - if ( isset($_GET['tab']) ) { - $tab = sanitize_text_field( $_GET['tab'] ); - if ( 'commercial' == $tab ) { - $commercial = true; - } - } - } - return $commercial; - } - - /** Current screen */ - private function installer_theme_current_screen() { - - $current_screen_loaded = false; - - if ( function_exists( 'get_current_screen' ) ) { - - $screen_output = get_current_screen(); - $current_screen_loaded = $screen_output->id; - - } - - return $current_screen_loaded; - - } - - /** Override WordPress Themes API */ - public function installer_theme_api_override( $api_boolean, $action, $args ) { - - //Let's checked if user is browsing our themes - if ( isset($args->browse) ) { - $browse = $args->browse; - if ( in_array( $browse, $this->theme_repo ) ) { - //Uniquely validated for our Themes - if ( 'query_themes' == $action ) { - //User is querying or asking information about our themes, let's override - $api_boolean = true; - } - } - } elseif ( isset($args->slug) ) { - //We are installing our themes - $theme_to_install = $args->slug; - - //Lets uniquely validate if this belongs to us - //Check if this is OTGS theme - $validate_check = $this->installer_themes_belong_to_us( $theme_to_install ); - if ( $validate_check ) { - //Belongs to us - if ( !(empty($theme_to_install)) ) { - $api_boolean = true; - } - } - } - - return $api_boolean; - } - - /** Override WordPress Themes API response with our own themes API*/ - public function installer_theme_api_override_response( $res, $action, $args ) { - - if ( true === $res ) { - if ( isset($args->browse) ) { - $browse = $args->browse; - if ( in_array( $browse, $this->theme_repo ) ) { - //Uniquely validated for our themes - if ( 'query_themes' == $action ) { - //Client querying OTGS themes - //Check for registration status - if ( isset($this->theme_user_registration[$browse]) ) { - //Set - if ( !($this->theme_user_registration[$browse]) ) { - //Not registered yet - $res = new stdClass(); - $res->info = array(); - $res->themes = array(); - return $res; - } else { - //Registered - $themes = $this->installer_theme_get_themes( '', $browse ); - $res = $this->installer_theme_format_response( $themes, $action ); - } - } - } - } - } elseif ( isset($args->slug) ) { - //We are installing theme - //Lets uniquely validate if this belongs to our theme - $theme_to_install = $args->slug; - - //Lets uniquely validate if this belongs to us - //Check if this is OTGS theme - $validate_check = $this->installer_themes_belong_to_us( $theme_to_install ); - if ( $validate_check ) { - //Belongs to us - if ( ($res) && ('theme_information' == $action) ) { - $themes = $this->installer_theme_get_themes( '', $this->installer_theme_active_tab ); - $res = $this->installer_theme_format_response( $themes, $action, $args->slug ); - } - } - } - return $res; - } else { - //Default WP Themes here - $client_side_active_tab = get_option( 'wp_installer_clientside_active_tab' ); - if ( $client_side_active_tab ) { - if ( !(in_array( $client_side_active_tab, $this->theme_repo )) ) { - //Not OTGS tab - return $res; - } - } - - } - } - - /** Get Themes */ - private function installer_theme_get_themes( $product_url = '', $repo_source = '' ) { - - //Query API - if ( empty($product_url) ) { - //Not set - if ( isset($this->repository_theme_products[$this->installer_theme_active_tab]) ) { - $query_remote_url = $this->repository_theme_products[$this->installer_theme_active_tab]; - } - - } else { - $query_remote_url = $product_url; - } - - //Let's retrieved current installer settings so we won't be querying all the time - $current_installer_settings = WP_Installer()->get_settings(); - - //Set $themes to FALSE by default - $themes = false; - - if ( (is_array( $current_installer_settings )) && (!(empty($current_installer_settings))) ) { - - //Set and already defined, retrieved $products - if ( isset($current_installer_settings['repositories'][$repo_source]['data']) ) { - $products = $current_installer_settings['repositories'][$repo_source]['data']; - if ( isset($products['downloads']['themes']) ) { - $themes = $products['downloads']['themes']; - } - } - - } else { - - //Call API - $response = wp_remote_get( $query_remote_url ); - - if ( is_wp_error( $response ) ) { - //Error detected: http fallback - $query_remote_url = preg_replace( "@^https://@", 'http://', $query_remote_url ); - $response = wp_remote_get( $query_remote_url ); - } - - if ( !(is_wp_error( $response )) ) { - //Not WP error - //Evaluate response - if ( $response && isset($response['response']['code']) && $response['response']['code'] == 200 ) { - //In this case, response is set and defined, proceed... - $body = wp_remote_retrieve_body( $response ); - if ( $body ) { - $products = json_decode( $body, true ); - if ( isset($products['downloads']['themes']) ) { - $themes = $products['downloads']['themes']; - } - } - - } - } - } - - //Return themes, can be filtered by user subscription type - return apply_filters( 'installer_theme_get_themes', $themes, $this->installer_theme_active_tab ); - } - - /** Format response in compatibility with WordPress Theme API response */ - private function installer_theme_format_response( $themes, $action, $slug = '' ) { - - //Let's append download link only when retrieving theme information for installation - if ( ('theme_information' == $action) && (!(empty($slug))) ) { - - //Only return one result -> the theme to be installed - foreach ( $themes as $k => $theme ) { - if ( $slug == $theme['basename'] ) { - $theme['download_link'] = WP_Installer()->append_site_key_to_download_url( $theme['url'], $this->installer_site_key[$this->installer_theme_active_tab], $this->installer_theme_active_tab ); - $theme = json_decode( json_encode( $theme ), FALSE ); - return $theme; - } - } - - } else { - - $res = new stdClass(); - $res->info = array(); - $res->themes = array(); - - //Define info - $res->info['page'] = 1; - $res->info['pages'] = 10; - - //Let's count available themes ; - $res->info['results'] = count( $themes ); - - //Let's saved themes for easy access later on - $this->installer_theme_savethemes_by_slug( $themes ); - - //Let's defined available themes - if ( isset($this->installer_theme_subscription_type) ) { - //Has subscription type defined, let's saved what is associated with this subscription - $this->installer_theme_available( $this->installer_theme_active_tab, $this->installer_theme_subscription_type ); - } else { - $this->installer_theme_available( $this->installer_theme_active_tab ); - } - - //Let's add themes to the overriden WordPress API Theme response - /** Installer 1.7.6: Update to compatible data format response from WP Theme API */ - $theme_compatible_array=array(); - if ((is_array($themes))) { - foreach ($themes as $k=>$v) { - $theme_compatible_array[]=(object)($v); - } - } - $res->themes = $theme_compatible_array; - $res->themes = apply_filters( 'installer_theme_hook_response_theme', $res->themes ); - return $res; - } - } - - /** Let's save all available themes by its slug after any latest API query */ - private function installer_theme_savethemes_by_slug( $themes, $doing_query = false ) { - - if ( !($doing_query) ) { - $this->installer_themes[$this->installer_theme_active_tab] = array(); - } - - if ( !(empty($themes)) ) { - $themes_for_saving = array(); - foreach ( $themes as $k => $theme ) { - if ( !($doing_query) ) { - if ( isset($theme['slug']) ) { - $theme_slug = $theme['slug']; - if ( !(empty($theme_slug)) ) { - $themes_for_saving[] = $theme_slug; - } - } - } else { - - if ( ((isset($theme['slug'])) && (isset($theme['version'])) && - (isset($theme['theme_page_url']))) && (isset($theme['url'])) - ) { - $theme_slug = $theme['slug']; - $theme_version = $theme['version']; - $theme_page_url = $theme['theme_page_url']; - $theme_url = $theme['url']; - if ( (!(empty($theme_slug))) && (!(empty($theme_version))) && - (!(empty($theme_page_url))) && (!(empty($theme_url))) - ) { - //$theme_slug is unique for every theme - $themes_for_saving[$theme_slug] = array( - 'version' => $theme_version, - 'theme_page_url' => $theme_page_url, - 'url' => $theme_url - ); - - } - } - } - - } - - if ( !(empty($themes_for_saving)) ) { - //Has themes for saving - if ( !($doing_query) ) { - //Not doing query - $existing_themes = get_option( $this->installer_themes_option[$this->installer_theme_active_tab] ); - if ( !($existing_themes) ) { - //Does not yet exists - delete_option( $this->installer_themes_option[$this->installer_theme_active_tab] ); - update_option( $this->installer_themes_option[$this->installer_theme_active_tab], $themes_for_saving ); - } else { - //exists, check if we need to update - if ( $existing_themes == $themes_for_saving ) { - //Equal, no need to update here - } else { - //Update - delete_option( $this->installer_themes_option[$this->installer_theme_active_tab] ); - update_option( $this->installer_themes_option[$this->installer_theme_active_tab], $themes_for_saving ); - } - } - } else { - //Used for query purposes only, don't save anything - return $themes_for_saving; - } - } - } - } - - /** Available themes */ - private function installer_theme_available( $repo, $subscription_type = '' ) { - - $subscription_type = intval( $subscription_type ); - if ( $subscription_type > 0 ) { - - //Here we have a case of validated subscription - //We need to set themes that is available to this subscription - $themes_associated_with_subscription = $this->installer_themes[$repo] = $this->installer_theme_get_themes_by_subscription( $subscription_type, $repo ); - if ( !(empty($themes_associated_with_subscription)) ) { - //Has themes - $this->installer_themes[$repo] = $themes_associated_with_subscription; - } - } else { - - //Get themes - $this->installer_themes[$repo] = get_option( $this->installer_themes_option[$repo] ); - } - } - - /** Theme upgrade check */ - public function installer_theme_upgrade_check( $the_value ) { - - //Step1: Let's looped through repos with themes and check if we have updates available for them. - if ( (is_array( $this->installer_repo_with_themes )) && (!(empty($this->installer_repo_with_themes))) ) { - foreach ( $this->installer_repo_with_themes as $k => $repo_slug ) { - //Step2: Let's checked if we have update for this theme - $update_available = get_option( $this->installer_themes_available_updates[$repo_slug] ); - if ( $update_available ) { - if ( (is_array( $update_available )) && (!(empty($update_available))) ) { - //Has updates available coming from this specific theme repo - //Let's loop through the themes that needs update - foreach ( $update_available as $theme_slug => $v ) { - //Add to response API - $the_value->response [$theme_slug] = array( - 'theme' => $theme_slug, - 'new_version' => $v['new_version'], - 'url' => $v['url'], - 'package' => $v['package'] - ); - } - } - } - } - } - //Return - return $the_value; - } - - /** Return repositories that has themes */ - private function installer_theme_reposities_that_has_themes( $repositories, $ret_value = true, $doing_api_query = false ) { - - $repositories_with_themes = array(); - - if ( (is_array( $repositories )) && (!(empty($repositories))) ) { - - //Let's checked if we have something before - $themes = get_option( 'installer_repositories_with_theme' ); - - if ( (!($themes)) || ($doing_api_query) ) { - //Not yet defined - //Loop through each repositories and check whether they have themes - foreach ( $repositories as $k => $v ) { - if ( isset($v['products']) ) { - $products_url = $v['products']; - $themes = $this->installer_theme_get_themes( $products_url, $k ); - if ( (is_array( $themes )) && (!(empty($themes))) ) { - //Repo has themes - $repositories_with_themes[] = $k; - } - } - } - } else { - //Already set - $repositories_with_themes = $themes; - } - - if ( (((is_array( $repositories_with_themes )) && (!(empty($repositories_with_themes)))) && (!($themes))) || ($doing_api_query) ) { - //Save to db - update_option( 'installer_repositories_with_theme', $repositories_with_themes ); - } - } - - if ( $ret_value ) { - return $repositories_with_themes; - } - - } - - /** When WordPress queries its own Themes API, we sync with our own */ - public function installer_theme_sync_native_wp_api( $response, $responsetext, $class, $args, $url ) { - - $api_native_string = 'api.wordpress.org/themes/'; - if ( (strpos( $url, $api_native_string ) !== false) ) { - //WordPress is querying its own themes API - $installer_repositories = WP_Installer()->get_repositories(); - - //Query our own API and update repository values too - $this->installer_theme_reposities_that_has_themes( $installer_repositories, false, true ); - } - } - - /** Returns product name by theme repo slug */ - private function installer_theme_get_repo_product_name( $theme_repo ) { - - $theme_repo_name = false; - - if ( isset(WP_Installer()->settings['repositories'][$theme_repo]['data']['product-name']) ) { - //Set - $prod_name = WP_Installer()->settings['repositories'][$theme_repo]['data']['product-name']; - if ( !(empty($prod_name)) ) { - $theme_repo_name = $prod_name; - } - } else { - //Not yet - if ( $theme_repo == $this->theme_repo ) { - $result = $this->installer_theme_general_api_query(); - if ( isset($result['product-name']) ) { - $product_name = $result['product-name']; - if ( !(empty($product_name)) ) { - $theme_repo_name = $product_name; - } - } - } - } - - return $theme_repo_name; - } - - /** General query API method, returns $products */ - private function installer_theme_general_api_query() { - $products = false; - $response = wp_remote_get( $this->repository_theme_products ); - if ( !(is_wp_error( $response )) ) { - //Not WP error - //Evaluate response - if ( $response && isset($response['response']['code']) && $response['response']['code'] == 200 ) { - //In this case, response is set and defined, proceed... - $body = wp_remote_retrieve_body( $response ); - if ( $body ) { - $result = json_decode( $body, true ); - if ( (is_array( $result )) && (!(empty($result))) ) { - $products = $result; - } - } - - } - } - - return $products; - } - - /** General method to check if themes are OTGS themes based on its slug*/ - private function installer_themes_belong_to_us( $theme_slug ) { - - $found = false; - $theme_slug = trim( $theme_slug ); - - foreach ( $this->installer_themes as $repo_with_theme => $themes ) { - foreach ( $themes as $k => $otgs_theme_slug ) { - if ( $theme_slug == $otgs_theme_slug ) { - //match found! Theme belongs to otgs - return true; - } - } - } - return $found; - - } - - /** Sets active tab on init */ - public function installer_theme_sets_active_tab_on_init() { - - if ( isset ($_SERVER ['REQUEST_URI']) ) { - $request_uri = $_SERVER ['REQUEST_URI']; - if ( isset ($_GET ['browse']) ) { - $active_tab = sanitize_text_field( $_GET['browse'] ); - $this->installer_theme_active_tab = $active_tab; - } elseif ( isset ($_POST ['request'] ['browse']) ) { - $active_tab = sanitize_text_field ( $_POST['request']['browse'] ); - $this->installer_theme_active_tab = $active_tab; - } elseif ( (isset ($_GET ['theme_repo'])) && (isset ($_GET ['action'])) ) { - $theme_repo = sanitize_text_field( $_GET['theme_repo'] ); - $the_action = sanitize_text_field( $_GET['action'] ); - if ( ('install-theme' == $the_action) && (!(empty($theme_repo))) ) { - $this->installer_theme_active_tab = $theme_repo; - } - } elseif ( wp_get_referer() ) { - $referer = wp_get_referer(); - $parts = parse_url( $referer ); - if ( isset($parts['query']) ) { - parse_str( $parts['query'], $query ); - if ( isset($query['browse']) ) { - $this->installer_theme_active_tab = $query['browse']; - } - } - } - } - } - - /** WP Theme API compatibility- added num ratings */ - /** Installer 1.7.6+ Added updated 'rating' field */ - public function installer_theme_add_num_ratings( $themes ) { - - if ( (is_array( $themes )) && (!(empty($themes))) ) { - foreach ( $themes as $k => $v ) { - if ( !(isset($v->num_ratings)) ) { - $themes[$k]->num_ratings = 100; - } - if ( !(isset($v->rating)) ) { - $themes[$k]->rating = 100; - } - } - } - - return $themes; - } - - /** When WordPress.org makes a call to its repository, let's run our own upgrade checks too */ - public function installer_theme_sync_call_wp_theme_api( $locales ) { - - $this->installer_theme_upgrade_theme_check(); - - return $locales; - } - - /** Upgrade theme check */ - private function installer_theme_upgrade_theme_check() { - - // Step1-> we get all installed themes in clients local themes directory - $installed_themes = wp_get_themes(); - - // Step2: We need to loop through each repository with themes - foreach ( $this->installer_repo_with_themes as $k => $repo_slug ) { - - // We then need to retrieved the products URL for each of this repo - $products_url = $this->repository_theme_products [$repo_slug]; - - // Step3-> we get all available themes in our repository via API based on this URL - $available_themes = $this->installer_theme_get_themes( $products_url, $repo_slug ); - - if ( !($available_themes) ) { - - // API is not available as of the moment, return.. - return; - } else { - - // We have available themes here... - // Step4->let's simplify available themes data by slugs - $simplified_available_themes = $this->installer_theme_savethemes_by_slug( $available_themes, true ); - - // Step5->Let's loop through installed themes - if ( (is_array( $installed_themes )) && (!(empty ($installed_themes))) ) { - $otgs_theme_updates_available = array(); - foreach ( $installed_themes as $theme_slug => $theme_object ) { - if ( array_key_exists( $theme_slug, $simplified_available_themes ) ) { - - // This is our theme - // Step6->Let's get version of the local theme installed - $local_version = $theme_object->get( 'Version' ); - - // Step7->Let's get the latest version of this theme, page URL and download URL from our repository - $repository_version = $simplified_available_themes [$theme_slug] ['version']; - $theme_page_url = $simplified_available_themes [$theme_slug] ['theme_page_url']; - $theme_download_url = $simplified_available_themes [$theme_slug] ['url']; - - // Step8->Let's compare the version - if ( version_compare( $repository_version, $local_version, '>' ) ) { - - // Update available for this theme - // Step9-> Define download URL with site key - $package_url = WP_Installer()->append_site_key_to_download_url( $theme_download_url, $this->installer_site_key [$repo_slug], $repo_slug ); - - //Step10-> Assign to updates array for later accessing. - $otgs_theme_updates_available[$theme_slug] = array( - 'theme' => $theme_slug, - 'new_version' => $repository_version, - 'url' => $theme_page_url, - 'package' => $package_url - ); - } - } - } - //Exited the upgrade loop for this specific theme repository - if ( !(empty($otgs_theme_updates_available)) ) { - //Has updates - update_option( $this->installer_themes_available_updates[$repo_slug], $otgs_theme_updates_available ); - } else { - //No updates - delete_option( $this->installer_themes_available_updates[$repo_slug] ); - } - - } - } - } - } - - /** When the user is on Themes install page OTG themes repository, let's the currently selected tab */ - public function installer_theme_add_query_arg_tab( $url, $path, $blog_id = null ) { - - $wp_install_string = 'update.php?action=install-theme'; - if ( $path == $wp_install_string ) { - if ( isset($this->installer_theme_active_tab) ) { - if ( !(empty($this->installer_theme_active_tab)) ) { - $url = add_query_arg( array( - 'theme_repo' => $this->installer_theme_active_tab - ), $url ); - } - } - } - return $url; - } - - /** Save frontend theme tab selected */ - public function installer_theme_frontend_selected_tab() { - if ( isset($_POST["frontend_tab_selected"]) ) { - check_ajax_referer( 'installer_theme_frontend_selected_tab', 'installer_theme_frontend_selected_tab_nonce' ); - - //Client_side_active_tab - $frontend_tab_selected = sanitize_text_field( $_POST['frontend_tab_selected'] ); - if ( !(empty($frontend_tab_selected)) ) { - //Front end tab selected - update_option( 'wp_installer_clientside_active_tab', $frontend_tab_selected, false ); - - //Check for registration status - if ( isset($this->theme_user_registration[$frontend_tab_selected]) ) { - //Set - if ( !($this->theme_user_registration[$frontend_tab_selected]) ) { - //Not registered yet - - if ( is_multisite() ) { - $admin_url_passed = network_admin_url(); - } else { - $admin_url_passed = admin_url(); - } - - $registration_url = $admin_url_passed . 'plugin-install.php?tab=commercial#installer_repo_' . $frontend_tab_selected; - - //Message and link - $theme_repo_name = $this->installer_theme_get_repo_product_name( $frontend_tab_selected );; - $response['unregistered_messages'] = sprintf( __( 'To install and update %s, please %sregister%s %s for this site.', 'installer' ), - $theme_repo_name, '', '', $theme_repo_name ); - - } - } - - $response['output'] = $frontend_tab_selected; - echo json_encode( $response ); - } - die(); - } - die(); - } - - /** Installer loaded aux hooks */ - public function installer_theme_loaded_hooks() { - - if ( isset($this->installer_theme_subscription_type) ) { - $subscription_type = intval( $this->installer_theme_subscription_type ); - if ( $subscription_type > 0 ) { - //Client is subscribed - add_filter( 'installer_theme_get_themes', array($this, 'installer_theme_filter_themes_by_subscription'), 10, 2 ); - } - } - - } - - /** Get themes by subscription type */ - protected function installer_theme_get_themes_by_subscription( $subscription_type, $repo ) { - - $themes_associated_with_subscription = array(); - if ( isset(WP_Installer()->settings['repositories'][$repo]['data']['packages']) ) { - //Set - $packages = WP_Installer()->settings['repositories'][$repo]['data']['packages']; - $available_themes_subscription = array(); - foreach ( $packages as $package_id => $package_details ) { - if ( isset($package_details['products']) ) { - $the_products = $package_details['products']; - foreach ( $the_products as $product_slug => $product_details ) { - if ( isset($product_details['subscription_type']) ) { - $subscription_type_from_settings = intval( $product_details['subscription_type'] ); - if ( $subscription_type_from_settings == $subscription_type ) { - //We found the subscription - if ( isset($product_details['themes']) ) { - $themes_associated_with_subscription = $product_details['themes']; - return $themes_associated_with_subscription; - } - } - } - - } - } - } - } - return $themes_associated_with_subscription; - } - - /** Filter API theme response according to user subscription */ - public function installer_theme_filter_themes_by_subscription( $themes, $active_tab ) { - - //Step1, we only filter OTGS themes - $orig = is_array( $themes ) ? count( $themes ) : 0; - if ( in_array( $active_tab, $this->theme_repo ) ) { - //OTGS Theme - //Step2, we retrieved the available themes based on client subscription - if ( isset($this->installer_themes[$active_tab]) ) { - $available_themes = $this->installer_themes[$active_tab]; - //Step3, we filter $themes based on this info - if ( (is_array( $themes )) && (!(empty($themes))) ) { - foreach ( $themes as $k => $theme ) { - //Step4, get theme slug - if ( isset($theme['slug']) ) { - $theme_slug = $theme['slug']; - if ( !(empty($theme_slug)) ) { - if ( !(in_array( $theme_slug, $available_themes )) ) { - //This theme is not in available themes - unset($themes[$k]); - } - } - } - } - } - } - } - $new = is_array( $themes ) ? count( $themes ) : 0; - if ( $orig != $new ) { - //It is filtered - $themes = array_values( $themes ); - } - - return $themes; - } - - /** Hook to wp_loaded, fires when all Installer theme class is ready */ - public function installer_themes_support_set_up_func() { - do_action( 'installer_themes_support_set_up' ); - } - -} - -/** Instantiate Installer Theme Class */ -new Installer_Theme_Class; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-upgrader-skins.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-upgrader-skins.php deleted file mode 100644 index 41cc432..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-installer-upgrader-skins.php +++ /dev/null @@ -1,38 +0,0 @@ - '', 'nonce' => '', 'title' => '', 'context' => false ); - $this->options = wp_parse_args( $args, $defaults ); - } - - function header() { - - } - - function footer() { - - } - - function error( $error ) { - $this->installer_error = $error; - } - - function add_strings() { - - } - - function feedback( $string ) { - - } - - function before() { - - } - - function after() { - - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-factory.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-factory.php deleted file mode 100644 index b45e38d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-factory.php +++ /dev/null @@ -1,147 +0,0 @@ -installer = $installer; - } - - /** - * @return OTGS_Installer_Filename_Hooks - */ - public function create_filename_hooks() { - if ( ! $this->filename_hooks ) { - $this->filename_hooks = new OTGS_Installer_Filename_Hooks( $this->create_installer_php_functions() ); - } - - return $this->filename_hooks; - } - - /** - * @return OTGS_Installer_Icons - */ - public function create_icons() { - if ( ! $this->icons ) { - $this->icons = new OTGS_Installer_Icons( $this->get_installer() ); - } - - return $this->icons; - } - - /** - * @return OTGS_Installer_WP_Components_Setting_Ajax - */ - public function create_local_components_ajax_setting() { - if ( ! $this->local_components_ajax_setting ) { - $this->local_components_ajax_setting = new OTGS_Installer_WP_Components_Setting_Ajax( $this->create_settings(), - $this->get_installer() ); - } - - return $this->local_components_ajax_setting; - } - - public function create_resources() { - return new OTGS_Installer_WP_Components_Setting_Resources( $this->get_installer() ); - } - - public function create_settings_hooks() { - return new OTGS_Installer_WP_Share_Local_Components_Setting_Hooks( $this->create_template_service_loader() - ->get_service(), - $this->create_settings() ); - } - - /** - * @return OTGS_Installer_Twig_Template_Service_Loader - */ - private function create_template_service_loader() { - if ( ! $this->template_service_loader ) { - $this->template_service_loader = new OTGS_Installer_Twig_Template_Service_Loader( array( - $this->get_installer() - ->plugin_path() - . '/templates/components-setting/' - ) ); - } - - return $this->template_service_loader; - } - - /** - * @return OTGS_Installer_WP_Share_Local_Components_Setting - */ - public function create_settings() { - if ( ! $this->settings ) { - $this->settings = new OTGS_Installer_WP_Share_Local_Components_Setting(); - } - - return $this->settings; - } - - /** - * @return OTGS_Installer_WP_Components_Hooks - */ - public function create_wp_components_hooks() { - if ( ! $this->wp_components_hooks ) { - $this->wp_components_hooks = new OTGS_Installer_WP_Components_Hooks( $this->create_wp_components_storage(), - $this->create_wp_components_sender(), - $this->create_settings(), - $this->create_installer_php_functions() ); - } - - return $this->wp_components_hooks; - } - - /** - * @return OTGS_Installer_WP_Components_Storage - */ - public function create_wp_components_storage() { - if ( ! $this->wp_components_storage ) { - $this->wp_components_storage = new OTGS_Installer_WP_Components_Storage(); - } - - return $this->wp_components_storage; - } - - /** - * @return OTGS_Installer_WP_Components_Sender - */ - public function create_wp_components_sender() { - if ( ! $this->wp_components_sender ) { - $this->wp_components_sender = new OTGS_Installer_WP_Components_Sender( $this->get_installer(), - $this->create_settings() ); - } - - return $this->wp_components_sender; - } - - /** - * @return OTGS_Installer_PHP_Functions - */ - public function create_installer_php_functions() { - if ( ! $this->installer_php_functions ) { - $this->installer_php_functions = new OTGS_Installer_PHP_Functions(); - } - - return $this->installer_php_functions; - } - - /** - * @return WP_Installer - */ - private function get_installer() { - return $this->installer; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-filename-hooks.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-filename-hooks.php deleted file mode 100644 index c5bfce7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-filename-hooks.php +++ /dev/null @@ -1,33 +0,0 @@ -built_in_functions = $built_in_functions; - } - - public function add_hooks() { - if ( in_array( $this->built_in_functions->constant( 'PHP_OS' ), array( 'WIN32', 'WINNT', 'Windows' ), true ) ) { - add_filter( 'wp_unique_filename', array( $this, 'fix_filename_for_win' ), 10, 3 ); - } - } - - /** - * @param string $filename - * @param string $ext - * @param string $dir - * - * @return string - */ - public function fix_filename_for_win( $filename, $ext, $dir ) { - if ( $dir === get_temp_dir() ) { - return md5( $filename . $this->built_in_functions->time() ) . 'tmp'; - } - return $filename; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-icons.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-icons.php deleted file mode 100644 index d70422c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-icons.php +++ /dev/null @@ -1,40 +0,0 @@ -installer = $installer; - } - - public function add_hooks() { - add_filter( 'otgs_installer_upgrade_check_response', array( $this, 'add_icons_on_response' ), 10, 3 ); - } - - /** - * @param stdClass $response - * @param string $name - * - * @return stdClass - */ - public function add_icons_on_response( $response, $name, $repository ) { - $product = isset( $this->installer->settings['repositories'][ $repository ]['data']['products-map'][ $name ] ) - ? $this->installer->settings['repositories'][ $repository ]['data']['products-map'][ $name ] - : ''; - - if ( $product ) { - $base = $this->installer->plugin_url() . '/../icons/plugin-icons/' . $repository . '/' . $product . '/icon'; - $response->icons = array( - 'svg' => $base . '.svg', - '1x' => $base . '-128x128.png', - '2x' => $base . '-256x256.png', - ); - } - - return $response; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-php-functions.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-php-functions.php deleted file mode 100644 index d5d7bd9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-php-functions.php +++ /dev/null @@ -1,33 +0,0 @@ -defined( $constant_name ) ? constant( $constant_name ) : null; - } - - /** - * @return int - */ - public function time() { - return time(); - } - - public function phpversion() { - return phpversion(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-plugins-page-notice.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-plugins-page-notice.php deleted file mode 100644 index 1493527..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-plugins-page-notice.php +++ /dev/null @@ -1,89 +0,0 @@ -template_service = $template_service; - } - - public function add_hooks() { - foreach ( $this->get_plugins() as $plugin_id => $plugin_data ) { - add_action( 'after_plugin_row_' . $plugin_id, array( - $this, - 'show_purchase_notice_under_plugin' - ), 10, 3 ); - } - } - - /** - * @return array - */ - public function get_plugins() { - return $this->plugins; - } - - public function add_plugin( $plugin_id, $plugin_data ) { - $this->plugins[ $plugin_id ] = $plugin_data; - } - - /** - * @param string $plugin_file - */ - public function show_purchase_notice_under_plugin( $plugin_file ) { - $should_display_subscription_notice = isset( $this->plugins[ $plugin_file ][ self::DISPLAY_SUBSCRIPTION_NOTICE_KEY ] ) - ? $this->plugins[ $plugin_file ][ self::DISPLAY_SUBSCRIPTION_NOTICE_KEY ] - : false; - - if ( $should_display_subscription_notice ) { - echo $this->template_service->show( $this->get_model(), self::TEMPLATE ); - } - } - - /** - * @return array - */ - private function get_model() { - $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); - - $tr_classes = 'plugin-update-tr'; - $notice_classes = 'update-message installer-q-icon'; - - if ( version_compare( get_bloginfo( 'version' ), '4.6', '>=' ) ) { - $tr_classes = 'plugin-update-tr installer-plugin-update-tr'; - $notice_classes = 'notice inline notice-warning notice-alt'; - } - - if ( is_multisite() ) { - if ( is_network_admin() ) { - $menu_url = network_admin_url( 'plugin-install.php?tab=commercial' ); - } else { - $menu_url = admin_url( 'options-general.php?page=installer' ); - } - } else { - $menu_url = admin_url( 'plugin-install.php?tab=commercial' ); - } - - return array( - 'strings' => array( - 'valid_subscription' => sprintf( __( 'You must have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s.', 'installer' ), - '', '' ), - ), - 'css' => array( - 'tr_classes' => $tr_classes, - 'notice_classes' => $notice_classes, - ), - 'col_count' => $wp_list_table->get_column_count(), - ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-subscription.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-subscription.php deleted file mode 100644 index d4c9479..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-subscription.php +++ /dev/null @@ -1,81 +0,0 @@ -status ) ) { - $this->status = (int) $data->status; - } - if ( isset( $data->expires ) ) { - $this->expires = $data->expires; - } - } - } - - public function get_subscription_status_text() { - if ( $this->is_expired() ) { - return self::SUBSCRIPTION_STATUS_TEXT_EXPIRED; - } - - if ( $this->is_valid() ) { - return self::SUBSCRIPTION_STATUS_TEXT_VALID; - } - - return self::SUBSCRIPTION_STATUS_TEXT_MISSING; - } - - /** - * @return bool - */ - private function is_expired() { - return ! $this->is_lifetime() - && ( - self::SUBSCRIPTION_STATUS_EXPIRED === $this->get_status() - || ( $this->get_expiration() && strtotime( $this->get_expiration() ) <= time() ) - ); - } - - /** - * @return bool - */ - private function is_lifetime() { - return $this->get_status() === self::SUBSCRIPTION_STATUS_ACTIVE_NO_EXPIRATION; - } - - private function get_status() { - return $this->status; - } - - private function get_expiration() { - return $this->expires; - } - - /** - * @return bool - */ - public function is_valid() { - return ( $this->is_lifetime() - || ( $this->get_status() === self::SUBSCRIPTION_STATUS_ACTIVE && ! $this->is_expired() ) ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-hooks.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-hooks.php deleted file mode 100644 index 7d7c1f0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-hooks.php +++ /dev/null @@ -1,78 +0,0 @@ -storage = $storage; - $this->sender = $sender; - $this->setting = $setting; - $this->php_functions = $php_functions; - } - - public function add_hooks() { - add_action( 'wp_ajax_end_user_get_info', array( $this, 'process_report_instantly' ) ); - add_action( 'wp_ajax_' . OTGS_Installer_WP_Components_Setting_Ajax::AJAX_ACTION, array( $this, 'force_send_components_data' ), OTGS_Installer_WP_Components_Setting_Ajax::SAVE_SETTING_PRIORITY + 1 ); - add_action( self::EVENT_SEND_COMPONENTS_MONTHLY, array( $this, 'send_components_data' ) ); - add_action( self::EVENT_SEND_COMPONENTS_AFTER_REGISTRATION, array( $this, 'send_components_data' ) ); - add_action( 'init', array( $this, 'schedule_components_report' ) ); - add_action( 'wp_ajax_save_site_key', array( $this, 'schedule_components_report_when_product_is_registered' ) ); - } - - public function schedule_components_report() { - if ( ! wp_next_scheduled( self::EVENT_SEND_COMPONENTS_MONTHLY ) ) { - wp_schedule_single_event( strtotime( self::REPORT_SCHEDULING_PERIOD ), self::EVENT_SEND_COMPONENTS_MONTHLY ); - } - } - - public function schedule_components_report_when_product_is_registered() { - if ( ! wp_next_scheduled( self::EVENT_SEND_COMPONENTS_AFTER_REGISTRATION ) ) { - wp_schedule_single_event( time() + 60, self::EVENT_SEND_COMPONENTS_AFTER_REGISTRATION ); - } - } - - public function process_report_instantly() { - $this->storage->refresh_cache(); - $this->sender->send( $this->storage->get(), true ); - } - - public function force_send_components_data() { - $this->storage->refresh_cache(); - $this->sender->send( $this->storage->get() ); - } - - public function send_components_data() { - if ( $this->storage->is_outdated() ) { - $this->storage->refresh_cache(); - $this->sender->send( $this->storage->get() ); - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-sender.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-sender.php deleted file mode 100644 index cadc7ac..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-sender.php +++ /dev/null @@ -1,49 +0,0 @@ -installer = $installer; - $this->settings = $settings; - } - - public function send( array $components, $force = false ) { - - if ( ! $this->installer->get_repositories() ) { - $this->installer->load_repositories_list(); - } - - if ( ! $this->installer->get_settings() ) { - $this->installer->save_settings(); - } - - foreach ( $this->installer->get_repositories() as $key => $repository ) { - $site_key = $this->installer->get_site_key( $key ); - if ( $site_key && $this->settings->is_repo_allowed( $key ) ) { - wp_remote_post( - $repository['api-url'] . '?action=update_site_components', - apply_filters( 'installer_fetch_components_data_request', array( - 'body' => array( - 'action' => 'update_site_components', - 'site_key' => $site_key, - 'site_url' => get_site_url(), - 'components' => $components, - 'phpversion' => phpversion(), - 'force' => $force, - ), - ) ) - ); - } - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-setting-ajax.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-setting-ajax.php deleted file mode 100644 index 0e1abc5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-setting-ajax.php +++ /dev/null @@ -1,49 +0,0 @@ -setting = $setting; - $this->installer = $installer; - } - - public function add_hooks() { - add_action( 'wp_ajax_' . self::AJAX_ACTION, array( $this, 'save' ), self::SAVE_SETTING_PRIORITY ); - } - - public function save() { - if ( $this->is_valid_request() ) { - $user_agree = (int) filter_var( $_POST['agree'], FILTER_SANITIZE_FULL_SPECIAL_CHARS ); - $repo_request = filter_var( $_POST['repo'], FILTER_SANITIZE_FULL_SPECIAL_CHARS ); - if ( $repo_request ) { - $repos = array(); - foreach ( $this->installer->get_repositories() as $repo_id => $repository ) { - if ( $repo_id === $repo_request ) { - $repos[ $repo_id ] = $user_agree; - } - } - $this->setting->save( $repos ); - } - } - } - - /** - * @return bool - */ - private function is_valid_request() { - return isset( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], self::AJAX_ACTION ); - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-setting-resources.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-setting-resources.php deleted file mode 100644 index 4dc22d3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-setting-resources.php +++ /dev/null @@ -1,43 +0,0 @@ -installer = $installer; - } - - public function add_hooks() { - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_resources' ) ); - } - - public function enqueue_resources() { - wp_register_style( self::HANDLES_OTGS_INSTALLER_UI, - $this->installer->res_url() . '/dist/css/ui/styles.css', - array(), - WP_INSTALLER_VERSION ); - wp_register_script( self::HANDLES_OTGS_INSTALLER_UI, - $this->installer->res_url() . '/dist/js/ui/app.js', - array(), - WP_INSTALLER_VERSION, - true ); - - wp_enqueue_style( 'otgs-installer-tooltip', $this->installer->res_url() . '/res/css/tooltip/tooltip.css', array( 'wp-pointer' ), WP_INSTALLER_VERSION ); - wp_enqueue_script( 'otgs-installer-tooltip', $this->installer->res_url() . '/res/js/tooltip/tooltip.js', array( - 'wp-pointer', - 'jquery' - ), WP_INSTALLER_VERSION ); - wp_enqueue_script( - 'otgs-installer-components-save-setting', - $this->installer->res_url() . '/res/js/save-components-setting.js', - array(), - WP_INSTALLER_VERSION - ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-storage.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-storage.php deleted file mode 100644 index 0050802..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-components-storage.php +++ /dev/null @@ -1,90 +0,0 @@ -get_plugins(); - $components = array(); - - foreach ( $installed_plugins as $file => $plugin ) { - if ( is_plugin_active( $file ) ) { - $components['plugin'][] = array( - 'File' => $file, - 'Name' => $plugin['Name'], - 'Version' => $plugin['Version'], - ); - } - } - - $components['theme'][] = array( - 'Template' => $active_theme->get_template(), - 'Name' => $active_theme->get( 'Name' ), - 'Version' => $active_theme->get( 'Version' ), - ); - - update_option( self::COMPONENTS_CACHE_OPTION_KEY, $components ); - } - - public function is_outdated() { - $components = $this->get(); - - if ( ! $components ) { - return true; - } - - $current_theme = wp_get_theme(); - $active_plugins = get_option( 'active_plugins' ); - - if ( ! function_exists( 'get_plugins' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - $installed_plugins = $this->get_plugins(); - - if ( isset( $components['theme'] ) ) { - if ( $components['theme'][0]['Template'] !== $current_theme->get_template() || - $components['theme'][0]['Version'] !== $current_theme->get( 'Version' ) - ) { - return true; - } - } - - if ( array_key_exists( 'plugin', $components ) ) { - $cached_activated_plugins = wp_list_pluck( $components['plugin'], 'File' ); - sort( $cached_activated_plugins ); - sort( $active_plugins ); - - if ( $cached_activated_plugins !== $active_plugins ) { - return true; - } - - foreach ( $components['plugin'] as $plugin ) { - if ( $plugin['Version'] !== $installed_plugins[ $plugin['File'] ]['Version'] || - ! is_plugin_active( $plugin['File'] ) - ) { - return true; - } - } - } - - return false; - } - - public function get() { - return get_option( self::COMPONENTS_CACHE_OPTION_KEY ); - } - - /** - * @return array - */ - public function get_plugins() { - if ( ! function_exists( 'get_plugins' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - return get_plugins(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-share-local-components-setting-hooks.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-share-local-components-setting-hooks.php deleted file mode 100644 index cf81f24..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-share-local-components-setting-hooks.php +++ /dev/null @@ -1,177 +0,0 @@ -template_service = $template_service; - $this->setting = $setting; - } - - public function add_hooks() { - add_action( 'otgs_installer_render_local_components_setting', - array( - $this, - 'render_local_components_setting', - ), - 10, - 5 ); - add_filter( 'otgs_installer_has_local_components_setting', - array( $this, 'has_local_components_setting_filter' ), - 10, - 2 ); - add_filter( 'otgs_installer_repository_subscription_status', - array( $this, 'get_installer_repository_subscription_status' ), - 10, - 2 ); - } - - /** - * @param array $args - * - * @throws \InvalidArgumentException - */ - public function render_local_components_setting( array $args ) { - $params = $this->validate_arguments( $args ); - - if ( (bool) $params['use_styles'] ) { - wp_enqueue_style( OTGS_Installer_WP_Components_Setting_Resources::HANDLES_OTGS_INSTALLER_UI ); - wp_enqueue_script( OTGS_Installer_WP_Components_Setting_Resources::HANDLES_OTGS_INSTALLER_UI ); - } - - $template = self::TEMPLATE_CHECKBOX; - if ( (bool) $params['use_radio'] ) { - $template = self::TEMPLATE_RADIO; - } - - echo $this->template_service->show( $this->get_model( $params ), $template ); - } - - /** - * @param $ignore - * @param string $repo (wpml|toolset) - * - * @return bool - */ - public function has_local_components_setting_filter( $ignore, $repo ) { - return $this->setting->has_setting( $repo ); - } - - public function get_installer_repository_subscription_status( $ignore, $repo ) { - $subscription = WP_Installer()->get_subscription( $repo ); - - return $subscription->get_subscription_status_text(); - } - - private function get_model( $params ) { - $plugin_name = $params['plugin_name']; - $plugin_uri = $params['plugin_uri']; - $plugin_site = $params['plugin_site']; - $custom_heading = $params['custom_heading']; - $custom_label = $params['custom_label']; - $privacy_policy_url = $params['privacy_policy_url']; - $privacy_policy_text = $params['privacy_policy_text']; - $custom_privacy_policy_text = $params['custom_privacy_policy_text']; - $repo = isset( $params['plugin_repository'] ) ? $params['plugin_repository'] : strtolower( $plugin_name ); - - return array( - 'strings' => array( - 'heading' => __( 'Reporting to', 'installer' ), - 'report_to' => __( 'Report to', 'installer' ), - 'radio_report_yes' => __( 'Send theme and plugins info, in order to get faster support and compatibility alerts', - 'installer' ), - 'radio_report_no' => __( "Don't send this information and skip compatibility notes", - 'installer' ), - 'which_theme_and_plugins' => __( 'which theme and plugins you are using.', 'installer' ), - ), - 'custom_raw_heading' => $custom_heading, - 'custom_raw_label' => $custom_label, - 'custom_privacy_policy_text' => $custom_privacy_policy_text, - 'privacy_policy_url' => $privacy_policy_url, - 'privacy_policy_text' => $privacy_policy_text, - 'component_name' => $plugin_name, - 'company_url' => $plugin_uri, - 'company_site' => $plugin_site, - 'nonce' => array( - 'action' => OTGS_Installer_WP_Components_Setting_Ajax::AJAX_ACTION, - 'value' => wp_create_nonce( OTGS_Installer_WP_Components_Setting_Ajax::AJAX_ACTION ), - ), - 'repo' => $repo, - 'is_repo_allowed' => $this->setting->is_repo_allowed( $repo ), - 'has_setting' => (int) $this->setting->has_setting( $repo ), - ); - } - - /** - * @param array $args - * - * @return array - * @throws \InvalidArgumentException - */ - private function validate_arguments( array $args ) { - if ( ! $args ) { - throw new InvalidArgumentException( 'Arguments are missing' ); - } - - $defaults = array( - 'custom_heading' => null, - 'custom_label' => null, - 'custom_radio_label_yes' => null, - 'custom_radio_label_no' => null, - 'custom_privacy_policy_text' => null, - 'use_styles' => false, - 'use_radio' => false, - 'privacy_policy_text' => __( 'Privacy and data usage policy', 'installer' ), - 'plugin_site' => null, - 'plugin_uri' => null, - ); - - $required_arguments = array( 'plugin_name', 'privacy_policy_url' ); - - if ( ! $this->must_use_radios( $args ) ) { - $required_arguments = array( 'plugin_uri', 'plugin_site' ); - } - - foreach ( $required_arguments as $required_argument ) { - if ( ! $this->has_required_argument( $args, $required_argument ) ) { - throw new InvalidArgumentException( $required_argument . ' is missing' ); - } - } - - return array_merge( $defaults, $args ); - } - - /** - * @param array $args - * - * @return bool - */ - private function must_use_radios( array $args ) { - return array_key_exists( 'use_radio', $args ) && $args['use_radio']; - } - - /** - * @param array $args - * @param string $required_argument - * - * @return bool - */ - private function has_required_argument( array $args, $required_argument ) { - return array_key_exists( $required_argument, $args ) && $args[ $required_argument ]; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-share-local-components-setting.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-share-local-components-setting.php deleted file mode 100644 index 6c09363..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-wp-share-local-components-setting.php +++ /dev/null @@ -1,34 +0,0 @@ -get(), $repos ); - update_option( self::OPTION_KEY, $settings ); - } - - /** - * @param string $repo - * - * @return bool - */ - public function is_repo_allowed( $repo ) { - $allowed_repos = $this->get(); - - return isset( $allowed_repos[ $repo ] ) && $allowed_repos[ $repo ]; - } - - public function has_setting( $repo ) { - $current_value = $this->get(); - - return $current_value - && array_key_exists( $repo, $current_value ); - } - - private function get() { - $setting = get_option( self::OPTION_KEY ); - return $setting ? $setting : array(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-twig-autoloader.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-twig-autoloader.php deleted file mode 100644 index 5c87c81..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-twig-autoloader.php +++ /dev/null @@ -1,40 +0,0 @@ -plugin_path() . '/../../twig/twig/lib/' . str_replace( array( '_', "\0" ), array( '/', '' ), $class . '.php' ); - - if ( is_file( $file ) ) { - require $file; - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-translation-service-info.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-translation-service-info.php deleted file mode 100644 index 53fa8d4..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-translation-service-info.php +++ /dev/null @@ -1,40 +0,0 @@ -settings['repositories'][ $repository_id ]['ts_info'] ) ? - WP_Installer()->settings['repositories'][ $repository_id ]['ts_info'] : false; - - $save_settings = false; - if ( isset( $data->ts_info['preferred'] ) && empty( $ts_info['preferred'] ) ) { - WP_Installer()->settings['repositories'][ $repository_id ]['ts_info']['preferred'] = $data->ts_info['preferred']; - $save_settings = true; - } - - if ( isset( $data->ts_info['referal'] ) && empty( $ts_info['referal'] ) ) { - WP_Installer()->settings['repositories'][ $repository_id ]['ts_info']['referal'] = $data->ts_info['referal']; - $save_settings = true; - } - - if ( ! empty( $data->ts_info['client_id'] ) ) { // can be updated - WP_Installer()->settings['repositories'][ $repository_id ]['ts_info']['client_id'] = $data->ts_info['client_id']; - $save_settings = true; - } - - if ( $save_settings ) { - WP_Installer()->save_settings(); - } - - } - -} - -new Translation_Service_Info(); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer-api.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer-api.php deleted file mode 100644 index 62a48eb..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer-api.php +++ /dev/null @@ -1,132 +0,0 @@ -menu_url(); - - $url = $menu_url . '#' . $repository_id; - if($package_id){ - $url .= '/' . $package_id; - } - - return $url; - - } - - public static function get_product_price($repository_id, $package_id, $product_id, $incl_discount = false){ - - $price = WP_Installer()->get_product_price($repository_id, $package_id, $product_id, $incl_discount); - - return $price; - } - - /** - * Retrieve the preferred translation service. - * - * @since 1.6.5 - * - * @param string The repository id (e.g. wpml) - * @return string The translation service id - */ - public static function get_preferred_ts($repository_id = 'wpml'){ - - if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'])){ - return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred']; - } - - return false; - - } - - /** - * Set the preferred translation service. - * - * @since 1.6.5 - * - * @param string The translation service id - * @param string The repository id (e.g. wpml) - */ - public static function set_preferred_ts( $value, $repository_id = 'wpml' ){ - - if( isset( WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'] ) ){ - - WP_Installer()->settings['repositories'][$repository_id]['ts_info']['preferred'] = $value; - - WP_Installer()->save_settings(); - - } - - } - - /** - * Retrieve the referring translation service (if any) - * - * @since 1.6.5 - * - * @param string The repository id (e.g. wpml) - * @return string The translation service id or false - */ - public static function get_ts_referal($repository_id = 'wpml'){ - - if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal'])){ - return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['referal']; - } - - return false; - - } - - /** - * Retrieve the translation services client id for a specific repository (if any) - * - * @since 1.7.9 - * - * @param string The repository id (e.g. wpml) - * @return string The client id or false - */ - public static function get_ts_client_id( $repository_id = 'wpml' ){ - - if(isset(WP_Installer()->settings['repositories'][$repository_id]['ts_info']['client_id'])){ - return WP_Installer()->settings['repositories'][$repository_id]['ts_info']['client_id']; - } - - return false; - - } - - /** - * Retrieve the site key corresponding to a repository. - * This is a wrapper of WP_Installer::get_site_key() - * @see WP_Installer::get_site_key() - * - * @since 1.7.9 - * - * @param string The repository id (e.g. wpml) - * @return string The site key (or false) - */ - public static function get_site_key( $repository_id = 'wpml' ){ - - return WP_Installer()->get_site_key( $repository_id ); - - } - - /** - * Retrieve the ID of the last user who registered a repository. - * - * @since 1.7.16 - * - * @param string The repository id (e.g. wpml) - * @return int The user id (or zero) - */ - public static function get_registering_user_id( $repository_id = 'wpml' ){ - - $user_id = 0; - if( isset( WP_Installer()->settings['repositories'][$repository_id]['subscription']['registered_by'] ) ){ - $user_id = WP_Installer()->settings['repositories'][$repository_id]['subscription']['registered_by']; - } - - return $user_id; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer-channels.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer-channels.php deleted file mode 100644 index f63bbe9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer-channels.php +++ /dev/null @@ -1,282 +0,0 @@ -res_url() . '/res/js/channels.js', array( 'jquery' ), WP_Installer()->version() ); - } - - } - - /** - * Ajax handler for channel switching - */ - public function set_channel(){ - $repository_id = sanitize_text_field( $_POST['repository_id'] ); - $channel = sanitize_text_field( $_POST['channel'] ); - - $response = array(); - - if( $_POST['nonce'] === wp_create_nonce( 'installer_set_channel:' . $repository_id ) ){ - - if( isset( WP_Installer()->settings['repositories'][$repository_id] ) ){ - WP_Installer()->settings['repositories'][$repository_id]['channel'] = $channel; - WP_Installer()->settings['repositories'][$repository_id]['no-prompt'] = $_POST['noprompt'] === 'true'; - WP_Installer()->save_settings(); - } - - WP_Installer()->refresh_repositories_data(); - - $response['status'] = 'OK'; - } - - echo json_encode( $response ); - exit; - } - - /** - * @param string $repository_id - * - * @return int - */ - public function get_channel( $repository_id ){ - $channel = self::CHANNEL_PRODUCTION; - if( isset( WP_Installer()->settings['repositories'][$repository_id]['channel'] ) ){ - $channel = WP_Installer()->settings['repositories'][$repository_id]['channel']; - } - return $channel; - } - - /** - * @param $repository_id - * - * @return bool - */ - private function get_no_prompt( $repository_id ) { - $settings = WP_Installer()->settings; - - return ! empty( $settings['repositories'][ $repository_id ]['no-prompt'] ); - } - - /** - * @param string $repository_id - * @param array $downloads - */ - public function load_channel_selector( $repository_id, $downloads ) { - - $available_channels = $this->get_available_channels( $repository_id ); - - if ( $available_channels ) { - $args = array( - 'can_switch' => $this->can_use_unstable_channels( $downloads ) || $this->get_channel( $repository_id ) > 1, - 'channels' => $available_channels, - 'repository_id' => $repository_id, - 'current_channel' => $this->get_channel( $repository_id ), - 'no_prompt' => $this->get_no_prompt( $repository_id ), - 'nonce' => wp_create_nonce( 'installer_set_channel:' . $repository_id ) - ); - extract( $args ); - include WP_Installer()->plugin_path() . '/templates/channel-selector.php'; - } - } - - /** - * The beta and development channels can be used only when already using the most up to date versions - * @param array $downloads - * - * @return bool - */ - public function can_use_unstable_channels( $downloads ){ - - $can = true; - foreach( $downloads as $download ){ - $available_version = $download['version']; - $installed_version = WP_Installer()->plugin_is_installed( $download['name'], $download['slug'] ); - if( $installed_version !== false && version_compare( $available_version, $installed_version, '>' ) ){ - $can = false; - break; - } - } - - return $can; - } - - /** - * Get available updates channels. Only include channels with actual downloads available. - * - * @param string $repository_id - * - * @return array - */ - public function get_available_channels( $repository_id ) { - - $beta = false; - $dev = false; - - $downloads = WP_Installer()->settings['repositories'][ $repository_id ]['data']['downloads']; - foreach ( $downloads as $type => $download_types ) { - foreach ( $download_types as $download ) { - $extra_channels = isset( $download['extra_channels'] ) ? array_keys( $download['extra_channels'] ) : array(); - if ( ! $beta && in_array( self::CHANNEL_BETA, $extra_channels ) ) { - $beta = true; - } - if ( ! $dev && in_array( self::CHANNEL_DEVELOPMENT, $extra_channels ) ) { - $dev = true; - } - if ( $beta && $dev ) { - break; - } - } - } - - $channels = array(); - if ( $beta || $dev ) { - $channels[ self::CHANNEL_PRODUCTION ] = self::channel_name_by_id( self::CHANNEL_PRODUCTION ); - if ( $beta ) { - $channels[ self::CHANNEL_BETA ] = self::channel_name_by_id( self::CHANNEL_BETA ); - } - if ( $dev ) { - $channels[ self::CHANNEL_DEVELOPMENT ] = self::channel_name_by_id( self::CHANNEL_DEVELOPMENT ); - } - } - - return $channels; - } - - /** - * @param string $repository_id - * @param array $downloads - * - * @return array - */ - public function filter_downloads_by_channel( $repository_id, $downloads ) { - - $current_channel = $this->get_channel( $repository_id ); - - foreach ( $downloads as $type => $type_downloads ) { - foreach ( $type_downloads as $slug => $download ) { - - $override_download = array(); - if ( $current_channel === self::CHANNEL_DEVELOPMENT ) { - if( ! empty( $download['channels']['development'] ) ){ - $override_download = $download['channels']['development']; - $override_download['channel'] = self::CHANNEL_DEVELOPMENT; - }elseif( ! empty( $download['channels']['beta'] ) ){ - $override_download = $download['channels']['beta']; - $override_download['channel'] = self::CHANNEL_BETA; - } - }elseif ( $current_channel === self::CHANNEL_BETA && ! empty( $download['channels']['beta'] ) ) { - $override_download = $download['channels']['beta']; - $override_download['channel'] = self::CHANNEL_BETA; - } - - if ( $override_download ) { - foreach ( $override_download as $key => $value ) { - $downloads[ $type ][ $slug ][ $key ] = $value; - } - } else { - $downloads[ $type ][ $slug ]['channel'] = self::CHANNEL_PRODUCTION; - } - unset ( $downloads[ $type ][ $slug ]['channels'] ); - - $downloads[ $type ][ $slug ]['extra_channels'] = array(); - if( isset( $download['channels'] ) ) { - foreach( $download['channels'] as $channel_id => $channel ){ - $downloads[ $type ][ $slug ]['extra_channels'][$channel_id] = array( - 'version' => $channel['version'] - ); - } - } - - } - } - - return $downloads; - } - - /** - * Get the source channel for the installed version when on the Beta or Development channel - * @param string $version - * @param string $repository_id - * @param string $download_id - * @param string $download_kind - * - * @return string - */ - public function get_download_source_channel( $version, $repository_id, $download_id, $download_kind ) { - - $version_channel = ''; - $installer_settings = WP_Installer()->get_settings(); - if ( isset( $installer_settings['repositories'][ $repository_id ] ) ) { - $repository_data = $installer_settings['repositories'][ $repository_id ]['data']; - if ( isset( $repository_data['downloads'][ $download_kind ][ $download_id ]['extra_channels'] ) ) { - - foreach ( $repository_data['downloads'][ $download_kind ][ $download_id ]['extra_channels'] as $channel_id => $channel_data ) { - if ( $version === $channel_data['version'] ) { - $version_channel = self::channel_name_by_id( $channel_id ); - break; - } - - } - } - - } - - return $version_channel; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer.php deleted file mode 100644 index 79b31c3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/class-wp-installer.php +++ /dev/null @@ -1,2849 +0,0 @@ -settings = $this->get_settings(); - - add_action( 'admin_notices', array( $this, 'show_site_key_nags' ) ); - - add_action( 'admin_notices', array( $this, 'show_admin_messages' ) ); - - add_action( 'admin_init', array( $this, 'load_embedded_plugins' ), 0 ); - - add_action( 'admin_menu', array( $this, 'menu_setup' ) ); - add_action( 'network_admin_menu', array( $this, 'menu_setup' ) ); - - if ( defined( 'DOING_AJAX' ) && isset( $_POST['action'] ) && $_POST['action'] == 'installer_download_plugin' ) { - add_filter( 'site_transient_update_plugins', array( $this, 'plugins_upgrade_check' ) ); - } - add_filter( 'plugins_api', array( $this, 'custom_plugins_api_call' ), 10, 3 ); - add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'plugins_upgrade_check' ) ); - - // register repositories - $this->load_repositories_list(); - - // default config - $this->config['plugins_install_tab'] = false; - - add_action( 'init', array( $this, 'init' ) ); - - //add_filter('wp_installer_buy_url', array($this, 'append_parameters_to_buy_url')); - - add_action( 'init', array( $this, 'load_locale' ) ); - - } - - public function get_repositories() { - - return $this->repositories; - - } - - public function set_config( $key, $value ) { - - $this->config[ $key ] = $value; - - } - - public function init() { - global $pagenow; - - if ( empty( $this->settings['last_repositories_update'] ) || time() - $this->settings['last_repositories_update'] > 86400 - || ( isset( $_GET['force-check'] ) && $_GET['force-check'] == 1 ) - ) { - $this->refresh_repositories_data(); - } - - $this->dependencies = new Installer_Dependencies; - - if ( empty( $this->settings['_pre_1_0_clean_up'] ) ) { - $this->_pre_1_0_clean_up(); - } - - $this->settings = $this->_old_products_format_backwards_compatibility( $this->settings ); - - if ( ! function_exists( 'get_plugins' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - $this->_using_icl = function_exists( 'wpml_site_uses_icl' ) && wpml_site_uses_icl(); - $this->_wpml_version = defined( 'ICL_SITEPRESS_VERSION' ) ? ICL_SITEPRESS_VERSION : ''; - - wp_enqueue_script( 'installer-admin', $this->res_url() . '/res/js/admin.js', array( 'jquery' ), $this->version() ); - wp_enqueue_style( 'installer-admin', $this->res_url() . '/res/css/admin.css', array(), $this->version() ); - - $translation_array = array( - 'installing' => __( 'Installing %s', 'installer' ), - 'updating' => __( 'Updating %s', 'installer' ), - 'activating' => __( 'Activating %s', 'installer' ) - ); - - wp_localize_script( 'installer-admin', 'installer_strings', $translation_array ); - - if ( $pagenow == 'plugins.php' ) { - add_action( 'admin_notices', array( $this, 'setup_plugins_page_notices' ) ); - add_action( 'admin_notices', array( $this, 'setup_plugins_renew_warnings' ), 10 ); - add_action( 'admin_notices', array( $this, 'queue_plugins_renew_warnings' ), 20 ); - - add_action( 'admin_init', array( $this, 'setup_plugins_action_links' ) ); - - } - - if ( $this->is_repositories_page() ) { - add_action( 'admin_init', array( $this, 'validate_repository_subscription' ) ); - } - - if ( defined( 'DOING_AJAX' ) ) { - add_action( 'wp_ajax_save_site_key', array( $this, 'save_site_key' ) ); - add_action( 'wp_ajax_remove_site_key', array( $this, 'remove_site_key_ajax' ) ); - add_action( 'wp_ajax_update_site_key', array( $this, 'update_site_key' ) ); - - add_action( 'wp_ajax_installer_download_plugin', array( $this, 'download_plugin_ajax_handler' ) ); - add_action( 'wp_ajax_installer_activate_plugin', array( $this, 'activate_plugin' ) ); - - add_action( 'wp_ajax_installer_dismiss_nag', array( $this, 'dismiss_nag' ) ); - } - - if ( $pagenow === 'update.php' ) { - if ( isset( $_GET['action'] ) && $_GET['action'] === 'update-selected' ) { - add_action( 'admin_head', array( $this, 'plugin_upgrade_custom_errors' ) ); //iframe/bulk - } else { - add_action( 'all_admin_notices', array( $this, 'plugin_upgrade_custom_errors' ) ); //regular/singular - } - } - - // WP 4.2 - if ( defined( 'DOING_AJAX' ) ) { - add_action( 'wp_ajax_update-plugin', array( - $this, - 'plugin_upgrade_custom_errors' - ), 0 ); // high priority, before WP - } - - //Include theme support - include_once $this->plugin_path() . '/includes/class-installer-theme.php'; - - // Extra information about the source of Installer - $package_source_file = $this->plugin_path() . '/installer-source.json'; - if ( file_exists( $package_source_file ) ) { - WP_Filesystem(); - global $wp_filesystem; - $this->package_source = json_decode( $wp_filesystem->get_contents( $package_source_file ) ); - } - } - - protected function log( $message ) { - require_once ABSPATH . 'wp-admin/includes/file.php'; - WP_Filesystem(); - global $wp_filesystem; - if ( defined( 'WPML_INSTALLER_LOGGING' ) && WPML_INSTALLER_LOGGING ) { - $wp_filesystem->put_contents( $this->plugin_path() . '/installer.log', current_time( 'mysql' ) . "\t" . $message . "\n" ); - } - } - - public function register_admin_message( $text, $type = 'updated' ) { - $this->admin_messages[] = array( 'text' => $text, 'type' => $type ); - } - - public function show_admin_messages() { - if ( ! empty( $this->admin_messages ) ) { - $types = array( 'error', 'updated', 'notice' ); - foreach ( $this->admin_messages as $message ) { - $class = in_array( $message['type'], $types, true ) ? $message['type'] : 'updated'; - ?> -
-

- -

-
- plugin_path() . '/locale/installer-' . $locale . '.mo'; - if ( file_exists( $mo_file ) ) { - load_textdomain( 'installer', $mo_file ); - } - } - - public function load_embedded_plugins() { - if ( file_exists( $this->plugin_path() . '/embedded-plugins' ) ) { - include_once $this->plugin_path() . '/embedded-plugins/embedded-plugins.class.php'; - $this->installer_embedded_plugins = new Installer_Embedded_Plugins(); - } - } - - public function menu_setup() { - global $pagenow; - - if ( is_multisite() && ! is_network_admin() ) { - $this->menu_multisite_redirect(); - add_options_page( __( 'Installer', 'installer' ), __( 'Installer', 'installer' ), 'manage_options', 'installer', array( - $this, - 'show_products' - ) ); - } else { - if ( $this->config['plugins_install_tab'] && is_admin() && $pagenow === 'plugin-install.php' ) { - // Default GUI, under Plugins -> Install - add_filter( 'install_plugins_tabs', array( $this, 'add_install_plugins_tab' ) ); - add_action( 'install_plugins_commercial', array( $this, 'show_products' ) ); - } - } - - } - - public function menu_url() { - if ( is_multisite() ) { - if ( is_network_admin() ) { - $url = network_admin_url( 'plugin-install.php?tab=commercial' ); - } else { - $url = admin_url( 'options-general.php?page=installer' ); - } - } else { - $url = admin_url( 'plugin-install.php?tab=commercial' ); - } - - return $url; - } - - private function menu_multisite_redirect() { - global $pagenow; - - if ( $pagenow === 'plugin-install.php' && isset( $_GET['tab'] ) && $_GET['tab'] === 'commercial' ) { - wp_redirect( $this->menu_url() ); - exit; - } - - } - - private function _pre_1_0_clean_up() { - global $wpdb; - - if ( ! defined( 'WPRC_VERSION' ) ) { - $old_tables = array( - $wpdb->prefix . 'wprc_cached_requests', - $wpdb->prefix . 'wprc_extension_types', - $wpdb->prefix . 'wprc_extensions', - $wpdb->prefix . 'wprc_repositories', - $wpdb->prefix . 'wprc_repositories_relationships', - ); - - foreach ( $old_tables as $table ) { - $wpdb->query( sprintf( "DROP TABLE IF EXISTS %s", $table ) ); - } - - } - - $this->settings['_pre_1_0_clean_up'] = true; - $this->save_settings(); - } - - public function setup_plugins_action_links() { - - $plugins = get_plugins(); - - $repositories_plugins = array(); - - if ( ! empty( $this->settings['repositories'] ) ) { - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - foreach ( $repository['data']['packages'] as $package ) { - - if ( array_key_exists( 'products', $package ) ) { - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( ! isset( $repositories_plugins[ $repository_id ][ $download['slug'] ] ) ) { - $repositories_plugins[ $repository_id ][ $download['slug'] ] = array( - 'name' => $download['name'], - 'registered' => $this->plugin_is_registered( $repository_id, $download['slug'] ) ? 1 : 0 - ); - } - - } - } - } else { - $this->refresh_repositories_data(); - } - - } - - foreach ( $plugins as $plugin_id => $plugin ) { - - $wp_plugin_slug = dirname( $plugin_id ); - if ( empty( $wp_plugin_slug ) ) { - $wp_plugin_slug = basename( $plugin_id, '.php' ); - } - - foreach ( $repositories_plugins as $repository_id => $r_plugins ) { - - foreach ( $r_plugins as $slug => $r_plugin ) { - - if ( $wp_plugin_slug === $slug || $r_plugin['name'] === $plugin['Name'] || $r_plugin['name'] === $plugin['Title'] ) { //match order: slug, name, title - - if ( $r_plugin['registered'] ) { - add_filter( 'plugin_action_links_' . $plugin_id, array( - $this, - 'plugins_action_links_registered' - ) ); - } else { - add_filter( 'plugin_action_links_' . $plugin_id, array( - $this, - 'plugins_action_links_not_registered' - ) ); - - if ( $this->should_display_types_upgrade_link( $r_plugin['name'], $plugin['Version'] ) ) { - add_filter( 'plugin_action_links_' . $plugin_id, array( $this, 'types_upgrade_link' ) ); - } - } - - } - - } - - } - - - } - - } - } - - } - - private function should_display_types_upgrade_link( $name, $version ) { - return $name === self::TOOLSET_TYPES && version_compare( $version, '3.0', '<' ); - } - - public function types_upgrade_link( $links ) { - $links[] = '' . __( 'Upgrade', 'installer' ) . ''; - return $links; - } - - public function plugins_action_links_registered( $links ) { - $links[] = '' . __( 'Registered', 'installer' ) . ''; - - return $links; - } - - public function plugins_action_links_not_registered( $links ) { - $links[] = '' . __( 'Register', 'installer' ) . ''; - - return $links; - } - - public function plugin_is_registered( $repository_id, $slug ) { - - $registered = false; - - if ( $this->repository_has_valid_subscription( $repository_id ) ) { - - $subscription_type = $this->get_subscription_type_for_repository( $repository_id ); - $r_plugins = array(); - - foreach ( $this->settings['repositories'][ $repository_id ]['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - //consider equivalent subscriptions - if( !array_key_exists('subscription_type_equivalent', $product) ) { - $product['subscription_type_equivalent'] = ''; - } - - if ( - $product['subscription_type'] === (int) $subscription_type || - (int) $product['subscription_type_equivalent'] === (int) $subscription_type || - $this->have_superior_subscription( $subscription_type, $product ) - ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( ! isset( $rep_plugins[ $download['slug'] ] ) ) { - $r_plugins[ $download['slug'] ] = $download['slug']; - } - - } - - } - - } - - } - - $registered = isset( $r_plugins[ $slug ] ); - - } - - - return $registered; - - } - - public function version() { - return WP_INSTALLER_VERSION; - } - - public function plugin_path() { - return untrailingslashit( plugin_dir_path( dirname( __FILE__ ) ) ); - } - - public function plugin_url() { - if ( isset( $this->config['in_theme_folder'] ) && ! empty( $this->config['in_theme_folder'] ) ) { - $url = untrailingslashit( get_template_directory_uri() . '/' . $this->config['in_theme_folder'] ); - } else { - $url = untrailingslashit( plugins_url( '/', dirname( __FILE__ ) ) ); - } - - return $url; - } - - public function is_repositories_page() { - global $pagenow; - - return $pagenow == 'plugin-install.php' && isset( $_GET['tab'] ) && $_GET['tab'] == 'commercial'; - } - - public function res_url() { - if ( isset( $this->config['in_theme_folder'] ) && ! empty( $this->config['in_theme_folder'] ) ) { - $url = untrailingslashit( get_template_directory_uri() . '/' . $this->config['in_theme_folder'] ); - } else { - $url = $this->plugin_url(); - } - - return $url; - } - - public function save_settings() { - - $_settings = serialize( $this->settings ); - if ( $this->is_gz_on() ) { - $_settings = gzcompress( $_settings ); - } - $_settings = base64_encode( $_settings ); - - update_option( 'wp_installer_settings', $_settings ); - - if ( is_multisite() && is_main_site() && isset( $this->settings['repositories'] ) ) { - $network_settings = array(); - - foreach ( $this->settings['repositories'] as $rep_id => $repository ) { - if ( isset( $repository['subscription'] ) ) { - $network_settings[ $rep_id ] = $repository['subscription']; - } - } - - update_site_option( 'wp_installer_network', $network_settings ); - - - } - - } - - public function get_settings( $refresh = false ) { - - if ( $refresh || empty( $this->settings ) ) { - - $_settings = get_option( 'wp_installer_settings' ); - - - if ( is_array( $_settings ) || empty( $_settings ) ) { //backward compatibility 1.1 - $this->settings = $_settings; - - } else { - $_settings = base64_decode( $_settings ); - if ( $this->is_gz_on() ) { - $_settings = gzuncompress( $_settings ); - } - $this->settings = unserialize( $_settings ); - } - - // Initialize - if ( empty( $this->settings ) ) { - $this->settings = array( - 'repositories' => array() - ); - } - - if ( is_multisite() ) { - $network_settings = maybe_unserialize( get_site_option( 'wp_installer_network' ) ); - if ( $network_settings ) { - foreach ( $this->settings['repositories'] as $rep_id => $repository ) { - if ( isset( $network_settings[ $rep_id ] ) ) { - $this->settings['repositories'][ $rep_id ]['subscription'] = $network_settings[ $rep_id ]; - } - } - } - } - - $this->load_hardcoded_site_keys(); - - $this->_pre_1_8_backwards_compatibility( $this->settings ); - - $this->settings = $this->_old_products_format_backwards_compatibility( $this->settings ); - - } - - return $this->settings; - } - - private function is_gz_on() { - return function_exists( 'gzuncompress' ) && function_exists( 'gzcompress' ); - } - - private function load_hardcoded_site_keys() { - - if ( ! empty( $this->settings['repositories'] ) ) { - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - if ( $site_key = self::get_repository_hardcoded_site_key( $repository_id ) ) { - - $site_key_missing = empty( $this->settings['repositories'][ $repository_id ]['subscription']['data'] ); - $site_key_changed = ! $site_key_missing && - $this->settings['repositories'][ $repository_id ]['subscription']['key'] != $site_key; - - if ( $site_key_missing || $site_key_changed ) { - - if ( ! function_exists( 'get_plugins' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - $this->load_repositories_list(); - $response = $this->save_site_key( - array( - 'repository_id' => $repository_id, - 'site_key' => $site_key, - 'return' => true, - 'nonce' => wp_create_nonce( 'save_site_key_' . $repository_id ) - ) - ); - - if ( ! empty( $response['error'] ) ) { - $this->remove_site_key( $repository_id, false ); - - $this->admin_messages[] = array( - 'type' => 'error', - 'text' => sprintf( __( 'You are using an invalid site key defined as the constant %s (most likely in wp-config.php). - Please remove it or use the correct value in order to be able to register correctly.', 'installer' ), 'OTGS_INSTALLER_SITE_KEY_' . strtoupper( $repository_id ) ) - ); - - } - - } - - } - - } - } - - } - - public static function get_repository_hardcoded_site_key( $repository_id ) { - - $site_key = false; - - $site_key_constant = 'OTGS_INSTALLER_SITE_KEY_' . strtoupper( $repository_id ); - if ( defined( $site_key_constant ) ) { - $site_key = constant( $site_key_constant ); - } - - return $site_key; - } - - //backward compatibility, add channel - private function _pre_1_8_backwards_compatibility( &$settings ) { - if ( empty( $settings['_pre_1_8_clean_up'] ) ) { - foreach ( $settings['repositories'] as $repository_id => $repository ) { - foreach ( $repository['data']['downloads']['plugins'] as $slug => $download ) { - if( !isset( $download['channel'] ) ){ - $settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $slug ]['channel'] = ''; - } - } - } - $this->save_settings(); - } - } - - //backward compatibility - support old products list format (downloads under products instead of global downloads list) - private function _old_products_format_backwards_compatibility( $settings ) { - - if ( version_compare( $this->version(), '1.8', '<' ) && ! empty( $settings['repositories'] ) && empty( $this->_old_products_format_backwards_compatibility ) ) { - - foreach ( $settings['repositories'] as $repository_id => $repository ) { - $populate_downloads = false; - if ( isset( $repository['data'] ) ) { - - foreach ( $repository['data']['packages'] as $package_id => $package ) { - foreach ( $package['products'] as $product_id => $product ) { - if ( ! isset( $product['plugins'] ) ) { - $populate_downloads = true; - foreach ( $product['downloads'] as $download_id => $download ) { - $settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['plugins'][] = $download['slug']; - } - } - } - } - - if ( $populate_downloads ) { - // Add downloads branch - foreach ( $repository['data']['packages'] as $package_id => $package ) { - foreach ( $package['products'] as $product_id => $product ) { - foreach ( $product['downloads'] as $download_id => $download ) { - if ( ! isset( $settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $download['slug'] ] ) ) { - $settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $download['slug'] ] = $download; - } - $settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['plugins'][] = $download['slug']; - } - unset( $settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['downloads'] ); - } - } - } - } - } - - $this->_old_products_format_backwards_compatibility = true; - } - - return $settings; - } - - public function get_installer_site_url( $repository_id = false ) { - global $current_site; - - $site_url = get_site_url(); - - if ( $repository_id && is_multisite() && isset( $this->settings['repositories'] ) ) { - $network_settings = maybe_unserialize( get_site_option( 'wp_installer_network' ) ); - - if ( isset( $network_settings[ $repository_id ] ) ) { - $site_url = get_site_url( $current_site->blog_id ); - } - - } - - return $site_url; - } - - /** - * @param string $repository_id - * - * @return string|null - */ - public function get_registered_site_url( $repository_id ) { - if ( isset( $this->settings['repositories'][ $repository_id ]['subscription']['site_url'] ) ) { - return $this->settings['repositories'][ $repository_id ]['subscription']['site_url']; - } - - return null; - } - - public function show_site_key_nags() { - $screen = get_current_screen(); - - if ( $screen->base == 'settings_page_installer' || ( $screen->base == 'plugin-install' && isset( $_GET['tab'] ) && $_GET['tab'] == 'commercial' ) ) { - return; - } - - if ( ! empty( $this->config['site_key_nags'] ) ) { - - foreach ( $this->config['site_key_nags'] as $nag ) { - - if ( ! $this->repository_has_subscription( $nag['repository_id'] ) ) { - $show = true; - if ( ! empty( $nag['condition_cb'] ) ) { - $show = call_user_func( $nag['condition_cb'] ); - } - - if ( empty( $this->settings['dismissed_nags'][ $nag['repository_id'] ] ) && $show ) { - echo '

'; - printf( __( "To get automatic updates, you need to register %s for this site. %sRegister %s%s", 'sitepress' ), - $nag['product_name'], '', $nag['product_name'], '' ); - - echo '

'; - echo '' . __( 'Dismiss', 'sitepress' ) . ''; - echo '
'; - } - } - - } - - } - - } - - public function dismiss_nag() { - $this->settings['dismissed_nags'][ $_POST['repository'] ] = 1; - - $this->save_settings(); - - echo json_encode( array() ); - exit; - } - - public function add_install_plugins_tab( $tabs ) { - - $tabs['commercial'] = __( 'Commercial', 'installer' ); - - return $tabs; - } - - public function load_repositories_list() { - global $wp_installer_instances; - - foreach ( $wp_installer_instances as $instance ) { - - if ( file_exists( dirname( $instance['bootfile'] ) . '/repositories.xml' ) ) { - $config_file = dirname( $instance['bootfile'] ) . '/repositories.xml'; - - if ( file_exists( dirname( $instance['bootfile'] ) . '/repositories.sandbox.xml' ) ) { - $config_file = dirname( $instance['bootfile'] ) . '/repositories.sandbox.xml'; - add_filter( 'https_ssl_verify', '__return_false' ); - } - - $repos = simplexml_load_file( $config_file ); - - if ( $repos ) { - foreach ( $repos as $repo ) { - $id = strval( $repo->id ); - - $data['api-url'] = strval( $repo->apiurl ); - $data['products'] = strval( $repo->products ); - - // excludes rule; - if ( isset( $this->config['repositories_exclude'] ) && in_array( $id, $this->config['repositories_exclude'] ) ) { - continue; - } - - // includes rule; - if ( isset( $this->config['repositories_include'] ) && ! in_array( $id, $this->config['repositories_include'] ) ) { - continue; - } - - $this->repositories[ $id ] = $data; - - } - } - - } - } - - } - - public function filter_repositories_list() { - - if ( ! empty( $this->settings['repositories'] ) ) { - foreach ( $this->settings['repositories'] as $id => $repo_data ) { - - // excludes rule; - if ( isset( $this->config['repositories_exclude'] ) && in_array( $id, $this->config['repositories_exclude'] ) ) { - unset( $this->settings['repositories'][ $id ] ); - } - - // includes rule; - if ( isset( $this->config['repositories_include'] ) && ! in_array( $id, $this->config['repositories_include'] ) ) { - unset( $this->settings['repositories'][ $id ] ); - } - - - } - } - - - } - - public function refresh_repositories_data() { - static $checked = false; - - if ( defined( 'OTGS_DISABLE_AUTO_UPDATES' ) && OTGS_DISABLE_AUTO_UPDATES && empty( $_GET['force-check'] ) || $checked ) { - - if ( empty( $this->settings['repositories'] ) && $this->is_repositories_page() ) { - - foreach ( $this->repositories as $id => $data ) { - $repository_names[] = $id; - - } - - $error = sprintf( __( "Installer cannot display the products information because the automatic updating for %s was explicitly disabled with the configuration below (usually in wp-config.php):", 'installer' ), strtoupper( join( ', ', $repository_names ) ) ); - $error .= '

define("OTGS_DISABLE_AUTO_UPDATES", true);

'; - $error .= sprintf( __( "In order to see the products information, please run the %smanual updates check%s to initialize the products list or (temporarily) remove the above code.", 'installer' ), '', '' ); - - $this->register_admin_message( $error, 'error' ); - - - } - - return; - } - - $checked = true; - - foreach ( $this->repositories as $id => $data ) { - - $response = wp_remote_get( $data['products'] ); - - if ( is_wp_error( $response ) ) { - // http fallback - $data['products'] = preg_replace( "@^https://@", 'http://', $data['products'] ); - $response = wp_remote_get( $data['products'] ); - } - - if ( is_wp_error( $response ) ) { - - $error = sprintf( __( "Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:", 'installer' ), strtoupper( $id ) ); - $error .= '

define("OTGS_DISABLE_AUTO_UPDATES", true);'; - - $this->register_admin_message( $error, 'error' ); - - continue; - } - - if ( $response && isset( $response['response']['code'] ) && $response['response']['code'] == 200 ) { - $body = wp_remote_retrieve_body( $response ); - if ( $body ) { - $products = json_decode( $body, true ); - - if ( is_array( $products ) ) { - $products['downloads'] = WP_Installer_Channels()->filter_downloads_by_channel( $id, $products['downloads'] ); - $this->set_release_notes( $products['downloads'] ); - - $this->settings['repositories'][ $id ]['data'] = $products; - $this->_pre_1_8_backwards_compatibility( $this->settings ); - } - } - - } - - $this->log( sprintf( "Checked for %s updates: %s", $id, $data['products'] ) ); - - - } - - // cleanup - if ( empty( $this->settings['repositories'] ) ) { - $this->settings['repositories'] = array(); - } - foreach ( $this->settings['repositories'] as $id => $data ) { - if ( ! in_array( $id, array_keys( $this->repositories ) ) ) { - unset( $this->settings['repositories'][ $id ] ); - } - } - - $this->settings['last_repositories_update'] = time(); - - $this->save_settings(); - - } - - /** - * Gets the release notes for the available version from the changelog - * - * @param array $all_downloads - */ - private function set_release_notes( &$all_downloads ) { - foreach ( $all_downloads as $kind => $downloads ) { - foreach ( $downloads as $slug => $download ) { - $start = strpos( $download['changelog'], '

' . $download['version'] . '

' ); - if ( $start !== false ) { - $start += strlen( $download['version'] ) + 9; - $end = strpos( $download['changelog'], '

', 4 ); - if ( $end ) { - $release_notes = substr( $download['changelog'], $start, $end - $start ); - } else { - $release_notes = substr( $download['changelog'], $start ); - } - } - $all_downloads[ $kind ][ $slug ]['release-notes'] = ! empty( $release_notes ) ? $release_notes : ''; - } - } - } - - public function show_products( $args = array() ) { - - $screen = get_current_screen(); - - if ( $screen->base == 'settings_page_installer' ) { // settings page - echo '
'; - echo '

' . __( 'Installer', 'installer' ) . '

'; - echo '
'; - } - - if ( ! is_array( $args ) ) { - $args = array(); - } - if ( empty( $args['template'] ) ) { - $args['template'] = 'default'; - } - - $this->filter_repositories_list(); - - if ( ! empty( $this->settings['repositories'] ) ) { - - $this->localize_strings(); - $this->set_filtered_prices( $args ); - $this->set_hierarchy_and_order(); - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - if ( $args['template'] == 'compact' ) { - - if ( isset( $args['repository'] ) && $args['repository'] == $repository_id ) { - include $this->plugin_path() . '/templates/products-compact.php'; - } - - } else { - - include $this->plugin_path() . '/templates/repository-listing.php'; - - } - - unset( $site_key, $subscription_type, $expired, $upgrade_options, $products_avaliable ); - - } - - } else { - - echo '
' . __( 'No repositories defined.', 'installer' ) . '
'; - - } - - if ( $screen->base == 'settings_page_installer' ) { // settings page - echo '
'; - } - - - } - - public function get_product_price( $repository_id, $package_id, $product_id, $incl_discount = false ) { - - $price = false; - - foreach ( $this->settings['repositories'][ $repository_id ]['data']['packages'] as $package ) { - - if ( $package['id'] == $package_id ) { - if ( isset( $package['products'][ $product_id ] ) ) { - if ( $incl_discount && isset( $package['products'][ $product_id ]['price_disc'] ) ) { - $price = $package['products'][ $product_id ]['price_disc']; - } elseif ( isset( $package['products'][ $product_id ]['price'] ) ) { - $price = $package['products'][ $product_id ]['price']; - } - } - break; - } - } - - return $price; - } - - private function _render_product_packages( $packages, $subscription_type, $expired, $upgrade_options, $repository_id ) { - - $data = array(); - - foreach ( $packages as $package_id => $package ) { - - $row = array( 'products' => array(), 'downloads' => array() ); - foreach ( $package['products'] as $product ) { - - // filter out free subscriptions from being displayed as buying options - if ( empty( $product['price'] ) && ( empty( $subscription_type ) || $expired ) ) { - continue; - } - - //consider equivalent subscriptions - if ( empty( $product['subscription_type_equivalent'] ) ) { - $product['subscription_type_equivalent'] = ''; - } - - // buy base - if ( empty( $subscription_type ) || $expired ) { - - $p['url'] = $this->append_parameters_to_buy_url( $product['url'], $repository_id ); - if ( ! empty( $product['price_disc'] ) ) { - $p['label'] = $product['call2action'] . ' - ' . sprintf( '$%s %s$%d%s (USD)', $product['price_disc'], '  ', $product['price'], '' ); - } else { - $p['label'] = $product['call2action'] . ' - ' . sprintf( '$%d (USD)', $product['price'] ); - } - $row['products'][] = $p; - - // renew - } elseif ( isset( $subscription_type ) && ( $product['subscription_type'] == $subscription_type || $product['subscription_type_equivalent'] == $subscription_type ) ) { - - if ( $product['renewals'] ) { - foreach ( $product['renewals'] as $renewal ) { - $p['url'] = $this->append_parameters_to_buy_url( $renewal['url'], $repository_id ); - $p['label'] = $renewal['call2action'] . ' - ' . sprintf( '$%d (USD)', $renewal['price'] ); - } - - $row['products'][] = $p; - } - - } - - // upgrades - if ( ! empty( $upgrade_options[ $product['subscription_type'] ] ) ) { - - foreach ( $upgrade_options[ $product['subscription_type'] ] as $stype => $upgrade ) { - if ( $stype != $subscription_type ) { - continue; - } - - $p['url'] = $this->append_parameters_to_buy_url( $upgrade['url'], $repository_id ); - if ( ! empty( $upgrade['price_disc'] ) ) { - $p['label'] = $upgrade['call2action'] . ' - ' . sprintf( '$%s %s$%d%s (USD)', $upgrade['price_disc'], '  ', $upgrade['price'], '' ); - } else { - $p['label'] = $upgrade['call2action'] . ' - ' . sprintf( '$%d (USD)', $upgrade['price'] ); - } - $row['products'][] = $p; - - } - - } - - // downloads - if ( isset( $subscription_type ) && ! $expired && ( $product['subscription_type'] == $subscription_type || $product['subscription_type_equivalent'] == $subscription_type ) ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - $row['downloads'][ $plugin_slug ] = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - } - - } - - //subpackages - if ( ! empty( $package['sub-packages'] ) ) { - $row['sub-packages'] = $package['sub-packages']; - } - - } - - $row['id'] = $package['id']; - $row['image_url'] = $package['image_url']; - $row['name'] = $package['name']; - $row['description'] = $package['description']; - - if ( ! empty( $row['products'] ) || ! empty( $row['downloads'] ) || ! empty( $row['sub-packages'] ) ) { - $data[] = $row; - } - - - } - - return $data; - - } - - public function get_extra_url_parameters() { - - $parameters = array(); - - if ( ! empty( $this->package_source ) ) { - foreach ( $this->package_source as $key => $val ) { - $parameters[ $key ] = $val; - } - } - - $parameters['installer_version'] = WP_INSTALLER_VERSION; - $parameters['theme'] = wp_get_theme()->get( 'Name' ); - $parameters['site_name'] = get_bloginfo( 'name' ); - - return $parameters; - } - - public function append_parameters_to_buy_url( $url, $repository_id, $args = array() ) { - - $url = add_query_arg( array( 'icl_site_url' => $this->get_installer_site_url( $repository_id ) ), $url ); - - $affiliate_id = false; - $affiliate_key = false; - - // Add extra parameters for custom Installer packages - if ( ! empty( $this->package_source ) ) { - $extra = $this->get_extra_url_parameters(); - - if ( ! empty( $extra['repository'] ) && $extra['repository'] == $repository_id ) { - - if ( ! empty( $extra['affiliate_key'] ) && ! empty( $extra['user_id'] ) ) { - $this->config[ 'affiliate_id:' . $repository_id ] = $extra['user_id']; - $this->config[ 'affiliate_key:' . $repository_id ] = $extra['affiliate_key']; - unset( $extra['affiliate_key'], $extra['user_id'], $extra['repository'] ); // no need to include these ones - } - - $url = add_query_arg( $extra, $url ); - } - - } - - if ( isset( $this->config[ 'affiliate_id:' . $repository_id ] ) && isset( $this->config[ 'affiliate_key:' . $repository_id ] ) ) { - - $affiliate_id = $this->config[ 'affiliate_id:' . $repository_id ]; - $affiliate_key = $this->config[ 'affiliate_key:' . $repository_id ]; - - } elseif ( isset( $args[ 'affiliate_id:' . $repository_id ] ) && isset( $args[ 'affiliate_key:' . $repository_id ] ) ) { - - $affiliate_id = $args[ 'affiliate_id:' . $repository_id ]; - $affiliate_key = $args[ 'affiliate_key:' . $repository_id ]; - - } elseif ( defined( 'ICL_AFFILIATE_ID' ) && defined( 'ICL_AFFILIATE_KEY' ) ) { //support for 1 repo - - $affiliate_id = ICL_AFFILIATE_ID; - $affiliate_key = ICL_AFFILIATE_KEY; - - } elseif ( isset( $this->config['affiliate_id'] ) && isset( $this->config['affiliate_key'] ) ) { - // BACKWARDS COMPATIBILITY - $affiliate_id = $this->config['affiliate_id']; - $affiliate_key = $this->config['affiliate_key']; - } - - if ( $affiliate_id && $affiliate_key ) { - $url = add_query_arg( array( 'aid' => $affiliate_id, 'affiliate_key' => $affiliate_key ), $url ); - } - - if ( $repository_id == 'wpml' ) { - $url = add_query_arg( array( - 'using_icl' => $this->_using_icl, - 'wpml_version' => $this->_wpml_version - ), $url ); - } - - $url = apply_filters( 'wp_installer_buy_url', $url ); - - $url = esc_url( $url ); - - return $url; - - } - - /** - * @return OTGS_Installer_WP_Share_Local_Components_Setting - */ - private function get_component_setting() { - if ( ! $this->components_setting ) { - $this->components_setting = new OTGS_Installer_WP_Share_Local_Components_Setting(); - } - - return $this->components_setting; - } - - public function save_site_key( $args = array() ) { - - $error = ''; - - if ( isset( $args['repository_id'] ) ) { - $repository_id = $args['repository_id']; - } elseif ( isset( $_POST['repository_id'] ) ) { - $repository_id = sanitize_text_field( $_POST['repository_id'] ); - } else { - $repository_id = false; - } - - if ( isset( $args['nonce'] ) ) { - $nonce = $args['nonce']; - } elseif ( isset( $_POST['nonce'] ) ) { - $nonce = sanitize_text_field( $_POST['nonce'] ); - } else { - $nonce = ''; - } - - if ( isset( $args['site_key'] ) ) { - $site_key = $args['site_key']; - } else { - $site_key = sanitize_text_field( $_POST[ 'site_key_' . $repository_id ] ); - } - $site_key = preg_replace( "/[^A-Za-z0-9]/", '', $site_key ); - - if ( $repository_id && $nonce && wp_create_nonce( 'save_site_key_' . $repository_id ) === $nonce ) { - - try { - $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REGISTRATION ); - - if ( $subscription_data ) { - $this->settings['repositories'][ $repository_id ]['subscription'] = array( - 'key' => $site_key, - 'data' => $subscription_data, - 'registered_by' => get_current_user_id(), - 'site_url' => get_site_url(), - ); - $this->save_settings(); - } else { - $error = __( 'Invalid site key for the current site.', 'installer' ) - . '
' . __( 'Please note that the site key is case sensitive.', 'installer' ) . '
'; - } - - } catch ( Exception $e ) { - $error = $e->getMessage(); - if ( preg_match( '#Could not resolve host: (.*)#', $error, $matches ) || preg_match( '#Couldn\'t resolve host \'(.*)\'#', $error, $matches ) ) { - $error = sprintf( __( "%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer' ), - '' . $this->get_generic_product_name( $repository_id ) . '', - '' . $matches[1] . '' - ); - } - } - - } - - $return = array( 'error' => $error ); - - if ( $this->api_debug ) { - $return['debug'] = $this->api_debug; - } - - if ( ! empty( $args['return'] ) ) { - return $return; - } else { - echo json_encode( $return ); - exit; - } - - } - - /** - * Alias for WP_Installer::get_repository_site_key - * @see WP_Installer::get_repository_site_key() - * - * @param string $repository_id - * - * @return string (site key) or bool - */ - public function get_site_key( $repository_id ) { - return WP_Installer::get_repository_site_key( $repository_id ); - } - - public function remove_site_key( $repository_id, $refresh_repositories_data = true ) { - if ( isset( $this->settings['repositories'][ $repository_id ] ) ) { - unset( $this->settings['repositories'][ $repository_id ]['subscription'] ); - $this->save_settings(); - if( $refresh_repositories_data ){ - $this->refresh_repositories_data(); - } - } - } - - public function remove_site_key_ajax() { - if ( $_POST['nonce'] == wp_create_nonce( 'remove_site_key_' . $_POST['repository_id'] ) ) { - $this->remove_site_key( $_POST['repository_id'] ); - } - exit; - } - - public function validate_repository_subscription() { - $repository_id = isset( $_GET['validate_repository'] ) ? sanitize_text_field( $_GET['validate_repository'] ) : false; - if ( $repository_id ) { - - $site_key = $this->get_site_key( $repository_id ); - if ( $site_key ) { - try { - $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REVALIDATION ); - } catch ( Exception $e ) { - $subscription_data = false; - } - - if ( empty( $subscription_data ) ) { - unset( $this->settings['repositories'][ $repository_id ]['subscription'] ); - delete_site_transient( 'update_plugins' ); - $this->save_settings(); - } - } - - wp_redirect( $this->menu_url() . '#repository-' . $repository_id ); - exit; - - } - - } - - public function update_site_key() { - - $error = ''; - - $repository_id = sanitize_text_field( $_POST['repository_id'] ); - if ( $_POST['nonce'] == wp_create_nonce( 'update_site_key_' . $repository_id ) ) { - - $site_key = $this->get_site_key( $_POST['repository_id'] ); - - if ( $site_key ) { - try { - $subscription_data = $this->fetch_subscription_data( $repository_id, $site_key, self::SITE_KEY_VALIDATION_SOURCE_UPDATES_CHECK ); - - if ( $subscription_data ) { - $this->settings['repositories'][ $repository_id ]['subscription'] = array( - 'key' => $site_key, - 'data' => $subscription_data, - 'registered_by' => get_current_user_id() - ); - - //also refresh products information - $this->refresh_repositories_data(); - - $this->save_settings(); - - } else { - unset( $this->settings['repositories'][ $repository_id ]['subscription'] ); - $error = __( 'Invalid site key for the current site. If the error persists, try to unregister first and then register again with the same site key.', 'installer' ); - } - - - } catch ( Exception $e ) { - $error = $e->getMessage(); - if ( preg_match( '#Could not resolve host: (.*)#', $error, $matches ) || preg_match( '#Couldn\'t resolve host \'(.*)\'#', $error, $matches ) ) { - $error = sprintf( __( "%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates.", 'installer' ), - '' . $this->get_generic_product_name( $repository_id ) . '', - '' . $matches[1] . '' - ); - } - } - - } - - } - - echo json_encode( array( 'error' => $error ) ); - - exit; - } - - public function api_debug_log( $text ) { - - if ( defined( 'WPML_DEBUG_INSTALLER' ) && WPML_DEBUG_INSTALLER ) { - - if ( ! is_scalar( $text ) ) { - $text = print_r( $text, 1 ); - } - - $this->api_debug .= $text . "\n"; - - } - - } - - public function fetch_subscription_data( $repository_id, $site_key, $source = self::SITE_KEY_VALIDATION_SOURCE_OTHER ) { - - $subscription_data = false; - - $args['body'] = array( - 'action' => 'site_key_validation', - 'site_key' => $site_key, - 'site_url' => $this->get_installer_site_url( $repository_id ), - 'source' => $source - ); - - if ( $repository_id == 'wpml' ) { - $args['body']['using_icl'] = $this->_using_icl; - $args['body']['wpml_version'] = $this->_wpml_version; - } - - $args['body']['installer_version'] = WP_INSTALLER_VERSION; - $args['body']['theme'] = wp_get_theme()->get( 'Name' ); - $args['body']['site_name'] = get_bloginfo( 'name' ); - $args['body']['repository_id'] = $repository_id; - - $args['body']['versions'] = $this->get_local_product_versions( $repository_id ); - - $args['timeout'] = 45; - - // Add extra parameters for custom Installer packages - if ( ! empty( $this->package_source ) ) { - $extra = $this->get_extra_url_parameters(); - if ( ! empty( $extra['repository'] ) && $extra['repository'] == $repository_id ) { - unset( $extra['repository'] ); - foreach ( $extra as $key => $val ) { - $args['body'][ $key ] = $val; - } - } - } - - $response = wp_remote_post( - $this->repositories[ $repository_id ]['api-url'], - apply_filters( 'installer_fetch_subscription_data_request', $args ) - ); - - $this->api_debug_log( "POST {$this->repositories[$repository_id]['api-url']}" ); - $this->api_debug_log( $args ); - - $this->log( "POST {$this->repositories[$repository_id]['api-url']} - fetch subscription data" ); - - if ( ! is_wp_error( $response ) ) { - $datas = trim ( wp_remote_retrieve_body( $response ) ); - - if ( is_serialized( $datas ) ) { - $data = unserialize( $datas ); - $this->api_debug_log( $data ); - - if ( ! empty( $data->subscription_data ) ) { - $subscription_data = $data->subscription_data; - } - - do_action( 'installer_fetched_subscription_data', $data, $repository_id ); - - } else { - $this->api_debug_log( $datas ); - } - - } else { - - $this->api_debug_log( $response ); - throw new Exception( $response->get_error_message() ); - } - - return $subscription_data; - - } - - function get_local_product_versions( $repository_id ) { - - $versions = array(); - - foreach ( $this->settings['repositories'][ $repository_id ]['data']['packages'] as $package_id => $package ) { - - foreach ( $package['products'] as $product_id => $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( empty( $versions[ $download['slug'] ] ) ) { - $v = $this->get_plugin_installed_version( $download['name'], $download['slug'] ); - if ( $v ) { - $versions[ $download['slug'] ] = $v; - } - } - - } - - } - - } - - return $versions; - } - - public function get_repository_site_key( $repository_id ) { - $site_key = false; - - if ( ! empty( $this->settings['repositories'][ $repository_id ]['subscription']['key'] ) ) { - $site_key = $this->settings['repositories'][ $repository_id ]['subscription']['key']; - } - - return $site_key; - } - - /** - * @param $repository_id - * - * @return OTGS_Installer_Subscription - */ - public function get_subscription( $repository_id ) { - $data = null; - if ( ! empty( $this->settings['repositories'][ $repository_id ]['subscription'] ) ) { - $data = $this->settings['repositories'][ $repository_id ]['subscription']['data']; - } - - return new OTGS_Installer_Subscription( $data ); - } - - public function repository_has_valid_subscription( $repository_id ) { - $subscription = $this->get_subscription( $repository_id ); - - return $subscription->is_valid(); - } - - public function repository_has_subscription( $repository_id ) { - $key = false; - if ( ! empty( $this->settings['repositories'][ $repository_id ]['subscription']['key'] ) ) { - $key = $this->settings['repositories'][ $repository_id ]['subscription']['key']; - } - - return $key; - } - - public function repository_has_expired_subscription( $repository_id ) { - - return $this->repository_has_subscription( $repository_id ) && ! $this->repository_has_valid_subscription( $repository_id ); - - } - - public function get_generic_product_name( $repository_id ) { - - return $this->settings['repositories'][ $repository_id ]['data']['product-name']; - - } - - public function show_subscription_renew_warning( $repository_id, $subscription_id ) { - - $show = false; - - $data = $this->settings['repositories'][ $repository_id ]['data']; - if ( ! empty( $data['subscriptions_meta'] ) ) { - if ( isset( $data['subscriptions_meta']['expiration'] ) ) { - - if ( ! empty( $data['subscriptions_meta']['expiration'][ $subscription_id ] ) ) { - - $days = $data['subscriptions_meta']['expiration'][ $subscription_id ]['days_warning']; - $message = $data['subscriptions_meta']['expiration'][ $subscription_id ]['warning_message']; - - } else { - - //defaults - $days = 30; - $message = __( 'You will have to renew your subscription in order to continue getting the updates and support.', 'installer' ); - - } - - if ( ! empty( $this->settings['repositories'][ $repository_id ]['subscription'] ) ) { - $subscription = $this->settings['repositories'][ $repository_id ]['subscription']; - - if ( $subscription['data']->subscription_type == $subscription_id && ! empty( $subscription['data']->expires ) ) { - - if ( strtotime( $subscription['data']->expires ) < strtotime( sprintf( "+%d day", $days ) ) ) { - - $days_to_expiration = ceil( ( strtotime( $subscription['data']->expires ) - time() ) / 86400 ); - - echo '

' . - sprintf( _n( 'Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer' ), $days_to_expiration ) . - '
' . $message . - '

'; - - $show = true; - - } - - } - - } - - - } - } - - - return $show; - - } - - public function setup_plugins_renew_warnings() { - - $plugins = get_plugins(); - - $subscriptions_with_warnings = array(); - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - if ( $this->repository_has_valid_subscription( $repository_id ) ) { - $subscription_type = $this->settings['repositories'][ $repository_id ]['subscription']['data']->subscription_type; - $expires = $this->settings['repositories'][ $repository_id ]['subscription']['data']->expires; - - $never_expires = isset( $this->settings['repositories'][ $repository_id ]['subscription'] ) - && empty( $this->settings['repositories'][ $repository_id ]['subscription']['data']->expires ) - && ( - (int) $this->settings['repositories'][ $repository_id ]['subscription']['data']->status === OTGS_Installer_Subscription::SUBSCRIPTION_STATUS_ACTIVE_NO_EXPIRATION || - (int) $this->settings['repositories'][ $repository_id ]['subscription']['data']->status === OTGS_Installer_Subscription::SUBSCRIPTION_STATUS_ACTIVE - ); - - if ( ! $never_expires ) { - if ( isset( $this->settings['repositories'][ $repository_id ]['data']['subscriptions_meta']['expiration'][ $subscription_type ] ) ) { - - $days_warning = $this->settings['repositories'][ $repository_id ]['data']['subscriptions_meta']['expiration'][ $subscription_type ]['days_warning']; - $custom_message = $this->settings['repositories'][ $repository_id ]['data']['subscriptions_meta']['expiration'][ $subscription_type ]['warning_message']; - - } else { - //defaults - $days_warning = 30; - $custom_message = __( 'You will have to renew your subscription in order to continue getting the updates and support.', 'installer' ); - } - - if ( strtotime( $expires ) < strtotime( sprintf( '+%d day', $days_warning ) ) ) { - - $days_to_expiration = ceil( ( strtotime( $expires ) - time() ) / 86400 ); - - $message = sprintf( _n( 'Your subscription expires in %d day.', 'Your subscription expires in %d days.', $days_to_expiration, 'installer' ), $days_to_expiration ); - $subscriptions_with_warnings[ $subscription_type ] = $message . ' ' . $custom_message; - - } - } - - } - - } - - - foreach ( $plugins as $plugin_id => $plugin ) { - - $slug = dirname( $plugin_id ); - if ( empty( $slug ) ) { - continue; - } - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - if ( $this->repository_has_valid_subscription( $repository_id ) ) { - - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( $download['slug'] == $slug || $download['name'] == $plugin['Name'] || $download['name'] == $plugin['Title'] ) { //match order: slug, name, title - - if ( isset( $subscriptions_with_warnings[ $product['subscription_type'] ] ) ) { - - $this->_plugins_renew_warnings[ $plugin_id ] = $subscriptions_with_warnings[ $product['subscription_type'] ]; - - } - - } - - } - - } - - } - - } - - } - - } - - } - - public function queue_plugins_renew_warnings() { - - if ( ! empty( $this->_plugins_renew_warnings ) ) { - - foreach ( $this->_plugins_renew_warnings as $plugin_id => $message ) { - - add_action( "after_plugin_row_" . $plugin_id, array( $this, 'plugins_renew_warning' ), 10, 3 ); - } - - } - - } - - public function plugins_renew_warning( $plugin_file, $plugin_data, $status ) { - - if ( empty( $this->_plugins_renew_warnings[ $plugin_file ] ) ) { - return; - } - - $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); - ?> - - - -
- _plugins_renew_warnings[ $plugin_file ] . ' '; - printf( __( '%sRenew here%s.', 'installer' ), - '', '' ); - ?> -
- - - settings['repositories'][ $repository_id ]['subscription'] ) ) { - $subscription_type = $this->settings['repositories'][ $repository_id ]['subscription']['data']->subscription_type; - } - - return $subscription_type; - - } - - public function have_superior_subscription( $subscription_type, $product ) { - - $have = false; - - if ( is_array( $product['upgrades'] ) ) { - foreach ( $product['upgrades'] as $u ) { - if ( $u['subscription_type'] == $subscription_type ) { - $have = true; - break; - } - } - } - - return $have; - } - - public function is_product_available_for_download( $product_name, $repository_id ) { - - $available = false; - - $subscription_type = $this->get_subscription_type_for_repository( $repository_id ); - $expired = $this->repository_has_expired_subscription( $repository_id ); - - if ( ! $expired && $this->repository_has_subscription( $repository_id ) ) { - - $this->set_hierarchy_and_order(); - - foreach ( $this->settings['repositories'][ $repository_id ]['data']['packages'] as $package_id => $package ) { - - $has_top_package = false; - - foreach ( $package['products'] as $product ) { - - if ( $subscription_type == $product['subscription_type'] ) { - $has_top_package = true; - if ( $product['name'] == $product_name ) { - return $available = true; - } - } - - } - - if ( ! empty( $package['sub-packages'] ) ) { - foreach ( $package['sub-packages'] as $sub_package ) { - foreach ( $sub_package['products'] as $product ) { - if ( $product['name'] == $product_name && ( $subscription_type == $product['subscription_type'] || $has_top_package ) ) { - return $available = true; - } - } - } - } - - } - } - - return $available; - - } - - public function get_upgrade_options( $repository_id ) { - $all_upgrades = array(); - - - //get all products: packages and subpackages - $all_products = array(); - foreach ( $this->settings['repositories'][ $repository_id ]['data']['packages'] as $package ) { - foreach ( $package['products'] as $product ) { - $all_products[] = $product; - } - if ( ! empty( $package['sub-packages'] ) ) { - foreach ( $package['sub-packages'] as $subpackage ) { - foreach ( $subpackage['products'] as $product ) { - $all_products[] = $product; - } - - } - - } - - } - - foreach ( $all_products as $product ) { - if ( $product['upgrades'] ) { - foreach ( $product['upgrades'] as $upgrade ) { - if ( $this->repository_has_valid_subscription( $repository_id ) || ( $this->repository_has_subscription( $repository_id ) && $upgrade['including_expired'] ) ) { - $all_upgrades[ $upgrade['subscription_type'] ][ $product['subscription_type'] ] = $upgrade; - } - } - } - } - - return $all_upgrades; - - } - - public function append_site_key_to_download_url( $url, $key, $repository_id ) { - - $url_params['site_key'] = $key; - $url_params['site_url'] = $this->get_installer_site_url( $repository_id ); - - - // Add extra parameters for custom Installer packages - if ( ! empty( $this->package_source ) ) { - $extra = $this->get_extra_url_parameters(); - if ( ! empty( $extra['repository'] ) && $extra['repository'] == $repository_id ) { - unset( $extra['repository'] ); - foreach ( $extra as $key => $val ) { - $url_params[ $key ] = $val; - } - } - } - - $url = add_query_arg( $url_params, $url ); - - if ( $repository_id == 'wpml' ) { - $url = add_query_arg( array( - 'using_icl' => $this->_using_icl, - 'wpml_version' => $this->_wpml_version - ), $url ); - } - - return $url; - - } - - public function plugin_is_installed( $name, $slug, $version = null ) { - - $is = false; - - $plugins = get_plugins(); - - foreach ( $plugins as $plugin_id => $plugin ) { - - $wp_plugin_slug = dirname( $plugin_id ); - - // Exception: embedded plugins - if ( $wp_plugin_slug == $slug || $plugin['Name'] == $name || $plugin['Title'] == $name || ( $wp_plugin_slug == $slug . '-embedded' || $plugin['Name'] == $name . ' Embedded' ) ) { - if ( $version ) { - if ( version_compare( $plugin['Version'], $version, '>=' ) ) { - $is = $plugin['Version']; - } - } else { - $is = $plugin['Version']; - } - - break; - } - - } - - //exception: Types name difference - if ( ! $is && $name == 'Types' ) { - return $this->plugin_is_installed( 'Types - Complete Solution for Custom Fields and Types', $slug, $version ); - } - - return $is; - } - - public function plugin_is_embedded_version( $name, $slug ) { - $is = false; - - $plugins = get_plugins(); - - //false if teh full version is also installed - $is_full_installed = false; - foreach ( $plugins as $plugin_id => $plugin ) { - - if ( ( $plugin['Name'] == $name && ! preg_match( "#-embedded$#", $slug ) ) ) { - $is_full_installed = true; - break; - } - - } - - if ( $is_full_installed ) { - return false; - } - - foreach ( $plugins as $plugin_id => $plugin ) { - - // TBD - $wp_plugin_slug = dirname( $plugin_id ); - if ( $wp_plugin_slug == $slug . '-embedded' && $plugin['Name'] == $name . ' Embedded' ) { - $is = true; - break; - } - - } - - return $is; - - } - - //Alias for plugin_is_installed - public function get_plugin_installed_version( $name, $slug ) { - - return $this->plugin_is_installed( $name, $slug ); - - } - - public function get_plugin_repository_version( $repository_id, $slug ) { - $version = false; - - if ( ! empty( $this->settings['repositories'][ $repository_id ]['data']['packages'] ) ) { - foreach ( $this->settings['repositories'][ $repository_id ]['data']['packages'] as $package ) { - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( $download['slug'] == $slug ) { - $version = $download['version']; - break ( 3 ); - } - - } - - } - } - } - - return $version; - } - - public function is_uploading_allowed() { - - //_deprecated_function ( __FUNCTION__, '1.7.3', 'Installer_Dependencies::' . __FUNCTION__ ); - return $this->dependencies->is_uploading_allowed(); - - } - - public function download_plugin_ajax_handler() { - - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - require_once $this->plugin_path() . '/includes/class-installer-upgrader-skins.php'; - - $data = json_decode( base64_decode( sanitize_text_field( $_POST['data'] ) ), true ); - - $ret = false; - $plugin_id = false; - $message = ''; - $connection_error = false; - - //validate subscription - $site_key = $this->get_repository_site_key($data['repository_id']); - try { - $subscription_data = $this->fetch_subscription_data( $data['repository_id'], $site_key, self::SITE_KEY_VALIDATION_SOURCE_DOWNLOAD_REPORT ); - } catch ( Exception $e ) { - $connection_error = $e->getMessage(); - $subscription_data = false; - } - - if ( $subscription_data && ! is_wp_error( $subscription_data ) && $this->repository_has_valid_subscription( $data['repository_id'] ) ) { - - if ( $data['nonce'] == wp_create_nonce( 'install_plugin_' . $data['url'] ) ) { - - $upgrader_skins = new Installer_Upgrader_Skins(); //use our custom (mute) Skin - $upgrader = new Plugin_Upgrader( $upgrader_skins ); - - remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); - - $plugins = get_plugins(); - - //upgrade or install? - foreach ( $plugins as $id => $plugin ) { - $wp_plugin_slug = dirname( $id ); - $is_embedded = $this->plugin_is_embedded_version( preg_replace( '/ Embedded$/', '', $plugin['Name'] ), preg_replace( '/-embedded$/', '', $wp_plugin_slug ) ); - - if ( $wp_plugin_slug == $data['slug'] || $is_embedded && preg_replace( '/-embedded$/', '', $wp_plugin_slug ) == $data['slug'] ) { - $plugin_id = $id; - break; - } - } - - if ( $plugin_id && empty( $is_embedded ) ) { //upgrade - $response['upgrade'] = 1; - - $plugin_is_active = is_plugin_active( $plugin_id ); - - $ret = $upgrader->upgrade( $plugin_id ); - - if ( ! $ret && ! empty( $upgrader->skin->installer_error ) ) { - if ( is_wp_error( $upgrader->skin->installer_error ) ) { - $message = $upgrader->skin->installer_error->get_error_message() . - ' (' . $upgrader->skin->installer_error->get_error_data() . ')'; - } - $plugin_version = 0; - }else{ - if ( $plugin_is_active ) { - //prevent redirects - add_filter( 'wp_redirect', '__return_false' ); - activate_plugin( $plugin_id ); - } - $plugin_version = $this->get_plugin_repository_version( $data['repository_id'], $data['slug'] ); - } - - } else { //install - - if ( $is_embedded ) { - delete_plugins( array( $plugin_id ) ); - } - - $response['install'] = 1; - $ret = $upgrader->install( $data['url'] ); - if ( ! $ret && ! empty( $upgrader->skin->installer_error ) ) { - if ( is_wp_error( $upgrader->skin->installer_error ) ) { - $message = $upgrader->skin->installer_error->get_error_message() . - ' (' . $upgrader->skin->installer_error->get_error_data() . ')'; - } - } - } - - $plugins = get_plugins(); //read again - - if ( $ret ) { - foreach ( $plugins as $id => $plugin ) { - $wp_plugin_slug = dirname( $id ); - if ( $wp_plugin_slug == $data['slug'] ) { - $plugin_version = $plugin['Version']; - $plugin_id = $id; - break; - } - } - - } - - if( WP_Installer_Channels()->get_channel( $data['repository_id'] ) !== WP_Installer_Channels::CHANNEL_PRODUCTION ){ - $download = $this->settings['repositories'][$data['repository_id']]['data']['downloads']['plugins'][$data['slug']]; - $non_stable = WP_Installer_Channels()->get_download_source_channel( $plugin_version, $data['repository_id'], $download['slug'], 'plugins' ); - } - - } - - } elseif ( $connection_error ) { - $ret = false; - $message = sprintf( __( 'Connection failed! Please refresh the page and try again. (%s)', 'installer' ), '' . $connection_error . '' ); - } else { //subscription not valid - $ret = false; - $message = __( 'Your subscription appears to no longer be valid. Please try to register again using a valid site key.', 'installer' ); - } - - $response['version'] = isset( $plugin_version ) ? $plugin_version : 0; - $response['non_stable']= isset( $non_stable ) ? $non_stable : ''; - $response['plugin_id'] = $plugin_id; - $response['nonce'] = wp_create_nonce( 'activate_' . $plugin_id ); - $response['success'] = $ret; - $response['message'] = $message; - - echo json_encode( $response ); - exit; - - } - - public function download_plugin( $slug, $url ) { - - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - require_once $this->plugin_path() . '/includes/class-installer-upgrader-skins.php'; - - $upgrader_skins = new Installer_Upgrader_Skins(); //use our custom (mute) Skin - $upgrader = new Plugin_Upgrader( $upgrader_skins ); - - remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); - - $plugins = get_plugins(); - - $plugin_id = false; - - //upgrade or install? - foreach ( $plugins as $id => $plugin ) { - $wp_plugin_slug = dirname( $id ); - if ( $wp_plugin_slug == $slug ) { - $plugin_id = $id; - break; - } - } - - if ( $plugin_id ) { //upgrade - - $plugin_is_active = is_plugin_active( $plugin_id ); - - $ret = $upgrader->upgrade( $plugin_id ); - - if ( $plugin_is_active ) { - activate_plugin( $plugin_id ); - } - - } else { //install - $ret = $upgrader->install( $url ); - } - - return $ret; - - } - - public function activate_plugin() { - - $error = ''; - - $plugin_id = sanitize_text_field( $_POST['plugin_id'] ); - if ( isset( $_POST['nonce'] ) && $plugin_id && $_POST['nonce'] == wp_create_nonce( 'activate_' . $plugin_id ) ) { - - // Deactivate any embedded version - $plugin_slug = dirname( $plugin_id ); - $active_plugins = get_option( 'active_plugins' ); - foreach ( $active_plugins as $plugin ) { - $wp_plugin_slug = dirname( $plugin ); - if ( $wp_plugin_slug == $plugin_slug . '-embedded' ) { - deactivate_plugins( array( $plugin ) ); - break; - } - } - - //prevent redirects - add_filter( 'wp_redirect', '__return_false', 10000 ); - - $return = activate_plugin( $plugin_id ); - - if ( is_wp_error( $return ) ) { - $error = $return->get_error_message(); - } - - } else { - $error = 'error'; - } - - $ret = array( 'error' => $error ); - - echo json_encode( $ret ); - exit; - - } - - public function custom_plugins_api_call( $false, $action, $args ) { - - if ( $action == 'plugin_information' ) { - - $plugins = get_plugins(); - $plugin_names = array(); - foreach ( $plugins as $plugin_id => $plugin ) { - // plugins by WP slug which (plugin folder) which can be different - // will use this to compare by title - $plugin_names[ dirname( $plugin_id ) ] = array( - 'name' => $plugin['Name'], - 'title' => $plugin['Title'], - ); - } - - $slug = $args->slug; - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - if ( ! $this->repository_has_valid_subscription( $repository_id ) ) { - $site_key = false; - } else { - $site_key = $repository['subscription']['key']; - } - - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( $download['slug'] == $slug || - isset( $plugin_names[ $slug ] ) && ( - $plugin_names[ $slug ]['name'] == $download['name'] || - $plugin_names[ $slug ]['title'] == $download['name'] - ) - ) { - - if ( $this->should_fallback_under_wp_org_repo( $download, $site_key ) ) { - return false; // use data from wordpress.org - } - - $res = new stdClass(); - $res->external = true; - - $res->name = $download['name']; - $res->slug = $slug; - $res->version = $download['version']; - $res->author = ''; - $res->author_profile = ''; - $res->last_updated = $download['date']; - - if ( $site_key ) { - $res->download_link = $this->append_site_key_to_download_url( $download['url'], $site_key, $repository_id ); - } - - $res->homepage = $repository['data']['url']; - $res->sections = array( - 'Description' => $download['description'], - 'Changelog' => $download['changelog'] - ); - - return $res; - - } - - } - - } - - } - - } - - } - - return $false; - - } - - public function plugins_upgrade_check( $update_plugins ) { - - if ( ! empty( $this->settings['repositories'] ) ) { - - $plugins = get_plugins(); - - foreach ( $plugins as $plugin_id => $plugin ) { - - $slug = dirname( $plugin_id ); - if ( empty( $slug ) ) { - continue; - } - - $version = $plugin['Version']; - $name = $plugin['Name']; - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - - if ( ! $this->repository_has_valid_subscription( $repository_id ) ) { - $site_key = false; - } else { - $site_key = $repository['subscription']['key']; - //$subscription_type = $this->get_subscription_type_for_repository($repository_id); - } - - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( ! $this->plugin_is_registered( $repository_id, $download['slug'] ) ) { - continue; - } - - $has_wporg_update = ! empty( $update_plugins->response[ $plugin_id ] ); - if ( $this->should_fallback_under_wp_org_repo( $download, $site_key ) && $has_wporg_update ) { - continue; - } - - $needs_version_update = version_compare( $download['version'], $version, '>' ) || - ! empty( $_POST['reset_to_channel'] ); - - if ( - ( empty( $update_plugins->response[ $plugin_id ] ) || ! $this->should_fallback_under_wp_org_repo( $download, $site_key ) ) && - ( $download['slug'] == $slug || $download['name'] == $name ) && - $needs_version_update - ) { - $response = new stdClass(); - $response->id = 0; - $response->slug = $slug; - $response->plugin = $plugin_id; - $response->new_version = $download['version']; - $response->upgrade_notice = ''; - $response->url = $download['url']; - if ( $site_key ) { - $response->package = $this->append_site_key_to_download_url( $download['url'], $site_key, $repository_id ); - } - - $response = apply_filters( 'otgs_installer_upgrade_check_response', $response, $name, $repository_id ); - - $update_plugins->checked[ $plugin_id ] = $version; - $update_plugins->response[ $plugin_id ] = $response; - - } - - } - - } - - } - - } - - } - - } - - return $update_plugins; - - } - - private function should_fallback_under_wp_org_repo( $download, $site_key ) { - return ( ! empty( $download['free-on-wporg'] ) || isset( $download['fallback-free-on-wporg'] ) && $download['fallback-free-on-wporg'] && ! $site_key ) && $download['channel'] == WP_Installer_Channels::CHANNEL_PRODUCTION; - } - - private function has_non_wporg_upgrade_available( $plugin_id ){ - $plugins_update_data = get_site_transient( 'update_plugins' ); - - return ! empty( $plugins_update_data->response[ $plugin_id ] ) && - ! preg_match('/w\.org/', $plugins_update_data->response[ $plugin_id ]->id ); - } - - public function setup_plugins_page_notices() { - $plugins = get_plugins(); - $template_service = new OTGS_Installer_Twig_Template_Service_Loader( - array( $this->plugin_path() . '/templates/components-setting/' ) - ); - $local_components_setting = new OTGS_Installer_WP_Share_Local_Components_Setting(); - $plugin_page_notice = new OTGS_Installer_Plugins_Page_Notice( $template_service->get_service(), $local_components_setting ); - - foreach ( $plugins as $plugin_id => $plugin ) { - - $slug = dirname( $plugin_id ); - if ( empty( $slug ) ) { - continue; - } - - $name = $plugin['Name']; - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - if ( ! $this->repository_has_valid_subscription( $repository_id ) ) { - $site_key = false; - } else { - $site_key = $repository['subscription']['key']; - } - - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - $display_subscription_notice = false; - $display_setting_notice = false; - - if ( $download['slug'] == $slug || $download['name'] == $name ) { - if ( in_array( $name, array( 'Toolset Types', 'WPML Multilingual CMS' ), true ) ) { - $display_setting_notice = true; - } - - if ( ! $site_key || ! $this->plugin_is_registered( $repository_id, $download['slug'] ) ) { - $display_setting_notice = false; - - if ( ! $this->should_fallback_under_wp_org_repo( $download, $site_key ) || $this->has_non_wporg_upgrade_available( $plugin_id ) ) { - $display_subscription_notice = true; - } - } - } - - if ( $display_setting_notice || $display_subscription_notice ) { - $plugin_page_notice->add_plugin( - $plugin_id, - array( - OTGS_Installer_Plugins_Page_Notice::DISPLAY_SUBSCRIPTION_NOTICE_KEY => $display_subscription_notice, - OTGS_Installer_Plugins_Page_Notice::DISPLAY_SETTING_NOTICE_KEY => $display_setting_notice, - ) - ); - } - } - } - } - } - } - - $plugin_page_notice->add_hooks(); - } - - public function localize_strings() { - - if ( ! empty( $this->settings['repositories'] ) ) { - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - //set name as call2action when don't have any - //products - foreach ( $repository['data']['packages'] as $package_id => $package ) { - foreach ( $package['products'] as $product_id => $product ) { - if ( empty( $product['call2action'] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['call2action'] = $product['name']; - } - - foreach ( $product['upgrades'] as $idx => $upg ) { - if ( empty( $upg['call2action'] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['upgrades'][ $idx ]['call2action'] = $upg['name']; - } - } - - foreach ( $product['renewals'] as $idx => $rnw ) { - if ( empty( $rnw['call2action'] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['renewals'][ $idx ]['call2action'] = $rnw['name']; - } - - } - - } - } - } - } - - global $sitepress; - if ( is_null( $sitepress ) ) { - return; - } - - // default strings are always in English - $user_admin_language = $sitepress->get_admin_language(); - - if ( $user_admin_language != 'en' ) { - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - $localization = $repository['data']['localization']; - - //packages - foreach ( $repository['data']['packages'] as $package_id => $package ) { - - if ( isset( $localization['packages'][ $package_id ]['name'][ $user_admin_language ] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['name'] = $localization['packages'][ $package_id ]['name'][ $user_admin_language ]; - } - if ( isset( $localization['packages'][ $package_id ]['description'][ $user_admin_language ] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['description'] = $localization['packages'][ $package_id ]['description'][ $user_admin_language ]; - } - - } - - //products - foreach ( $repository['data']['packages'] as $package_id => $package ) { - foreach ( $package['products'] as $product_id => $product ) { - - if ( isset( $localization['products'][ $product_id ]['name'][ $user_admin_language ] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['name'] - = $localization['products'][ $product_id ]['name'][ $user_admin_language ]; - } - if ( isset( $localization['products'][ $product_id ]['description'][ $user_admin_language ] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['description'] - = $localization['products'][ $product_id ]['description'][ $user_admin_language ]; - } - if ( isset( $localization['products'][ $product_id ]['call2action'][ $user_admin_language ] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['name'] - = $localization['products'][ $product_id ]['call2action'][ $user_admin_language ]; - } - - - } - } - - //subscription info - if ( isset( $repository['data']['subscriptions_meta']['expiration'] ) ) { - foreach ( $repository['data']['subscriptions_meta']['expiration'] as $subscription_id => $note ) { - if ( isset( $localization['subscriptions-notes'][ $subscription_id ]['expiration-warning'][ $user_admin_language ] ) ) { - $this->settings['repositories'][ $repository_id ]['data']['subscriptions_meta']['expiration'][ $subscription_id ]['warning_message'] - = $localization['subscriptions-notes'][ $subscription_id ]['expiration-warning'][ $user_admin_language ]; - } - } - } - - } - } - - } - - public function get_matching_cp( $repository, $args = array() ) { - $match = false; - - - $cp_name = $cp_author = false; - - if ( isset( $this->config['src_name'] ) && isset( $this->config['src_author'] ) ) { - - $cp_name = $this->config['src_name']; - $cp_author = $this->config['src_author']; - - } elseif ( isset( $args['src_name'] ) && isset( $args['src_author'] ) ) { - - $cp_name = $args['src_name']; - $cp_author = $args['src_author']; - - } - - if ( isset( $repository['data']['marketing_cp'] ) ) { - - foreach ( $repository['data']['marketing_cp'] as $cp ) { - - if ( ! empty( $cp['exp'] ) && time() > $cp['exp'] ) { - continue; - } - - //Use theme_name for plugins too - if ( ! empty( $cp['theme_name'] ) ) { - if ( $cp['author_name'] == $cp_author && $cp['theme_name'] == $cp_name ) { - $match = $cp; - continue; - } - } else { - if ( $cp['author_name'] == $cp_author ) { - $match = $cp; - continue; - } - } - - } - - } - - return $match; - } - - public function set_filtered_prices( $args = array() ) { - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - $match = $this->get_matching_cp( $repository, $args ); - - if ( empty( $match ) ) { - continue; - } - - foreach ( $repository['data']['packages'] as $package_id => $package ) { - - foreach ( $package['products'] as $product_id => $product ) { - - if ( $match['dtp'] == '%' ) { - $fprice = round( $product['price'] * ( 1 - $match['amt'] / 100 ), 2 ); - $fprice = $fprice != round( $fprice ) ? sprintf( '%.2f', $fprice ) : round( $fprice, 0 ); - } elseif ( $match['dtp'] == '-' ) { - $fprice = $product['price'] - $match['amt']; - } else { - $fprice = $product['price']; - } - - if ( $fprice ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['price_disc'] = $fprice; - - $url_glue = false !== strpos( $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['url'], '?' ) ? '&' : '?'; - $cpndata = base64_encode( json_encode( array( - 'theme_author' => $match['author_name'], - 'theme_name' => $match['theme_name'], - 'vlc' => $match['vlc'] - ) ) ); - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['url'] .= $url_glue . 'cpn=' . $cpndata; - - foreach ( $product['upgrades'] as $upgrade_id => $upgrade ) { - - $fprice = false; - if ( $match['dtp'] == '%' ) { - $fprice = round( $upgrade['price'] * ( 1 - $match['amt'] / 100 ), 2 ); - $fprice = $fprice != round( $fprice ) ? sprintf( '%.2f', $fprice ) : round( $fprice, 0 ); - } elseif ( $match['dtp'] == '-' ) { - $fprice = $upgrade['price'] - $match['amt']; - } - if ( $fprice ) { - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['upgrades'][ $upgrade_id ]['price_disc'] = $fprice; - $this->settings['repositories'][ $repository_id ]['data']['packages'][ $package_id ]['products'][ $product_id ]['upgrades'][ $upgrade_id ]['url'] .= $url_glue . 'cpn=' . $cpndata; - } - - - } - - } - - } - - } - - } - - } - - public function set_hierarchy_and_order() { - - //2 levels - if ( ! empty( $this->settings['repositories'] ) ) { - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - if ( empty( $repository['data']['packages'] ) ) { - continue; - } - - $all_packages = $repository['data']['packages']; - $ordered_packages = array(); - - //backward compatibility - 'order' - foreach ( $all_packages as $k => $v ) { - if ( ! isset( $v['order'] ) ) { - $all_packages[ $k ]['order'] = 0; - } - } - - //select parents - foreach ( $all_packages as $package_id => $package ) { - if ( empty( $package['parent'] ) ) { - $ordered_packages[ $package_id ] = $package; - } - } - - //add sub-packages - foreach ( $all_packages as $package_id => $package ) { - if ( ! empty( $package['parent'] ) ) { - if ( isset( $ordered_packages[ $package['parent'] ] ) ) { - $ordered_packages[ $package['parent'] ]['sub-packages'][ $package_id ] = $package; - } - } - } - - // order parents - usort( $ordered_packages, array( $this, 'compare_package_order' ) ); - //order sub-packages - foreach ( $ordered_packages as $package_id => $package ) { - if ( ! empty( $package['sub-packages'] ) ) { - usort( $ordered_packages[ $package_id ]['sub-packages'], array( $this, 'compare_package_order' ) ); - } - } - - $this->settings['repositories'][ $repository_id ]['data']['packages'] = $ordered_packages; - - - } - } - - - } - - public function compare_package_order($a, $b) { - return $a['order'] > $b['order']; - } - - public function get_support_tag_by_name( $name, $repository ) { - - if ( is_array( $this->settings['repositories'][ $repository ]['data']['support_tags'] ) ) { - foreach ( $this->settings['repositories'][ $repository ]['data']['support_tags'] as $support_tag ) { - if ( $support_tag['name'] == $name ) { - return $support_tag['url']; - } - } - } - - return false; - } - - public function plugin_upgrade_custom_errors() { - - if ( isset( $_REQUEST['action'] ) ) { - - $action = isset( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; - - //bulk mode - if ( 'update-selected' == $action ) { - - global $plugins; - - if ( isset( $plugins ) && is_array( $plugins ) ) { - - foreach ( $plugins as $k => $plugin ) { - $plugin_repository = false; - - $wp_plugin_slug = dirname( $plugin ); - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - if ( $download['slug'] == $wp_plugin_slug ) { - $plugin_repository = $repository_id; - $product_name = $repository['data']['product-name']; - $plugin_name = $download['name']; - $free_on_wporg = ! empty( $download['free-on-wporg'] ) && $download['channel'] == WP_Installer_Channels::CHANNEL_PRODUCTION; - break; - } - - } - - } - - } - - } - - if ( $plugin_repository ) { - - //validate subscription - static $sub_cache = array(); - - if ( empty( $sub_cache[ $plugin_repository ] ) ) { - $subscription_data = false; - $site_key = $this->get_repository_site_key( $plugin_repository ); - if ( $site_key ) { - try { - $subscription_data = $this->fetch_subscription_data( $plugin_repository, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REVALIDATION ); - } catch ( Exception $e ) { - } - } - - $sub_cache[ $plugin_repository ]['site_key'] = $site_key; - $sub_cache[ $plugin_repository ]['subscription_data'] = $subscription_data; - } else { - $site_key = $sub_cache[ $plugin_repository ]['site_key']; - $subscription_data = $sub_cache[ $plugin_repository ]['subscription_data']; - } - - if ( ! $site_key && ! empty( $free_on_wporg ) ) { // allow the download from wp.org - continue; - } - - if ( empty( $site_key ) || empty( $subscription_data ) ) { - - - $error_message = sprintf( __( "%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first.", 'installer' ), - '' . $plugin_name . '', '', $product_name, '' ); - - echo '

' . $error_message . '

'; - - unset( $plugins[ $k ] ); - - - } - - } - - } - - } - - } - - - if ( 'upgrade-plugin' == $action || 'update-plugin' == $action ) { - - $plugin = isset( $_REQUEST['plugin'] ) ? trim( sanitize_text_field( $_REQUEST['plugin'] ) ) : ''; - - $wp_plugin_slug = dirname( $plugin ); - - $plugin_repository = false; - - foreach ( $this->settings['repositories'] as $repository_id => $repository ) { - - foreach ( $repository['data']['packages'] as $package ) { - - foreach ( $package['products'] as $product ) { - - foreach ( $product['plugins'] as $plugin_slug ) { - $download = $this->settings['repositories'][ $repository_id ]['data']['downloads']['plugins'][ $plugin_slug ]; - - //match by folder, will change to match by name and folder - if ( $download['slug'] == $wp_plugin_slug ) { - $plugin_repository = $repository_id; - $product_name = $repository['data']['product-name']; - $plugin_name = $download['name']; - $free_on_wporg = ! empty( $download['free-on-wporg'] ) && $download['channel'] == WP_Installer_Channels::CHANNEL_PRODUCTION; - break; - } - - } - - } - - } - - } - - if ( $plugin_repository ) { - - //validate subscription - $site_key = $this->get_repository_site_key( $plugin_repository ); - if ( $site_key ) { - try { - $subscription_data = $this->fetch_subscription_data( $plugin_repository, $site_key, self::SITE_KEY_VALIDATION_SOURCE_REVALIDATION ); - } catch ( Exception $e ) { - $subscription_data = false; - } - } - - $no_subscription = empty( $site_key ) || empty( $subscription_data ); - $not_on_wporg = empty( $free_on_wporg ) && ! $this->should_fallback_under_wp_org_repo( $download, $site_key ); - - if ( $no_subscription && $not_on_wporg ) { - - $error_message = sprintf( __( "%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first.", 'installer' ), - '' . $plugin_name . '', '', $product_name, '' ); - - if ( defined( 'DOING_AJAX' ) ) { //WP 4.2 - - $status = array( - 'update' => 'plugin', - 'plugin' => $plugin, - 'slug' => sanitize_key( $_POST['slug'] ), - 'oldVersion' => '', - 'newVersion' => '', - ); - - $status['errorCode'] = 'wp_installer_invalid_subscription'; - $status['error'] = $error_message; - - wp_send_json_error( $status ); - - } else { // WP 4.1.1 - echo '

' . $error_message . '

'; - - - echo '
'; - echo '

' . __( 'Update Plugin', 'installer' ) . '

'; - echo '' . __( 'Return to the plugins page', 'installer' ) . ''; - echo '
'; - require_once( ABSPATH . 'wp-admin/admin-footer.php' ); - exit; - - } - - } - - - } - - } - } - - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/functions-core.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/functions-core.php deleted file mode 100644 index 3bbc8ca..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/includes/functions-core.php +++ /dev/null @@ -1,18 +0,0 @@ -show_products($args); -} - -function WP_Installer_get_local_components_setting_ui( $args ) { - $installer_factory = get_OTGS_Installer_Factory(); - - ob_start(); - $installer_factory->create_settings_hooks() - ->render_local_components_setting( $args ); - - return ob_get_clean(); -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/installer.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/installer.php deleted file mode 100644 index a92a9d7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/installer.php +++ /dev/null @@ -1,60 +0,0 @@ -=' ) ) { - define( 'WP_INSTALLER_VERSION', $delegate['version'] ); -} - -$plugin_path = dirname( __FILE__ ); - -include_once $plugin_path . '/includes/functions-core.php'; -include_once $plugin_path . '/includes/class-otgs-installer-subscription.php'; -include_once $plugin_path . '/includes/class-wp-installer.php'; - -include_once WP_Installer()->plugin_path() . '/includes/class-wp-installer-api.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-translation-service-info.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-installer-dependencies.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-wp-installer-channels.php'; - -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-php-functions.php'; - -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-wp-components-sender.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-wp-components-storage.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-wp-components-hooks.php'; - -include_once WP_Installer()->plugin_path() . '/templates/template-service/interface-iotgs-installer-template-service.php'; -include_once WP_Installer()->plugin_path() . '/templates/template-service/class-otgs-installer-twig-template-service.php'; -include_once WP_Installer()->plugin_path() . '/templates/template-service/class-otgs-installer-twig-template-service-loader.php'; - -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-wp-components-setting-resources.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-plugins-page-notice.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-wp-components-setting-ajax.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-filename-hooks.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-icons.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-wp-share-local-components-setting-hooks.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-installer-factory.php'; - -include_once WP_Installer()->plugin_path() . '/includes/functions-templates.php'; -include_once WP_Installer()->plugin_path() . '/includes/class-otgs-twig-autoloader.php'; - -// Initialization -WP_Installer(); -WP_Installer_Channels(); - -$installer_factory = get_OTGS_Installer_Factory(); - -$installer_factory->create_resources() - ->add_hooks(); -$installer_factory->create_settings_hooks() - ->add_hooks(); -$installer_factory->create_wp_components_hooks() - ->add_hooks(); -$installer_factory->create_local_components_ajax_setting() - ->add_hooks(); -$installer_factory->create_filename_hooks() - ->add_hooks(); -$installer_factory->create_icons() - ->add_hooks(); - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/loader.php b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/loader.php deleted file mode 100644 index 4fec81b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/loader.php +++ /dev/null @@ -1,155 +0,0 @@ - $wp_installer_instance, - 'version' => '1.8.20' -); - - -/* EXCEPTIONS ********************************************************************************************/ -// Exception: When WPML prior 3.2 is used, that instance must be used regardless of another newer instance -// Case 1: WPML loaded before Types - eliminate other instances -if ( defined( 'ICL_SITEPRESS_VERSION' ) && version_compare( ICL_SITEPRESS_VERSION, '3.2', '<' ) ) { - foreach ( $wp_installer_instances as $key => $instance ) { - if ( isset( $instance['args']['site_key_nags'] ) ) { - $wp_installer_instances[ $key ]['version'] = '9.9'; - } else { - $wp_installer_instances[ $key ]['version'] = '0'; - } - } -} - -// Exception: Types 1.8.9 (Installer 1.7.0) with WPML before 3.3 (Installer before 1.7.0) -// New products file http://d2salfytceyqoe.cloudfront.net/wpml-products33.json overrides the old one -// while the WPML's instance is being used -// => Force using the new Installer Instance -if ( defined( 'ICL_SITEPRESS_VERSION' ) && version_compare( ICL_SITEPRESS_VERSION, '3.3.1', '<' ) ) { - - // if Installer 1.7.0+ is present, unregister Installer from old WPML - // Force Installer 1.7.0+ being used over older Installer versions - $installer_171_plus_on = false; - foreach ( $wp_installer_instances as $key => $instance ) { - if ( version_compare( $instance['version'], '1.7.1', '>=' ) ) { - $installer_171_plus_on = true; - break; - } - } - - if ( $installer_171_plus_on ) { - foreach ( $wp_installer_instances as $key => $instance ) { - - if ( version_compare( $instance['version'], '1.7.0', '<' ) ) { - unset( $wp_installer_instances[ $key ] ); - } - - } - } - -} - -// Exception: When using the embedded plugins module allow the set up to run completely with the -// Installer instance that triggers it -if ( isset( $_POST['installer_instance'] ) && isset( $wp_installer_instances[ $_POST['installer_instance'] ] ) ) { - $wp_installer_instances[ $_POST['installer_instance'] ]['version'] = '999'; -} -/* EXCEPTIONS ********************************************************************************************/ - - -// Only one of these in the end -remove_action( 'after_setup_theme', 'wpml_installer_instance_delegator', 1 ); -add_action( 'after_setup_theme', 'wpml_installer_instance_delegator', 1 ); - -// When all plugins load pick the newest version -if ( ! function_exists( 'wpml_installer_instance_delegator' ) ) { - function wpml_installer_instance_delegator() { - global $wp_installer_instances; - - // version based election - foreach ( $wp_installer_instances as $instance ) { - - if ( ! isset( $delegate ) ) { - $delegate = $instance; - continue; - } - - if ( version_compare( $instance['version'], $delegate['version'], '>' ) ) { - $delegate = $instance; - } - } - - // priority based election - $highest_priority = null; - foreach ( $wp_installer_instances as $instance ) { - if ( isset( $instance['args']['high_priority'] ) ) { - if ( is_null( $highest_priority ) || $instance['args']['high_priority'] <= $highest_priority ) { - $highest_priority = $instance['args']['high_priority']; - $delegate = $instance; - } - } - } - - // Exception: When WPML prior 3.2 is used, that instance must be used regardless of another newer instance - // Case 2: WPML loaded after Types - if ( defined( 'ICL_SITEPRESS_VERSION' ) && version_compare( ICL_SITEPRESS_VERSION, '3.2', '<' ) ) { - foreach ( $wp_installer_instances as $key => $instance ) { - if ( isset( $instance['args']['site_key_nags'] ) ) { - $delegate = $instance; - $wp_installer_instances = array( $key => $delegate ); //Eliminate other instances - break; - } - } - } - - include_once $delegate['bootfile']; - - // set configuration - if ( strpos( realpath( $delegate['bootfile'] ), realpath( TEMPLATEPATH ) ) === 0 ) { - $delegate['args']['in_theme_folder'] = dirname( ltrim( str_replace( realpath( TEMPLATEPATH ), '', realpath( $delegate['bootfile'] ) ), '\\/' ) ); - } - if ( isset( $delegate['args'] ) && is_array( $delegate['args'] ) ) { - foreach ( $delegate['args'] as $key => $value ) { - WP_Installer()->set_config( $key, $value ); - } - } - - } -} - -if ( ! function_exists( 'WP_Installer_Setup' ) ) { - - // $args: - // plugins_install_tab = true|false (default: true) - // repositories_include = array() (default: all) - // repositories_exclude = array() (default: none) - // template = name (default: default) - // - // Ext function - function WP_Installer_Setup( $wp_installer_instance, $args = array() ) { - global $wp_installer_instances; - - if ( $wp_installer_instance ) { - $wp_installer_instances[ $wp_installer_instance ]['args'] = $args; - } - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ar.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ar.mo deleted file mode 100644 index d65c063..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ar.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-de_DE.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-de_DE.mo deleted file mode 100644 index e1a1a47..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-de_DE.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-el.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-el.mo deleted file mode 100644 index 9a23130..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-el.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-es_ES.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-es_ES.mo deleted file mode 100644 index 8c2eae6..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-es_ES.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-fr_FR.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-fr_FR.mo deleted file mode 100644 index ea58704..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-fr_FR.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-he_IL.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-he_IL.mo deleted file mode 100644 index 383648c..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-he_IL.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-it_IT.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-it_IT.mo deleted file mode 100644 index 0688aab..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-it_IT.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ja.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ja.mo deleted file mode 100644 index a952b33..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ja.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ko_KR.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ko_KR.mo deleted file mode 100644 index 96ff703..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ko_KR.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-nl_NL.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-nl_NL.mo deleted file mode 100644 index db22e99..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-nl_NL.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pl_PL.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pl_PL.mo deleted file mode 100644 index 68dbdea..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pl_PL.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pt_BR.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pt_BR.mo deleted file mode 100644 index c843f5f..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pt_BR.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pt_PT.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pt_PT.mo deleted file mode 100644 index 8390e9e..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-pt_PT.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ru_RU.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ru_RU.mo deleted file mode 100644 index 92078cd..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-ru_RU.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-sv_SE.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-sv_SE.mo deleted file mode 100644 index 7da81b4..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-sv_SE.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-uk_UA.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-uk_UA.mo deleted file mode 100644 index 2603b14..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-uk_UA.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-vi.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-vi.mo deleted file mode 100644 index c3ee782..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-vi.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-zh_CN.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-zh_CN.mo deleted file mode 100644 index 6d00957..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-zh_CN.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-zh_TW.mo b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-zh_TW.mo deleted file mode 100644 index 7d437bc..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/installer-zh_TW.mo and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/orig/installer.po b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/orig/installer.po deleted file mode 100644 index 7a5c903..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/locale/orig/installer.po +++ /dev/null @@ -1,230 +0,0 @@ -# This file was generated by WPML -# WPML is a WordPress plugin that can turn any WordPress site into a full featured multilingual content management system. -# https://wpml.org -msgid "" -msgstr "" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Project-Id-Version:WPML_EXPORT\n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"Language:en\n" -"MIME-Version: 1.0\n" - -msgid "Installer" -msgstr "" - -msgid "Registered" -msgstr "" - -msgid "Register" -msgstr "" - -msgid "To get automatic updates, you need to register %s for this site. %sRegister %s%s" -msgstr "" - -msgid "Dismiss" -msgstr "" - -msgid "Commercial" -msgstr "" - -msgid "Installer cannot contact our updates server to get information about the available products and check for new versions. If you are seeing this message for the first time, you can ignore it, as it may be a temporary communication problem. If the problem persists and your WordPress admin is slowing down, you can disable automated version checks. Add the following line to your wp-config.php file:" -msgstr "" - -msgid "No repositories defined." -msgstr "" - -msgid "%s cannot access %s to register. Try again to see if it's a temporary problem. If the problem continues, make sure that this site has access to the Internet. You can still use the plugin without registration, but you will not receive automated updates." -msgstr "" - -msgid "Invalid site key for the current site." -msgstr "" - -msgid "You will have to renew your subscription in order to continue getting the updates and support." -msgstr "" - -msgid "%sRenew here%s." -msgstr "" - -msgid "Your subscription appears to no longer be valid. Please try to register again using a valid site key." -msgstr "" - -msgid "You need to have a valid subscription in order to get upgrades or support for this plugin. %sPurchase a subscription or enter an existing site key%s." -msgstr "" - -msgid "%s cannot update because your site's registration is not valid. Please %sregister %s%s again for this site first." -msgstr "" - -msgid "Update Plugin" -msgstr "" - -msgid "Return to the plugins page" -msgstr "" - -msgid "Your subscription expires in %d day." -msgstr "" - -msgid "Your subscription expires in %d days." -msgstr "" - -msgid "Downloading is not possible because WordPress cannot write into the plugins folder. %sHow to fix%s." -msgstr "" - -msgid "Plugin" -msgstr "" - -msgid "downloading..." -msgstr "" - -msgid "failed!" -msgstr "" - -msgid "downloaded" -msgstr "" - -msgid "activating" -msgstr "" - -msgid "activated" -msgstr "" - -msgid "Activate after download" -msgstr "" - -msgid "Operation complete!" -msgstr "" - -msgid "Download failed!\n\nClick OK to revalidate your subscription or CANCEL to try again." -msgstr "" - -msgid "Available" -msgstr "" - -msgid "Installed" -msgstr "" - -msgid "Downloading" -msgstr "" - -msgid "Activate" -msgstr "" - -msgid "Download" -msgstr "" - -msgid "Downloads:" -msgstr "" - -msgid "Current version" -msgstr "" - -msgid "Released" -msgstr "" - -msgid "Installed version" -msgstr "" - -msgid "(embedded)" -msgstr "" - -msgid "installing..." -msgstr "" - -msgid "updating..." -msgstr "" - -msgid "installed" -msgstr "" - -msgid "updated" -msgstr "" - -msgid "Download failed!\n\nPlease refresh the page and try again." -msgstr "" - -msgid "Incorrect setup" -msgstr "" - -msgid "Invalid product" -msgstr "" - -msgid "Unknown repository" -msgstr "" - -msgid " Your current site key (%s) does not match the selected product (%s)." -msgstr "" - -msgid "Buy %s" -msgstr "" - -msgid "Already bought %s?" -msgstr "" - -msgid "Renew %s" -msgstr "" - -msgid "Remove current site key (%s)" -msgstr "" - -msgid "%s support on wpml.org" -msgstr "" - -msgid "Enter site key" -msgstr "" - -msgid "Subscription is expired." -msgstr "" - -msgid "Add" -msgstr "" - -msgid "Are you sure you want to remove this site key?" -msgstr "" - -msgid "Register %s" -msgstr "" - -msgid "1. Go to your %s%s account%s and add this site URL: %s" -msgstr "" - -msgid "Unregister %s from this site" -msgstr "" - -msgid "%s is registered on this site. You will receive automatic updates until %s" -msgstr "" - -msgid "%s is registered on this site. Your Lifetime account gives you updates for life." -msgstr "" - -msgid "This page lets you install plugins and update existing plugins. To remove any of these plugins, go to the %splugins%s page and if you have the permission to remove plugins you should be able to do this." -msgstr "" - -msgid "Already bought?" -msgstr "" - -msgid "2. Enter your site key" -msgstr "" - -msgid "Subscription is expired. You need to either purchase a new subscription or upgrade if available." -msgstr "" - -msgid "Check for updates" -msgstr "" - -msgid "Individual components" -msgstr "" - -msgid "OK" -msgstr "" - -msgid "Cancel" -msgstr "" - -msgid "Are you sure you want to unregister?" -msgstr "" - -msgid "Click to see individual components options." -msgstr "" diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpcs.compatibility.xml b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpcs.compatibility.xml deleted file mode 100644 index 2dfd503..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpcs.compatibility.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - WPML Coding Standards - - - - - - */vendor/* - */tests/* - *.js - *.mo - *.po - *.twig - *.css - *.scss - - - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpcs.xml b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpcs.xml deleted file mode 100644 index 0dc216d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpcs.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - WPML Coding Standards - - - - - - */vendor/* - */tests/* - *.js - *.mo - *.po - *.twig - *.css - *.scss - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpunit.xml b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpunit.xml deleted file mode 100644 index 966ee05..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/phpunit.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - ./tests/phpunit/tests/ - - - - - ./ - - ./locale - ./tests - ./vendor - - - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/repositories.xml b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/repositories.xml deleted file mode 100644 index 02d93d1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/repositories.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - wpml - https://api.wpml.org/ - http://d2salfytceyqoe.cloudfront.net/wpml33-products.json - - - toolset - https://api.toolset.com/ - http://d7j863fr5jhrr.cloudfront.net/toolset33-products.json - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/css/admin.css b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/css/admin.css deleted file mode 100644 index 9af3b44..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/css/admin.css +++ /dev/null @@ -1,346 +0,0 @@ -.otgsi_site_key_form{ - display:none; - /*display:inline;*/ -} -.otgs-installer-register-inputs { - display: block; -} -@media (min-width: 1100px) { - .otgs-installer-register-inputs { - display: inline; - white-space: nowrap; - } -} -.otgsi_site_key_form .otgs-installer-register-inputs input { - vertical-align: middle; - margin: 3px 1px; - height: 28px; - line-height: 26px; -} - - -.installer-status-installing, .installer-status-installed, .installer-status-updating, .installer-status-updated, .installer-status-activating, .installer-status-activated, .installer-status-success{ - display: none; -} -.installer-status-installing{color: #FF9900; } -.installer-status-installed{color: #003300; font-weight: bold; } -.installer-status-updating{color: #FF9900; } -.installer-status-updated{color: #003300; font-weight: bold; } - -.installer-status-installed .error-details:before, -.installer-status-updated .error-details:before{ - content: "\f534"; - font: 200 16px/1 dashicons; - vertical-align: text-bottom; - margin-left: 5px; - color: red; - cursor: help; -} - -.installer-status-activating{color: #996666 } -.installer-status-activated{color: #333366; font-weight: bold; } - -.js-status-success p{ - color: #FF9900; - padding: 4px; -} - -.installer-green-text{ - color:#006600; - font-weight:bold; -} - -.installer-red-text{ - color:#b22121; - font-weight:bold; -} - -.installer-footnote{ - color:#3d5e69; - display:block; - float: left; - font-style: italic; - font-size: 90%; -} - -.installer-products-list li{ - display: inline; - margin-right: 20px; -} - -.otgs_wp_installer_table a.disabled{ - color:#888; -} - -.otgs_wp_installer_subtable{ - clear: both; - margin-left:-20px; -} -.otgs_wp_installer_subtable td p{ - font-size: 92%; -} - -.installer-status-error{ - color: #f00; -} - -.installer-status-note{ - color: #6F6E6D; - font-style: italic; -} - -.installer-warn-text{ - color: #FF6400; -} - -.installer-warn-box{ - -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;border:1px solid #FF6400;background-color:#df8a48; - color: #333; - padding: 5px; -} -.installer-warn-box span.details{ - font-style: italic; - color:#777; -} - -.installer-error-box{ - color:#962722; - margin-top: 10px; -} -.installer-error-box p{ - margin: 10px 0 10px 0; - -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;border:1px solid #962722;background-color:#F5C8C6; - color: #333; - padding: 5px; - text-align: center; -} - -.spinner-inline{ - float: none; - display: inline-block; - visibility: visible; -} - -.installer-q-icon:before{ - content: '\f223' !important; - font-family: dashicons !important; - font-size: 20px; - line-height: 1; - color: #f56e28; -} - -.installer-plugin-update-tr td{ - padding-left:3px !important; -} - -.otgsi_yellow_bg{ - background-color: #f2f46b; -} - -.otgs_wp_installer_table_compact{ - width:480px; - border: solid 1px #999; - padding:10px; - border-radius: 5px; -} - -.installer-plugins-list-compact{ - background-color: #fff; - border-collapse: collapse; - border:solid 1px #C1DAD7; - width:100%; -} - -.installer-plugins-list-compact tr th{ - padding-top:3px; - background-color: #ccc; -} - -.installer-plugins-list-compact tr{ - background-color: #ddd; -} - -.installer-plugins-list-compact tr.even{ - background-color: #eee; -} - -.installer-plugins-list-compact td{ - padding:2px 5px 2px 5px; - border-right: 1px solid #C1DAD7; - border-bottom: 1px solid #C1DAD7; -} - -.installer-plugins-list-compact td.twelve{ - width:16px; -} - -.otgs_wp_installer_table_compact .installer-status-downloading, -.otgs_wp_installer_table_compact .installer-status-downloaded, -.otgs_wp_installer_table_compact .installer-status-activating, -.otgs_wp_installer_table_compact .installer-status-activated{ - display: none; - color:transparent; width: 12px; padding:2px; -} - -.otgs_wp_installer_table_compact .installer-status-success, -.otgs_wp_installer_table_compact .installer-status-fail{ - display: none; -} - -.installer-status-success{ - float: right; - color: #006600; -} - -.otgs_wp_installer_table_compact .installer-status-downloading{background: url(../img/dn.gif) no-repeat center; } -.otgs_wp_installer_table_compact .installer-status-downloaded{background: url(../img/complete.png) no-repeat center;} -.otgs_wp_installer_table_compact .installer-status-activating{background: url(../img/dn.gif) no-repeat center; } -.otgs_wp_installer_table_compact .installer-status-activated{background: url(../img/complete.png) no-repeat center; } -.otgs_wp_installer_table_compact .installer-status-error{background: url(../img/icon_error.gif) no-repeat center; } - -.installer_highlight{ - color:#c5510b; -} - -.installer_highlight_package{ - background-color: #fff9c0; -} - -.plugin_progress{ - font-style: italic; - color: #777 -} - -.installer-download-progress-status{ - display: none; - float:right; - color: #006600; - font-style: italic; - background: url('../img/spinner.gif') no-repeat; - padding-left:24px; -} - -.installer-release-notes{ - display: none; -} - -.handle.extended:after{ - content: "▾"; - font-size: 24px; - vertical-align:bottom; -} -.installer-table-wrap a.handle:active, -.installer-table-wrap a.handle:focus{ - outline:0; - border:none; - box-shadow: none; -} - -.installer-release-notes .arrow_box { - position: relative; - background: #eee; - border: 1px solid #ccc; -} -.installer-release-notes .arrow_box:after, .installer-release-notes .arrow_box:before { - bottom: 100%; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.installer-release-notes .arrow_box:after { - border-color: rgba(238, 238, 238, 0); - border-bottom-color: #eee; - border-width: 16px; - margin-left: -16px; -} -.installer-release-notes .arrow_box:before { - border-color: rgba(204, 204, 204, 0); - border-bottom-color: #ccc; - border-width: 17px; - margin-left: -17px; -} - -.installer-release-notes .arrow_box div{ - margin-top:5px; - padding: 10px; - overflow-y: auto; - max-height: 400px; -} - -.otgs-is-dismissible { - position: relative; - padding-right: 38px; -} -.otgs-is-dismissible .notice-dismiss { - text-decoration: none; -} -.otgs-is-dismissible p [class*="button-"] { - margin: -5px 5px; -} - -.otgsi_downloads_form{ - margin-top: 15px; -} - -.spinner-with-text{ - padding-left: 25px; - float:none; - width: auto; -} -.installer-channel-update-ok{ - padding-left: 10px; - display: none; - color: #006600; -} -.installer-channel-update-fail{ - padding-left: 10px; - display: none; - color: #962722; -} - -.otgs_wp_installer_table .installer-repository-image { - padding: 8px 20px; -} - -.remove_site_key_js:disabled, -.enter_site_key_js:disabled { - cursor: help; -} - -.otgs-installer-registered span { - display: inline-block; - vertical-align: middle; - margin-bottom: .5em; -} - -@media (min-width: 1400px) { - .otgs-installer-registered-buttons { - float: right; - } -} - -.otgs-installer-keepuptodate small { - display: block; - margin-top: 3px; - line-height: 1.3; -} - -@media (min-width: 783px) { - .otgs-installer-keepuptodate small { - -webkit-margin-start: 25px; - -moz-margin-start: 25px; - margin-start: 25px; - } -} - -.otgs-installer-component-setting .spinner.otgs-components-report-setting-spinner { - float: right; -} -.otgs-installer-component-privacy-policy { - margin-top: 30px; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/css/tooltip/tooltip.css b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/css/tooltip/tooltip.css deleted file mode 100644 index d898480..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/css/tooltip/tooltip.css +++ /dev/null @@ -1 +0,0 @@ -.otgs-installer-tooltip-open{text-decoration:none}.js-otgs-installer-tooltip{z-index:110000 !important}.js-otgs-installer-tooltip .wp-pointer-content{padding:10px 25px 10px 10px}.js-otgs-installer-tooltip .wp-pointer-buttons{padding:0;position:absolute;overflow:hidden;top:4px;right:5px}.js-otgs-installer-tooltip a.close{width:18px;height:18px;padding:0}.js-otgs-installer-tooltip a.close:before{left:1px;top:0} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/complete.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/complete.png deleted file mode 100644 index 2659083..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/complete.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/computer.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/computer.png deleted file mode 100644 index 8676b5d..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/computer.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/dn.gif b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/dn.gif deleted file mode 100644 index 82a7d5e..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/dn.gif and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/dn2.gif b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/dn2.gif deleted file mode 100644 index fc7b654..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/dn2.gif and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/globe.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/globe.png deleted file mode 100644 index 9bfcabb..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/globe.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/icon_error.gif b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/icon_error.gif deleted file mode 100644 index ac506bf..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/icon_error.gif and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/on.png b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/on.png deleted file mode 100644 index 3d09f04..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/on.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/spinner.gif b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/spinner.gif deleted file mode 100644 index 209d10b..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/img/spinner.gif and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/admin.js b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/admin.js deleted file mode 100644 index 8dc635b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/admin.js +++ /dev/null @@ -1,463 +0,0 @@ - - - var otgs_wp_installer = { - - plugins_update_XHR :{}, - - init: function(){ - - jQuery('.otgs_wp_installer_table').on('click', '.enter_site_key_js', otgs_wp_installer.show_site_key_form); - jQuery('.otgs_wp_installer_table').on('click', '.cancel_site_key_js', otgs_wp_installer.hide_site_key_form); - - jQuery('.otgs_wp_installer_table').on('click', '.remove_site_key_js', otgs_wp_installer.remove_site_key); - jQuery('.otgs_wp_installer_table').on('click', '.update_site_key_js', otgs_wp_installer.update_site_key); - - jQuery('.otgs_wp_installer_table').on('submit', '.otgsi_site_key_form', otgs_wp_installer.save_site_key); - jQuery('.otgs_wp_installer_table').on('submit', '.otgsi_downloads_form', otgs_wp_installer.download_downloads); - jQuery('.otgs_wp_installer_table').on('change', '.otgsi_downloads_form :checkbox[name="downloads[]"]', otgs_wp_installer.update_downloads_form); - - jQuery('.installer-dismiss-nag').click(otgs_wp_installer.dismiss_nag); - - jQuery('.otgs_wp_installer_table').on('click', '.installer_expand_button', otgs_wp_installer.toggle_subpackages); - - otgs_wp_installer.scroll_to_repository(); - - if( typeof pagenow != 'undefined' && pagenow == 'plugins'){ - - jQuery(document).ajaxSuccess(function(event, xhr, settings) { - var data = otgs_wp_installer.getQueryParameters(settings.data); - if(typeof data.action != 'undefined' && data.action == 'update-plugin'){ - response = xhr.responseJSON.data; - if(typeof response.error != 'undefined'){ - var default_error = jQuery('#' + response.slug + '-update .update-message').html(); - jQuery('#' + response.slug + '-update .update-message').html(default_error + ' » ' + response.error + ''); - } - } - return false; - }); - - } - - if( typeof pagenow != 'undefined' && pagenow == 'plugin-install' ){ - jQuery( '.plugin-install-tab-commercial .search-plugins' ).remove(); - } - - jQuery('.installer-table-wrap').on('click', '.js-release-notes', otgs_wp_installer.toggle_release_notes); - }, - - getQueryParameters : function(str) { - return (str || document.location.search).replace(/(^\?)/,'').split("&").map(function(n){return n = n.split("="),this[n[0]] = n[1],this}.bind({}))[0]; - }, - - reset_errors: function(){ - jQuery('.installer-error-box').html('').hide(); - }, - - show_error: function(repo, text){ - jQuery('#installer_repo_' + repo).find('.installer-error-box').html(text).show(); - }, - - show_site_key_form: function () { - - var button = jQuery(this); - - if (button.attr('disabled')) { - alert(button.attr('title')); - return false; - } - - otgs_wp_installer.reset_errors(); - - var form = button.closest('td').find('form.otgsi_site_key_form'); - button.parent('p').hide(); - - form.show(); - form.find('input[name^=site_key_]').focus().val(''); - form.find('input').removeAttr('disabled'); - - form.closest('.otgsi_register_product_wrap').addClass('otgsi_yellow_bg'); - - return false; - - }, - - hide_site_key_form: function () { - var button = jQuery(this); - var form = button.closest('td').find('form'); - form.hide(); - - form.closest('.otgsi_register_product_wrap').removeClass('otgsi_yellow_bg').find('.enter_site_key_wrap_js').show(); - otgs_wp_installer.reset_errors(); - return false; - }, - - save_site_key: function(){ - - var thisf = jQuery(this); - var data = jQuery(this).serialize(); - jQuery(this).find('input').attr('disabled', 'disabled'); - - var spinner = jQuery(''); - spinner.css({display: 'inline-block', float: 'right', visibility: 'visible'}).prependTo(jQuery(this)); - - otgs_wp_installer.reset_errors(); - - jQuery.ajax({url: ajaxurl, type: 'POST', dataType:'json', data: data, success: - function(ret){ - if(!ret.error){ - otgs_wp_installer.saved_site_key(); - }else{ - otgs_wp_installer.show_error(thisf.find('[name=repository_id]').val(), ret.error); - thisf.find('input').removeAttr('disabled'); - } - - if(typeof ret.debug != 'undefined'){ - thisf.append(''); - } - - spinner.remove(); - } - }); - - return false; - - }, - - saved_site_key: function(){ - location.reload(); - }, - - remove_site_key: function(){ - - if( jQuery(this).attr('disabled') == 'disabled' ){ - - alert( jQuery(this).attr('title') ); - return false; - - } else { - - if(confirm(jQuery(this).data('confirmation'))){ - - jQuery('').css({visibility: 'visible', float: 'none'}).prependTo(jQuery(this).parent()); - data = {action: 'remove_site_key', repository_id: jQuery(this).data('repository'), nonce: jQuery(this).data('nonce')} - jQuery.ajax({url: ajaxurl, type: 'POST', data: data, success: otgs_wp_installer.removed_site_key}); - } - - } - - return false; - }, - - removed_site_key: function(){ - location.reload(); - }, - - update_site_key: function(){ - var error_wrap = jQuery(this).closest('.otgsi_register_product_wrap').find('.installer-error-box'); - error_wrap.html(''); - - var spinner = jQuery(''); - - spinner.css({visibility: 'visible', float: 'none'}).prependTo(jQuery(this).parent()); - data = {action: 'update_site_key', repository_id: jQuery(this).data('repository'), nonce: jQuery(this).data('nonce')} - jQuery.ajax({ - url: ajaxurl, - type: 'POST', - data: data, - dataType: 'json', - complete: function( event, xhr, settings ){ - var error = ''; - if(xhr == 'success') { - var ret = event.responseJSON; - if(ret.error){ - error = ret.error; - }else{ - otgs_wp_installer.updated_site_key(ret); - } - }else{ - error = 'Error processing request (' + xhr + '). Please try again!'; - } - - if( error ){ - error_wrap.html('

' + error + '

').show(); - spinner.remove(); - } - - } - }); - - return false; - - }, - - updated_site_key: function(ret){ - location.reload(); - }, - - update_downloads_form: function(){ - - var checked = jQuery('.otgsi_downloads_form :checkbox:checked[name="downloads[]"]').length; - - if(checked){ - jQuery(this).closest('form').find(':submit, :checkbox[name=activate]').removeAttr('disabled'); - }else{ - jQuery(this).closest('form').find(':submit, :checkbox[name=activate]').attr('disabled', 'disabled'); - } - - - }, - - download_downloads: function(){ - - var activate = jQuery(this).find(":checkbox:checked[name=activate]").val(), - action_button = jQuery(this).find('input[type="submit"]'); - downloads_form = jQuery(this), - idx = 0, - checkboxes = []; - - jQuery(this).find(':checkbox:checked[name="downloads[]"]').each(function(){ - if(jQuery(this).attr('disabled')) return; - checkboxes[idx] = jQuery(this); - idx++; - jQuery(this).attr('disabled', 'disabled'); - }); - - idx = 0; - - if( typeof checkboxes[idx] != 'undefined' ){ - download_and_activate( checkboxes[idx] ); - action_button.attr('disabled', 'disabled'); - } - - function download_and_activate( elem ){ - - var this_tr = elem.closest('tr'); - var is_update = this_tr.find('.installer-red-text').length; - if(is_update){ - var installing = this_tr.find('.installer-status-updating'); - var installed = this_tr.find('.installer-status-updated'); - }else{ - var installing = this_tr.find('.installer-status-installing'); - var installed = this_tr.find('.installer-status-installed'); - - } - if(activate){ - var activating = this_tr.find('.installer-status-activating'); - var activated = this_tr.find('.installer-status-activated'); - } - - if( this_tr.find('.for_spinner_js .spinner').length > 0 ){ - var spinner = this_tr.find('.for_spinner_js .spinner'); - }else{ - var spinner = this_tr.find('.installer-status-downloading'); - } - - otgs_wp_installer.reset_errors(); - downloads_form.find('div.installer-status-success').hide(); - spinner.css('visibility', 'visible'); - installing.show(); - - var plugin_name = this_tr.find('.installer_plugin_name').html(); - if(is_update){ - otgs_wp_installer.show_download_progress_status(downloads_form, installer_strings.updating.replace('%s', plugin_name)); - }else{ - otgs_wp_installer.show_download_progress_status(downloads_form, installer_strings.installing.replace('%s', plugin_name)); - } - - - data = { - action: 'installer_download_plugin', - data: elem.val(), - activate: activate, - reset_to_channel: downloads_form.find('input[name="reset-to-channel"]').val() - } - - otgs_wp_installer.plugins_update_XHR = jQuery.ajax({ - url: ajaxurl, - type: 'POST', - dataType: 'json', - data: data, - success: function(ret){ - installing.hide(); - - if(!ret.success){ - installed.addClass('installer-status-error'); - installed.html( - installed.data('fail') + - '' - ); - - if(ret.message){ - installed.closest('.otgs_wp_installer_table') - .find('.installer-error-box') - .html('

' + ret.message + '

') - .show(); - }else{ - installed.closest('.otgs_wp_installer_table') - .find('.installer-error-box') - .html('

' + downloads_form.find('.installer-revalidate-message').html() + '

') - .show(); - } - - downloads_form.trigger('installer-update-fail'); - } - - installed.show(); - spinner.fadeOut(); - - if(ret.version){ - var updated_version = '' + ret.version + ''; - if( ret.non_stable ){ - updated_version += ' (' + ret.non_stable + ')'; - } - this_tr.find('.installer_version_installed').html(updated_version); - } - - if(ret.success && activate){ - - otgs_wp_installer.show_download_progress_status(downloads_form, installer_strings.activating.replace('%s', plugin_name)); - activating.show(); - spinner.show(); - this_tr.find('.installer-red-text').removeClass('installer-red-text').addClass('installer-green-text').html(ret.version); - - jQuery.ajax({ - url: ajaxurl, - type: 'POST', - dataType: 'json', - data: {action: 'installer_activate_plugin', plugin_id: ret.plugin_id, nonce: ret.nonce}, - success: function(ret){ - activating.hide(); - if(!ret.error ){ - activated.show(); - } - - spinner.fadeOut(); - - idx++; - if( typeof checkboxes[idx] != 'undefined' ){ - download_and_activate( checkboxes[idx] ); - }else{ - otgs_wp_installer.hide_download_progress_status(downloads_form); - downloads_form.find('div.installer-status-success').show(); - action_button.removeAttr('disabled'); - - downloads_form.trigger('installer-update-complete'); - } - } - }); - }else{ - idx++; - if( typeof checkboxes[idx] != 'undefined' ){ - download_and_activate( checkboxes[idx] ); - }else{ - otgs_wp_installer.hide_download_progress_status(downloads_form); - downloads_form.find('div.installer-status-success').show(); - action_button.removeAttr('disabled'); - - downloads_form.trigger('installer-update-complete'); - - } - } - } - - }); - - }; - - return false; - }, - - show_download_progress_status: function(downloads_form, text){ - - downloads_form.find('.installer-download-progress-status').html(text).fadeIn(); - - }, - - hide_download_progress_status: function(downloads_form){ - - downloads_form.find('.installer-download-progress-status').html('').fadeOut(); - - }, - - dismiss_nag: function(){ - - var thisa = jQuery(this); - - data = {action: 'installer_dismiss_nag', repository: jQuery(this).data('repository')} - - jQuery.ajax({url: ajaxurl, type: 'POST', dataType:'json', data: data, success: - function(ret){ - thisa.closest('.otgs-is-dismissible').remove(); - } - }); - - return false; - }, - - toggle_subpackages: function(){ - var list = jQuery(this).closest('td').find('.otgs_wp_installer_subtable'); - - if(list.is(':visible')){ - list.slideUp('fast'); - }else{ - list.slideDown('fast'); - } - - - return false; - - }, - - scroll_to_repository: function(){ - - var ref = window.location.hash.replace('#', ''); - - if(ref) { - var split = ref.split('/'); - var repo = split[0]; - - if(typeof split[1] != 'undefined'){ - var package = split[1]; - var repo_element = jQuery('#repository-' + repo); - - - - if(repo_element.length){ - - jQuery('html, body').animate({ - scrollTop: repo_element.offset().top - }, 1000); - - var package_element = jQuery('#repository-' + repo +'_' + package); - - if(package_element.length && !package_element.is(':visible')){ - package_element.parents('.otgs_wp_installer_subtable').slideDown(); - package_element.addClass('installer_highlight_package'); - } - - package_element.find('.button-secondary').removeClass('button-secondary').addClass('button-primary'); - } - } - - } - - }, - - toggle_release_notes: function(){ - var handle = jQuery(this); - var tr = handle.closest('tr'); - if( tr.next('.installer-release-notes').is(':visible') ){ - handle.removeClass('extended'); - }else{ - handle.addClass('extended'); - } - tr.next('.installer-release-notes').fadeToggle(); - - return false; - } - - -} - - -jQuery(document).ready(otgs_wp_installer.init); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/channels.js b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/channels.js deleted file mode 100644 index 44b7faf..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/channels.js +++ /dev/null @@ -1,261 +0,0 @@ -(function($){ - - var updateErrors = []; - var channelUpdateInProgress = false; - - function channelSelectorInit(){ - - $('.otgs_wp_installer_table') - .on('focus', '.installer-channel-selector', saveCurrentValue) - .on('change', '.installer-channel-selector', maybeShowPrompt); - - $('.otgs_wp_installer_table') - .on('click', '.installer-channel-retry', retryChannelSwitch) - - $('.installer-switch-confirmation') - .on('click', '.js-cancel', cancelSwitch) - .on('click', '.js-proceed', changeChannel); - - $('.otgsi_downloads_form').on('installer-update-complete', maybeShowWarn); - $('.otgsi_downloads_form').on('installer-update-complete', hideUpdateProgress); - - $('.otgsi_downloads_form').on('installer-update-complete', showConfirmationMessage); - - $('.otgsi_downloads_form').on('installer-update-fail', logUpdateError); - - } - - function saveCurrentValue(){ - $(this).data('previous-value', $(this).val()); - } - - function maybeShowPrompt(){ - var selectorContainer = $(this).closest('.installer-channel-selector-wrap'); - var prompt = selectorContainer.find('.installer-switch-confirmation:hidden'); - - if(prompt.length){ - prompt.show(); - selectorContainer.find('select').prop('disabled', true); - var warnText = selectorContainer.find('.installer-warn-text'); - warnText.hide(); - }else{ - changeChannel(selectorContainer); - } - - } - - function changeChannel(selectorContainer){ - - if(selectorContainer.type == 'click'){ - var selectorContainer = $(this).closest('.installer-channel-selector-wrap'); - } - - var select = selectorContainer.find('select'); - select.prop('disabled', true); - - hideConfirmationMessage(select); - showUpdateProgress(select); - - selectorContainer.find('.installer-switch-confirmation').hide(); - - var data = { - action: 'installer_set_channel', - repository_id: select.data('repository-id'), - channel: select.val(), - nonce: select.parent().find('.nonce').val(), - noprompt: selectorContainer.find('.js-remember').length ? - selectorContainer.find('.js-remember').attr('checked') == 'checked' : 0 - } - - resetUpdateErrors(); - otgs_wp_installer.reset_errors(); - channelUpdateInProgress = true; - - // save selection - jQuery.ajax({ - url: ajaxurl, - type: 'POST', - dataType: 'json', - data: data, - success: function (ret) { - if( ret.status == 'OK'){ - var tableSelector = '#installer_repo_' + select.data('repository-id') + ' .installer-table-wrap'; - $(tableSelector).load( location.href + ' ' + tableSelector + ' table.widefat', function(){ - - var upgradesCount = $(tableSelector).find('tr .installer-red-text').length - || select.val() == 1 && $(tableSelector).find('td.installer_version_installed .unstable').length; - if( upgradesCount > 0){ - automaticUpgrade(tableSelector); - }else{ - $('#installer_repo_' + select.data('repository-id') + ' .otgsi_downloads_form') - .trigger('installer-update-complete'); - } - - select.prop('disabled', false); - } ); - } - - } - - }); - - } - - function retryChannelSwitch(){ - var selectorContainer = $(this).closest('.installer-channel-selector-wrap'); - changeChannel(selectorContainer); - return false; - } - - function cancelSwitch(){ - $(this).closest('.installer-switch-confirmation').hide(); - var select = $(this).closest('.installer-switch-confirmation').prev().find('.installer-channel-selector'); - var previousValue = select.data('previous-value'); - - select.val(previousValue).prop('disabled', false); - - if( select.val() > 1){ - var selectorContainer = $(this).closest('.installer-channel-selector-wrap'); - var warnText = selectorContainer.find('.installer-warn-text'); - warnText.show(); - } - - } - - function automaticUpgrade(downloadsTable){ - $(downloadsTable + ' tr').each( - function () { - var needsUpgrade = $(this).find( - 'td.installer_version_installed .installer-red-text, ' + - 'td.installer_version_installed .unstable' - ).length > 0; - if (needsUpgrade) { - $(this).find('td :checkbox').prop('disabled', false).prop('checked', true); - } - } - ); - - $(downloadsTable) - .closest('form') - .append('') - .submit(); - - } - - function maybeShowWarn(){ - - var select = $(this) - .closest('.otgs_wp_installer_table') - .find('.installer-channel-selector') - - if(select.val() > 1 && !hasUpdateErrors()){ - - var warnText = select - .closest('.installer-channel-selector-wrap') - .find('.installer-warn-text'); - warnText.show(); - - } - - - } - - function showUpdateProgress(select){ - - var spinner = select - .closest('.installer-channel-selector-wrap') - .find('.spinner-with-text'); - - spinner.addClass('is-active').show(); - - } - - function hideUpdateProgress(){ - - var spinner = $(this) - .closest('.otgs_wp_installer_table') - .find('.installer-channel-selector-wrap') - .find('.spinner-with-text'); - - spinner.removeClass('is-active').hide(); - - } - - function showConfirmationMessage(){ - - if( ! channelUpdateInProgress ) return false; - - var selectWrap = $(this) - .closest('.otgs_wp_installer_table') - .find('.installer-channel-selector-wrap'); - - var select = $(this) - .closest('.otgs_wp_installer_table') - .find('.installer-channel-selector'); - - var channelName = select.find('option:selected').text(); - - if( hasUpdateErrors() ) { - - var message = selectWrap.find('.installer-channel-update-fail'); - // suppress default errors - $(this).closest('.otgs_wp_installer_table').find('.installer-error-box').hide(); - - var channelType = select.val() == 1 ? 'stable' : 'unstable'; - message.html(message.data('text-' + channelType).replace(/%CHANNEL%/, channelName)); - - }else{ - - var message = selectWrap.find('.installer-channel-update-ok'); - message.html(message.data('text').replace(/%CHANNEL%/, channelName)); - } - - message.show(); - - channelUpdateInProgress = false; - } - - function hideConfirmationMessage(select){ - - var selectWrap = select.closest('.installer-channel-selector-wrap'); - if( hasUpdateErrors() ){ - var message = selectWrap.find('.installer-channel-update-fail'); - }else{ - var message = selectWrap.find('.installer-channel-update-ok'); - } - - message.hide(); - } - - /* - function showFailureMessage(download_form){ - var message = download_form - .closest('.otgs_wp_installer_table') - .find('.installer-channel-selector-wrap') - .find('.installer-channel-update-fail'); - - var channelName = $(this) - .closest('.otgs_wp_installer_table') - .find('.installer-channel-selector option:selected') - .text(); - - message.html( message.data('text').replace(/%CHANNEL%/, channelName) ); - message.show(); - } - */ - - function logUpdateError(){ - updateErrors.push(1); - } - - function resetUpdateErrors(){ - updateErrors = []; - } - - function hasUpdateErrors() { - return updateErrors.length; - } - - $(document).ready( channelSelectorInit ); - -})(jQuery) \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/iframeResizer.min.js b/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/iframeResizer.min.js deleted file mode 100644 index c6c2b18..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/otgs/installer/res/js/iframeResizer.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! iFrame Resizer (iframeSizer.min.js ) - v2.6.1 - 2014-09-03 - * Desc: Force cross domain iframes to size to content. - * Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame. - * Copyright: (c) 2014 David J. Bradshaw - dave@bradshaw.net - * License: MIT - */ - -!function(){"use strict";function a(a,b,c){"addEventListener"in window?a.addEventListener(b,c,!1):"attachEvent"in window&&a.attachEvent("on"+b,c)}function b(){var a,b=["moz","webkit","o","ms"];for(a=0;ab)throw new Error("Value for min"+a+" can not be greater than max"+a);c(" Checking "+e+" is in range "+d+"-"+b),d>f&&(f=d,c(" Set "+e+" to min value")),f>b&&(f=b,c(" Set "+e+" to max value")),z[e]=""+f}function k(){var b=a.origin,d=z.iframe.src.split("/").slice(0,3).join("/");if(y.checkOrigin&&(c(" Checking connection is from: "+d),""+b!="null"&&b!==d))throw new Error("Unexpected message received from: "+b+" for "+z.iframe.id+". Message was: "+a.data+". This error can be disabled by adding the checkOrigin: false option.");return!0}function l(){return s===(""+x).substr(0,t)}function m(){var a=z.type in{"true":1,"false":1};return a&&c(" Ignoring init message from meta parent page"),a}function n(){var a=x.substr(x.indexOf(":")+r+6);c(" MessageCallback passed: {iframe: "+z.iframe.id+", message: "+a+"}"),y.messageCallback({iframe:z.iframe,message:a}),c(" --")}function o(){if(null===z.iframe)throw new Error("iFrame ("+z.id+") does not exist on "+u);return!0}function q(){c(" Reposition requested from iFrame"),v={x:z.width,y:z.height},f()}function w(){switch(z.type){case"close":d(z.iframe),y.resizedCallback(z);break;case"message":n();break;case"scrollTo":q();break;case"reset":g(z);break;case"init":b(),y.initCallback(z.iframe);break;default:b()}}var x=a.data,z={};l()&&(c(" Received: "+x),z=e(),j("Height"),j("Width"),!m()&&o()&&k()&&(w(),p=!1))}function e(){null===v&&(v={x:void 0!==window.pageXOffset?window.pageXOffset:document.documentElement.scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop},c(" Get position: "+v.x+","+v.y))}function f(){null!==v&&(window.scrollTo(v.x,v.y),c(" Set position: "+v.x+","+v.y),v=null)}function g(a){function b(){h(a),j("reset","reset",a.iframe)}c(" Size reset requested by "+("init"===a.type?"host page":"iFrame")),e(),i(b,a,"init")}function h(a){function b(b){a.iframe.style[b]=a[b]+"px",c(" IFrame ("+a.iframe.id+") "+b+" set to "+a[b]+"px")}y.sizeHeight&&b("height"),y.sizeWidth&&b("width")}function i(a,b,d){d!==b.type&&w?(c(" Requesting animation frame"),w(a)):a()}function j(a,b,d){c("["+a+"] Sending msg to iframe ("+b+")"),d.contentWindow.postMessage(s+b,"*")}function k(){function b(){function a(a){1/0!==y[a]&&0!==y[a]&&(k.style[a]=y[a]+"px",c(" Set "+a+" = "+y[a]+"px"))}a("maxHeight"),a("minHeight"),a("maxWidth"),a("minWidth")}function d(a){return""===a&&(k.id=a="iFrameResizer"+o++,c(" Added missing iframe ID: "+a+" ("+k.src+")")),a}function e(){c(" IFrame scrolling "+(y.scrolling?"enabled":"disabled")+" for "+l),k.style.overflow=!1===y.scrolling?"hidden":"auto",k.scrolling=!1===y.scrolling?"no":"yes"}function f(){("number"==typeof y.bodyMargin||"0"===y.bodyMargin)&&(y.bodyMarginV1=y.bodyMargin,y.bodyMargin=""+y.bodyMargin+"px")}function h(){return l+":"+y.bodyMarginV1+":"+y.sizeWidth+":"+y.log+":"+y.interval+":"+y.enablePublicMethods+":"+y.autoResize+":"+y.bodyMargin+":"+y.heightCalculationMethod+":"+y.bodyBackground+":"+y.bodyPadding+":"+y.tolerance}function i(b){a(k,"load",function(){var a=p;j("iFrame.onload",b,k),!a&&y.heightCalculationMethod in x&&g({iframe:k,height:0,width:0,type:"init"})}),j("init",b,k)}var k=this,l=d(k.id);e(),b(),f(),i(h())}function l(a){if("object"!=typeof a)throw new TypeError("Options is not an object.")}function m(){function a(a){if("IFRAME"!==a.tagName.toUpperCase())throw new TypeError("Expected ': -"");a._keyEvent=false;return K},_generateMonthYearHeader:function(a,d,h,i,j,n,q,l){var k=this._get(a,"changeMonth"),m=this._get(a,"changeYear"),o=this._get(a,"showMonthAfterYear"),p='
',s="";if(n||!k)s+=''+q[d]+"";else{q=i&&i.getFullYear()==h;var r=j&&j.getFullYear()==h;s+='"}o||(p+=s+(n||!(k&&m)?" ":""));if(n||!m)p+=''+h+"";else{l=this._get(a,"yearRange").split(":");var v=(new Date).getFullYear();q=function(w){w=w.match(/c[+-].*/)?h+parseInt(w.substring(1),10):w.match(/[+-].*/)?v+parseInt(w,10):parseInt(w,10);return isNaN(w)?v:w};d=q(l[0]);l=Math.max(d, -q(l[1]||""));d=i?Math.max(d,i.getFullYear()):d;l=j?Math.min(l,j.getFullYear()):l;for(p+='"}p+=this._get(a,"yearSuffix");if(o)p+=(n||!(k&&m)?" ":"")+s;p+="
";return p},_adjustInstDate:function(a,d,h){var i= -a.drawYear+(h=="Y"?d:0),j=a.drawMonth+(h=="M"?d:0);d=Math.min(a.selectedDay,this._getDaysInMonth(i,j))+(h=="D"?d:0);i=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(i,j,d)));a.selectedDay=i.getDate();a.drawMonth=a.selectedMonth=i.getMonth();a.drawYear=a.selectedYear=i.getFullYear();if(h=="M"||h=="Y")this._notifyChange(a)},_restrictMinMax:function(a,d){var h=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");d=h&&da?a:d},_notifyChange:function(a){var d=this._get(a, -"onChangeMonthYear");if(d)d.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,d){return this._determineDate(a,this._get(a,d+"Date"),null)},_getDaysInMonth:function(a,d){return 32-(new Date(a,d,32)).getDate()},_getFirstDayOfMonth:function(a,d){return(new Date(a,d,1)).getDay()},_canAdjustMonth:function(a,d,h,i){var j=this._getNumberOfMonths(a); -h=this._daylightSavingAdjust(new Date(h,i+(d<0?d:j[0]*j[1]),1));d<0&&h.setDate(this._getDaysInMonth(h.getFullYear(),h.getMonth()));return this._isInRange(a,h)},_isInRange:function(a,d){var h=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!h||d.getTime()>=h.getTime())&&(!a||d.getTime()<=a.getTime())},_getFormatConfig:function(a){var d=this._get(a,"shortYearCutoff");d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);return{shortYearCutoff:d,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,d,h,i){if(!d){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}d=d?typeof d=="object"?d:this._daylightSavingAdjust(new Date(i,h,d)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),d,this._getFormatConfig(a))}});b.fn.datepicker= -function(a){if(!b.datepicker.initialized){b(document).mousedown(b.datepicker._checkExternalClick).find("body").append(b.datepicker.dpDiv);b.datepicker.initialized=true}var d=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(d));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(d)); -return this.each(function(){typeof a=="string"?b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this].concat(d)):b.datepicker._attachDatepicker(this,a)})};b.datepicker=new f;b.datepicker.initialized=false;b.datepicker.uuid=(new Date).getTime();b.datepicker.version="1.8.6";window["DP_jQuery_"+e]=b})(jQuery); -(function(b,c){var f={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},g={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};b.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var a=b(this).css(e).offset().top; -a<0&&b(this).css("top",e.top-a)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var e=this,a=e.options,d=a.title||" ",h=b.ui.dialog.getTitleId(e.element),i=(e.uiDialog=b("
")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+a.dialogClass).css({zIndex:a.zIndex}).attr("tabIndex", --1).css("outline",0).keydown(function(q){if(a.closeOnEscape&&q.keyCode&&q.keyCode===b.ui.keyCode.ESCAPE){e.close(q);q.preventDefault()}}).attr({role:"dialog","aria-labelledby":h}).mousedown(function(q){e.moveToTop(false,q)});e.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(i);var j=(e.uiDialogTitlebar=b("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(i),n=b('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", -"button").hover(function(){n.addClass("ui-state-hover")},function(){n.removeClass("ui-state-hover")}).focus(function(){n.addClass("ui-state-focus")}).blur(function(){n.removeClass("ui-state-focus")}).click(function(q){e.close(q);return false}).appendTo(j);(e.uiDialogTitlebarCloseText=b("")).addClass("ui-icon ui-icon-closethick").text(a.closeText).appendTo(n);b("").addClass("ui-dialog-title").attr("id",h).html(d).prependTo(j);if(b.isFunction(a.beforeclose)&&!b.isFunction(a.beforeClose))a.beforeClose= -a.beforeclose;j.find("*").add(j).disableSelection();a.draggable&&b.fn.draggable&&e._makeDraggable();a.resizable&&b.fn.resizable&&e._makeResizable();e._createButtons(a.buttons);e._isOpen=false;b.fn.bgiframe&&i.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var e=this;e.overlay&&e.overlay.destroy();e.uiDialog.hide();e.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");e.uiDialog.remove();e.originalTitle&& -e.element.attr("title",e.originalTitle);return e},widget:function(){return this.uiDialog},close:function(e){var a=this,d;if(false!==a._trigger("beforeClose",e)){a.overlay&&a.overlay.destroy();a.uiDialog.unbind("keypress.ui-dialog");a._isOpen=false;if(a.options.hide)a.uiDialog.hide(a.options.hide,function(){a._trigger("close",e)});else{a.uiDialog.hide();a._trigger("close",e)}b.ui.dialog.overlay.resize();if(a.options.modal){d=0;b(".ui-dialog").each(function(){if(this!==a.uiDialog[0])d=Math.max(d,b(this).css("z-index"))}); -b.ui.dialog.maxZ=d}return a}},isOpen:function(){return this._isOpen},moveToTop:function(e,a){var d=this,h=d.options;if(h.modal&&!e||!h.stack&&!h.modal)return d._trigger("focus",a);if(h.zIndex>b.ui.dialog.maxZ)b.ui.dialog.maxZ=h.zIndex;if(d.overlay){b.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=b.ui.dialog.maxZ)}e={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};b.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",b.ui.dialog.maxZ);d.element.attr(e); -d._trigger("focus",a);return d},open:function(){if(!this._isOpen){var e=this,a=e.options,d=e.uiDialog;e.overlay=a.modal?new b.ui.dialog.overlay(e):null;e._size();e._position(a.position);d.show(a.show);e.moveToTop(true);a.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode===b.ui.keyCode.TAB){var i=b(":tabbable",this),j=i.filter(":first");i=i.filter(":last");if(h.target===i[0]&&!h.shiftKey){j.focus(1);return false}else if(h.target===j[0]&&h.shiftKey){i.focus(1);return false}}});b(e.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(); -e._isOpen=true;e._trigger("open");return e}},_createButtons:function(e){var a=this,d=false,h=b("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),i=b("
").addClass("ui-dialog-buttonset").appendTo(h);a.uiDialog.find(".ui-dialog-buttonpane").remove();typeof e==="object"&&e!==null&&b.each(e,function(){return!(d=true)});if(d){b.each(e,function(j,n){n=b.isFunction(n)?{click:n,text:j}:n;j=b('').attr(n,true).unbind("click").click(function(){n.click.apply(a.element[0], -arguments)}).appendTo(i);b.fn.button&&j.button()});h.appendTo(a.uiDialog)}},_makeDraggable:function(){function e(j){return{position:j.position,offset:j.offset}}var a=this,d=a.options,h=b(document),i;a.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(j,n){i=d.height==="auto"?"auto":b(this).height();b(this).height(b(this).height()).addClass("ui-dialog-dragging");a._trigger("dragStart",j,e(n))},drag:function(j, -n){a._trigger("drag",j,e(n))},stop:function(j,n){d.position=[n.position.left-h.scrollLeft(),n.position.top-h.scrollTop()];b(this).removeClass("ui-dialog-dragging").height(i);a._trigger("dragStop",j,e(n));b.ui.dialog.overlay.resize()}})},_makeResizable:function(e){function a(j){return{originalPosition:j.originalPosition,originalSize:j.originalSize,position:j.position,size:j.size}}e=e===c?this.options.resizable:e;var d=this,h=d.options,i=d.uiDialog.css("position");e=typeof e==="string"?e:"n,e,s,w,se,sw,ne,nw"; -d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:h.maxWidth,maxHeight:h.maxHeight,minWidth:h.minWidth,minHeight:d._minHeight(),handles:e,start:function(j,n){b(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",j,a(n))},resize:function(j,n){d._trigger("resize",j,a(n))},stop:function(j,n){b(this).removeClass("ui-dialog-resizing");h.height=b(this).height();h.width=b(this).width();d._trigger("resizeStop",j,a(n));b.ui.dialog.overlay.resize()}}).css("position", -i).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(e){var a=[],d=[0,0],h;if(e){if(typeof e==="string"||typeof e==="object"&&"0"in e){a=e.split?e.split(" "):[e[0],e[1]];if(a.length===1)a[1]=a[0];b.each(["left","top"],function(i,j){if(+a[i]===a[i]){d[i]=a[i];a[i]=j}});e={my:a.join(" "),at:a.join(" "),offset:d.join(" ")}}e=b.extend({},b.ui.dialog.prototype.options.position, -e)}else e=b.ui.dialog.prototype.options.position;(h=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(e);h||this.uiDialog.hide()},_setOptions:function(e){var a=this,d={},h=false;b.each(e,function(i,j){a._setOption(i,j);if(i in f)h=true;if(i in g)d[i]=j});h&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(e,a){var d=this,h=d.uiDialog;switch(e){case "beforeclose":e="beforeClose";break;case "buttons":d._createButtons(a); -break;case "closeText":d.uiDialogTitlebarCloseText.text(""+a);break;case "dialogClass":h.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+a);break;case "disabled":a?h.addClass("ui-dialog-disabled"):h.removeClass("ui-dialog-disabled");break;case "draggable":var i=h.is(":data(draggable)");i&&!a&&h.draggable("destroy");!i&&a&&d._makeDraggable();break;case "position":d._position(a);break;case "resizable":(i=h.is(":data(resizable)"))&&!a&&h.resizable("destroy"); -i&&typeof a==="string"&&h.resizable("option","handles",a);!i&&a!==false&&d._makeResizable(a);break;case "title":b(".ui-dialog-title",d.uiDialogTitlebar).html(""+(a||" "));break}b.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var e=this.options,a,d;this.element.show().css({width:"auto",minHeight:0,height:0});if(e.minWidth>e.width)e.width=e.minWidth;a=this.uiDialog.css({height:"auto",width:e.width}).height();d=Math.max(0,e.minHeight-a);if(e.height==="auto")if(b.support.minHeight)this.element.css({minHeight:d, -height:"auto"});else{this.uiDialog.show();e=this.element.css("height","auto").height();this.uiDialog.hide();this.element.height(Math.max(e,d))}else this.element.height(Math.max(e.height-a,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});b.extend(b.ui.dialog,{version:"1.8.6",uuid:0,maxZ:0,getTitleId:function(e){e=e.attr("id");if(!e){this.uuid+=1;e=this.uuid}return"ui-dialog-title-"+e},overlay:function(e){this.$el=b.ui.dialog.overlay.create(e)}}); -b.extend(b.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){b.ui.dialog.overlay.instances.length&&b(document).bind(b.ui.dialog.overlay.events,function(d){if(b(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});b.fn.bgiframe&&a.bgiframe();this.instances.push(a);return a},destroy:function(e){this.oldInstances.push(this.instances.splice(b.inArray(e,this.instances),1)[0]);this.instances.length===0&&b([document,window]).unbind(".dialog-overlay"); -e.remove();var a=0;b.each(this.instances,function(){a=Math.max(a,this.css("z-index"))});this.maxZ=a},height:function(){var e,a;if(b.browser.msie&&b.browser.version<7){e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);a=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return e0? -a.left-h:Math.max(a.left-d.collisionPosition.left,a.left)},top:function(a,d){var h=b(window);h=d.collisionPosition.top+d.collisionHeight-h.height()-h.scrollTop();a.top=h>0?a.top-h:Math.max(a.top-d.collisionPosition.top,a.top)}},flip:{left:function(a,d){if(d.at[0]!=="center"){var h=b(window);h=d.collisionPosition.left+d.collisionWidth-h.width()-h.scrollLeft();var i=d.my[0]==="left"?-d.elemWidth:d.my[0]==="right"?d.elemWidth:0,j=d.at[0]==="left"?d.targetWidth:-d.targetWidth,n=-2*d.offset[0];a.left+= -d.collisionPosition.left<0?i+j+n:h>0?i+j+n:0}},top:function(a,d){if(d.at[1]!=="center"){var h=b(window);h=d.collisionPosition.top+d.collisionHeight-h.height()-h.scrollTop();var i=d.my[1]==="top"?-d.elemHeight:d.my[1]==="bottom"?d.elemHeight:0,j=d.at[1]==="top"?d.targetHeight:-d.targetHeight,n=-2*d.offset[1];a.top+=d.collisionPosition.top<0?i+j+n:h>0?i+j+n:0}}}};if(!b.offset.setOffset){b.offset.setOffset=function(a,d){if(/static/.test(b.curCSS(a,"position")))a.style.position="relative";var h=b(a), -i=h.offset(),j=parseInt(b.curCSS(a,"top",true),10)||0,n=parseInt(b.curCSS(a,"left",true),10)||0;i={top:d.top-i.top+j,left:d.left-i.left+n};"using"in d?d.using.call(a,i):h.css(i)};b.fn.offset=function(a){var d=this[0];if(!d||!d.ownerDocument)return null;if(a)return this.each(function(){b.offset.setOffset(this,a)});return e.call(this)}}})(jQuery); -(function(b,c){b.widget("ui.progressbar",{options:{value:0},min:0,max:100,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this._value()});this.valueDiv=b("
").appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(f){if(f===c)return this._value();this._setOption("value",f);return this},_setOption:function(f,g){if(f==="value"){this.options.value=g;this._refreshValue();this._trigger("change");this._value()===this.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var f=this.options.value;if(typeof f!=="number")f=0;return Math.min(this.max,Math.max(this.min,f))},_refreshValue:function(){var f= -this.value();this.valueDiv.toggleClass("ui-corner-right",f===this.max).width(f+"%");this.element.attr("aria-valuenow",f)}});b.extend(b.ui.progressbar,{version:"1.8.6"})})(jQuery); -(function(b){b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,f=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");f.disabled&&this.element.addClass("ui-slider-disabled ui-disabled"); -this.range=b([]);if(f.range){if(f.range===true){this.range=b("
");if(!f.values)f.values=[this._valueMin(),this._valueMin()];if(f.values.length&&f.values.length!==2)f.values=[f.values[0],f.values[0]]}else this.range=b("
");this.range.appendTo(this.element).addClass("ui-slider-range");if(f.range==="min"||f.range==="max")this.range.addClass("ui-slider-range-"+f.range);this.range.addClass("ui-widget-header")}b(".ui-slider-handle",this.element).length===0&&b("").appendTo(this.element).addClass("ui-slider-handle"); -if(f.values&&f.values.length)for(;b(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){f.disabled||b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(f.disabled)b(this).blur(); -else{b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(g){b(this).data("index.ui-slider-handle",g)});this.handles.keydown(function(g){var e=true,a=b(this).data("index.ui-slider-handle"),d,h,i;if(!c.options.disabled){switch(g.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:e= -false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");d=c._start(g,a);if(d===false)return}break}i=c.options.step;d=c.options.values&&c.options.values.length?(h=c.values(a)):(h=c.value());switch(g.keyCode){case b.ui.keyCode.HOME:h=c._valueMin();break;case b.ui.keyCode.END:h=c._valueMax();break;case b.ui.keyCode.PAGE_UP:h=c._trimAlignValue(d+(c._valueMax()-c._valueMin())/5);break;case b.ui.keyCode.PAGE_DOWN:h=c._trimAlignValue(d-(c._valueMax()-c._valueMin())/5);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(d=== -c._valueMax())return;h=c._trimAlignValue(d+i);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(d===c._valueMin())return;h=c._trimAlignValue(d-i);break}c._slide(g,a,h);return e}}).keyup(function(g){var e=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(g,e);c._change(g,e);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(c){var f=this.options,g,e,a,d,h;if(f.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();g=this._normValueFromMouse({x:c.pageX,y:c.pageY});e=this._valueMax()-this._valueMin()+1;d=this;this.handles.each(function(i){var j=Math.abs(g-d.values(i));if(e>j){e=j;a=b(this);h=i}});if(f.range===true&&this.values(1)===f.min){h+=1;a=b(this.handles[h])}if(this._start(c, -h)===false)return false;this._mouseSliding=true;d._handleIndex=h;a.addClass("ui-state-active").focus();f=a.offset();this._clickOffset=!b(c.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:c.pageX-f.left-a.width()/2,top:c.pageY-f.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)};this._slide(c,h,g);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(c){var f= -this._normValueFromMouse({x:c.pageX,y:c.pageY});this._slide(c,this._handleIndex,f);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(c){var f;if(this.orientation==="horizontal"){f= -this.elementSize.width;c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{f=this.elementSize.height;c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}f=c/f;if(f>1)f=1;if(f<0)f=0;if(this.orientation==="vertical")f=1-f;c=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+f*c)},_start:function(c,f){var g={handle:this.handles[f],value:this.value()};if(this.options.values&&this.options.values.length){g.value=this.values(f); -g.values=this.values()}return this._trigger("start",c,g)},_slide:function(c,f,g){var e;if(this.options.values&&this.options.values.length){e=this.values(f?0:1);if(this.options.values.length===2&&this.options.range===true&&(f===0&&g>e||f===1&&g1){this.options.values[c]=this._trimAlignValue(f);this._refreshValue();this._change(null,c)}if(arguments.length)if(b.isArray(arguments[0])){g=this.options.values;e=arguments[0];for(a=0;athis._valueMax())return this._valueMax();var f=this.options.step>0?this.options.step:1,g=c%f;c=c-g;if(Math.abs(g)*2>=f)c+=g>0?f:-f;return parseFloat(c.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var c= -this.options.range,f=this.options,g=this,e=!this._animateOff?f.animate:false,a,d={},h,i,j,n;if(this.options.values&&this.options.values.length)this.handles.each(function(q){a=(g.values(q)-g._valueMin())/(g._valueMax()-g._valueMin())*100;d[g.orientation==="horizontal"?"left":"bottom"]=a+"%";b(this).stop(1,1)[e?"animate":"css"](d,f.animate);if(g.options.range===true)if(g.orientation==="horizontal"){if(q===0)g.range.stop(1,1)[e?"animate":"css"]({left:a+"%"},f.animate);if(q===1)g.range[e?"animate":"css"]({width:a- -h+"%"},{queue:false,duration:f.animate})}else{if(q===0)g.range.stop(1,1)[e?"animate":"css"]({bottom:a+"%"},f.animate);if(q===1)g.range[e?"animate":"css"]({height:a-h+"%"},{queue:false,duration:f.animate})}h=a});else{i=this.value();j=this._valueMin();n=this._valueMax();a=n!==j?(i-j)/(n-j)*100:0;d[g.orientation==="horizontal"?"left":"bottom"]=a+"%";this.handle.stop(1,1)[e?"animate":"css"](d,f.animate);if(c==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:a+"%"}, -f.animate);if(c==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-a+"%"},{queue:false,duration:f.animate});if(c==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:a+"%"},f.animate);if(c==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-a+"%"},{queue:false,duration:f.animate})}}});b.extend(b.ui.slider,{version:"1.8.6"})})(jQuery); -(function(b,c){function f(){return++e}function g(){return++a}var e=0,a=0;b.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(d,h){if(d=="selected")this.options.collapsible&& -h==this.options.selected||this.select(h);else{this.options[d]=h;this._tabify()}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+f()},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:")},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+g());return b.cookie.apply(null,[d].concat(b.makeArray(arguments)))},_ui:function(d,h){return{tab:d,panel:h,index:this.anchors.index(d)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d= -b(this);d.html(d.data("label.tabs")).removeData("label.tabs")})},_tabify:function(d){function h(r,u){r.css("display","");!b.support.opacity&&u.opacity&&r[0].style.removeAttribute("filter")}var i=this,j=this.options,n=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=b(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return b("a",this)[0]});this.panels=b([]);this.anchors.each(function(r,u){var v=b(u).attr("href"),w=v.split("#")[0],y;if(w&&(w===location.toString().split("#")[0]|| -(y=b("base")[0])&&w===y.href)){v=u.hash;u.href=v}if(n.test(v))i.panels=i.panels.add(i._sanitizeSelector(v));else if(v&&v!=="#"){b.data(u,"href.tabs",v);b.data(u,"load.tabs",v.replace(/#.*$/,""));v=i._tabId(u);u.href="#"+v;u=b("#"+v);if(!u.length){u=b(j.panelTemplate).attr("id",v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(i.panels[r-1]||i.list);u.data("destroy.tabs",true)}i.panels=i.panels.add(u)}else j.disabled.push(r)});if(d){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===c){location.hash&&this.anchors.each(function(r,u){if(u.hash==location.hash){j.selected=r;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(i._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=b.unique(j.disabled.concat(b.map(this.lis.filter(".ui-state-disabled"),function(r){return i.lis.index(r)}))).sort();b.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(b.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(j.selected>=0&&this.anchors.length){b(i._sanitizeSelector(i.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");i.element.queue("tabs",function(){i._trigger("show",null,i._ui(i.anchors[j.selected],b(i._sanitizeSelector(i.anchors[j.selected].hash))))});this.load(j.selected)}b(window).bind("unload",function(){i.lis.add(i.anchors).unbind(".tabs");i.lis=i.anchors=i.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);d=0;for(var q;q=this.lis[d];d++)b(q)[b.inArray(d,j.disabled)!=-1&&!b(q).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var l=function(r,u){u.is(":not(.ui-state-disabled)")&&u.addClass("ui-state-"+r)},k=function(r,u){u.removeClass("ui-state-"+ -r)};this.lis.bind("mouseover.tabs",function(){l("hover",b(this))});this.lis.bind("mouseout.tabs",function(){k("hover",b(this))});this.anchors.bind("focus.tabs",function(){l("focus",b(this).closest("li"))});this.anchors.bind("blur.tabs",function(){k("focus",b(this).closest("li"))})}var m,o;if(j.fx)if(b.isArray(j.fx)){m=j.fx[0];o=j.fx[1]}else m=o=j.fx;var p=o?function(r,u){b(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){h(u,o);i._trigger("show",null,i._ui(r,u[0]))})}:function(r,u){b(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.removeClass("ui-tabs-hide");i._trigger("show",null,i._ui(r,u[0]))},s=m?function(r,u){u.animate(m,m.duration||"normal",function(){i.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");h(u,m);i.element.dequeue("tabs")})}:function(r,u){i.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");i.element.dequeue("tabs")}; -this.anchors.bind(j.event+".tabs",function(){var r=this,u=b(r).closest("li"),v=i.panels.filter(":not(.ui-tabs-hide)"),w=b(i._sanitizeSelector(r.hash));if(u.hasClass("ui-tabs-selected")&&!j.collapsible||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||i.panels.filter(":animated").length||i._trigger("select",null,i._ui(this,w[0]))===false){this.blur();return false}j.selected=i.anchors.index(this);i.abort();if(j.collapsible)if(u.hasClass("ui-tabs-selected")){j.selected=-1;j.cookie&& -i._cookie(j.selected,j.cookie);i.element.queue("tabs",function(){s(r,v)}).dequeue("tabs");this.blur();return false}else if(!v.length){j.cookie&&i._cookie(j.selected,j.cookie);i.element.queue("tabs",function(){p(r,w)});i.load(i.anchors.index(this));this.blur();return false}j.cookie&&i._cookie(j.selected,j.cookie);if(w.length){v.length&&i.element.queue("tabs",function(){s(r,v)});i.element.queue("tabs",function(){p(r,w)});i.load(i.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -b.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(d){if(typeof d=="string")d=this.anchors.index(this.anchors.filter("[href$="+d+"]"));return d},destroy:function(){var d=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var h= -b.data(this,"href.tabs");if(h)this.href=h;var i=b(this).unbind(".tabs");b.each(["href","load","cache"],function(j,n){i.removeData(n+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){b.data(this,"destroy.tabs")?b(this).remove():b(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});d.cookie&&this._cookie(null,d.cookie);return this},add:function(d, -h,i){if(i===c)i=this.anchors.length;var j=this,n=this.options;h=b(n.tabTemplate.replace(/#\{href\}/g,d).replace(/#\{label\}/g,h));d=!d.indexOf("#")?d.replace("#",""):this._tabId(b("a",h)[0]);h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var q=b("#"+d);q.length||(q=b(n.panelTemplate).attr("id",d).data("destroy.tabs",true));q.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(i>=this.lis.length){h.appendTo(this.list);q.appendTo(this.list[0].parentNode)}else{h.insertBefore(this.lis[i]); -q.insertBefore(this.panels[i])}n.disabled=b.map(n.disabled,function(l){return l>=i?++l:l});this._tabify();if(this.anchors.length==1){n.selected=0;h.addClass("ui-tabs-selected ui-state-active");q.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[i],this.panels[i]));return this},remove:function(d){d=this._getIndex(d);var h=this.options,i=this.lis.eq(d).remove(),j=this.panels.eq(d).remove(); -if(i.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(d+(d+1=d?--n:n});this._tabify();this._trigger("remove",null,this._ui(i.find("a")[0],j[0]));return this},enable:function(d){d=this._getIndex(d);var h=this.options;if(b.inArray(d,h.disabled)!=-1){this.lis.eq(d).removeClass("ui-state-disabled");h.disabled=b.grep(h.disabled,function(i){return i!=d});this._trigger("enable",null, -this._ui(this.anchors[d],this.panels[d]));return this}},disable:function(d){d=this._getIndex(d);var h=this.options;if(d!=h.selected){this.lis.eq(d).addClass("ui-state-disabled");h.disabled.push(d);h.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[d],this.panels[d]))}return this},select:function(d){d=this._getIndex(d);if(d==-1)if(this.options.collapsible&&this.options.selected!=-1)d=this.options.selected;else return this;this.anchors.eq(d).trigger(this.options.event+".tabs");return this}, -load:function(d){d=this._getIndex(d);var h=this,i=this.options,j=this.anchors.eq(d)[0],n=b.data(j,"load.tabs");this.abort();if(!n||this.element.queue("tabs").length!==0&&b.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(d).addClass("ui-state-processing");if(i.spinner){var q=b("span",j);q.data("label.tabs",q.html()).html(i.spinner)}this.xhr=b.ajax(b.extend({},i.ajaxOptions,{url:n,success:function(l,k){b(h._sanitizeSelector(j.hash)).html(l);h._cleanup();i.cache&&b.data(j,"cache.tabs", -true);h._trigger("load",null,h._ui(h.anchors[d],h.panels[d]));try{i.ajaxOptions.success(l,k)}catch(m){}},error:function(l,k){h._cleanup();h._trigger("load",null,h._ui(h.anchors[d],h.panels[d]));try{i.ajaxOptions.error(l,k,d,j)}catch(m){}}}));h.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(d, -h){this.anchors.eq(d).removeData("cache.tabs").data("load.tabs",h);return this},length:function(){return this.anchors.length}});b.extend(b.ui.tabs,{version:"1.8.6"});b.extend(b.ui.tabs.prototype,{rotation:null,rotate:function(d,h){var i=this,j=this.options,n=i._rotate||(i._rotate=function(q){clearTimeout(i.rotation);i.rotation=setTimeout(function(){var l=j.selected;i.select(++l"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return n=!a&&o.length?e.widget.extend.apply(null,[n].concat(o)):n,a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))}),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
    ",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):t.which?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("
    "),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.widthi?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,e.top+p+f+m>u&&(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>d&&(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.1",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.length&&(!t.length||e.index()",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1 -}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(t.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.find(this.options.items).filter(function(){return r.test(e(this).text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(t.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.find(this.options.items).filter(function(){return r.test(e(this).text())})),s.length?(this.focus(t,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("
      ").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("
      ").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("
      ").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.1",defaultElement:"").addClass(this._triggerClass).html(a?e("").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e(""),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s)) -}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,N,C,A,I,P,z,H,F,E,j,O,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?""+i+"":J?"":""+i+"",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?""+n+"":J?"":""+n+"",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"",l=B?"
      "+(Y?h:"")+(this._isInRange(e,r)?"":"")+(Y?"":h)+"
      ":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="
      "}for(M+="
      "+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"
      "+"",N=d?"":"",x=0;7>x;x++)C=(x+u)%7,N+="";for(M+=N+"",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),I=(this._getFirstDayOfMonth(et,Z)-u+7)%7,P=Math.ceil((I+A)/7),z=Q?this.maxRows>P?this.maxRows:P:P,this.maxRows=z,H=this._daylightSavingAdjust(new Date(et,Z,1-I)),F=0;z>F;F++){for(M+="",E=d?"":"",x=0;7>x;x++)j=g?g.apply(e.input?e.input[0]:null,[H]):[!0,""],O=H.getMonth()!==Z,W=O&&!y||!j[0]||X&&X>H||$&&H>$,E+="",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);M+=E+""}Z++,Z>11&&(Z=0,et++),M+="
      "+this._get(e,"weekHeader")+"=5?" class='ui-datepicker-week-end'":"")+">"+""+p[C]+"
      "+this._get(e,"calculateWeek")(H)+""+(O&&!v?" ":W?""+H.getDate()+"":""+H.getDate()+"")+"
      "+(Q?"
      "+(K[0]>0&&T===K[1]-1?"
      ":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="
      ",_="";if(a||!g)_+=""+o[t]+"";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+=""}if(y||(b+=_+(!a&&g&&v?"":" ")),!e.yearshtml)if(e.yearshtml="",a||!v)b+=""+i+"";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":" ")+_),b+="
      "},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.1",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.document[0],s=this.options;try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(n){}return this.helper||s.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(s.iframeFix===!0?"iframe":s.iframeFix).each(function(){e("
      ").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i} -},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.lefti[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i,s){var n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY=0;c--)h=s.snapElements[c].left,l=h+s.snapElements[c].width,u=s.snapElements[c].top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top-s.margins.top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left-s.margins.left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top-s.margins.top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left-s.margins.left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("
      ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("
      "),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=this.element.children(this.handles[i]).first().show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidthe.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
      "),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=u-t.height,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.1",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("
      ").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0; -if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("
      ").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("
      ").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("
      ").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("
      ").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.1",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left,o=(t.positionAbs||t.position.absolute).top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("

      ")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.1",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("

      ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("
      ").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()}; -f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("
      ").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.1",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("
      ").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("
      ").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("
      ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.1",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.1",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0] -}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("
      ").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){o.html(e),s._trigger("load",i,r)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.1",options:{content:function(){var t=e(this).attr("title")||"";return e("").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("
      ").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){e.data("ui-tooltip-open")&&n._delay(function(){t&&(t.type=a),this._open(t,e,i)})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,a.is(":hidden")||a.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i),a.length)return a.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("
      ").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):a.position(e.extend({of:i},this.options.position)),this.hiding=!1,this.closing=!1,a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:a}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}},i[0]!==this.element[0]&&(o.remove=function(){this._removeTooltip(a)}),t&&"mouseover"!==t.type||(o.mouseleave="close"),t&&"focusin"!==t.type||(o.focusout="close"),this._on(!0,i,o)}},close:function(t){var i=this,s=e(t?t.currentTarget:this.element),n=this._find(s);this.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),this.hiding=!0,n.stop(!0),this._hide(n,this.options.hide,function(){i._removeTooltip(e(this)),this.hiding=!1,this.closing=!1}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,s){e(s.element).attr("title",s.title),delete i.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:n}),this.hiding||(this.closing=!1))},_tooltip:function(t){var i=e("
      ").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("
      ").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]=t,i},_find:function(t){var i=t.data("ui-tooltip-id");return i?e("#"+i):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0),e("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/main.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/main.js deleted file mode 100644 index 996475c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/main.js +++ /dev/null @@ -1,662 +0,0 @@ -var toolsetForms = toolsetForms || {}; - -var wptCallbacks = {}; -wptCallbacks.validationInit = jQuery.Callbacks('unique'); -wptCallbacks.addRepetitive = jQuery.Callbacks('unique'); -wptCallbacks.removeRepetitive = jQuery.Callbacks('unique'); -wptCallbacks.conditionalCheck = jQuery.Callbacks('unique'); -wptCallbacks.reset = jQuery.Callbacks('unique'); - -// General -jQuery( document ).ready( function() { - if (typeof wptValidation !== 'undefined') { - wptCallbacks.validationInit.add(function () { - wptValidation.init(); - }); - } - if (typeof wptCond !== 'undefined') { - wptCond.init(); - } else { - wptCallbacks.validationInit.fire(); - } -} ); - -// CRED specific -jQuery(document).on('cred_form_ready', function (event, event_data) { - - /** - * check taxonmies on submitted forms - */ - jQuery('.cred-taxonomy', jQuery('form.is_submitted')).each(function () { - var $parent = jQuery(this); - setTimeout(function () { - jQuery('input.wpt-taxonomy-add-new', $parent).click(); - }, 50); - }); - -}); - -var wptFilters = {}; -function add_filter(name, callback, priority, args_num) { - var args = _.defaults(arguments, ['', '', 10, 2]); - if (typeof wptFilters[name] === 'undefined') - wptFilters[name] = {}; - if (typeof wptFilters[name][args[2]] === 'undefined') - wptFilters[name][args[2]] = []; - wptFilters[name][args[2]].push([callback, args[3]]); -} -function apply_filters(name, val) { - if (typeof wptFilters[name] === 'undefined') - return val; - var args = _.rest(_.toArray(arguments)); - _.each(wptFilters[name], function (funcs, priority) { - _.each(funcs, function ($callback) { - var _args = args.slice(0, $callback[1]); - args[0] = $callback[0].apply(null, _args); - }); - }); - return args[0]; -} -function add_action(name, callback, priority, args_num) { - add_filter.apply(null, arguments); -} -function do_action(name) { - if (typeof wptFilters[name] === 'undefined') - return false; - var args = _.rest(_.toArray(arguments)); - _.each(wptFilters[name], function (funcs, priority) { - _.each(funcs, function ($callback) { - var _args = args.slice(0, $callback[1]); - $callback[0].apply(null, _args); - }); - }); - return true; -} - -/** - * flat taxonomies functions - */ -function showHideMostPopularButton(taxonomy, form) { - var $button = jQuery('[name="sh_' + taxonomy + '"]', form); - var $taxonomy_box = jQuery('.shmpt-' + taxonomy, form); - var $tag_list = $taxonomy_box.find('.js-wpt-taxonomy-popular-add'); - - if (!$button.hasClass('js-wpt-taxonomy-popular-show-hide')) - return true; - - if ($tag_list.length > 0) { - $button.show(); - return true; - } else { - $button.hide(); - return false; - } -} - -jQuery(document).off('click', '.js-wpt-taxonomy-popular-show-hide', null); -jQuery(document).off('click', '.js-wpt-taxonomy-popular-add', null); -jQuery(document).off('click', '.js-wpt-taxonomy-add-new', null); -jQuery(document).off('keypress', '.js-wpt-new-taxonomy-title', null); - -jQuery(document).on('click', '.js-wpt-taxonomy-popular-show-hide', function () { - showHideMostPopularTaxonomy(this); -}); - -function showHideMostPopularTaxonomy(el) { - var data_type_output = jQuery(el).data('output'); - var taxonomy = jQuery(el).data('taxonomy'); - var form = jQuery(el).closest('form'); - jQuery('.shmpt-' + taxonomy, form).toggle(); - - if (data_type_output == 'bootstrap') { - var curr = jQuery(el).text(); - if (curr == jQuery(el).data('show-popular-text')) { - jQuery(el).text(jQuery(el).data('hide-popular-text'), form); - jQuery(el).addClass('btn-cancel').addClass('dashicons-dismiss').removeClass('dashicons-plus-alt'); - } else { - jQuery(el).text(jQuery(el).data('show-popular-text'), form); - jQuery(el).removeClass('btn-cancel').removeClass('dashicons-dismiss').addClass('dashicons-plus-alt'); - } - } else { - var curr = jQuery(el).val(); - if (curr == jQuery(el).data('show-popular-text')) { - jQuery(el).val(jQuery(el).data('hide-popular-text'), form).addClass('btn-cancel'); - } else { - jQuery(el).val(jQuery(el).data('show-popular-text'), form).removeClass('btn-cancel'); - } - } -} - -jQuery(document).on('click', '.js-wpt-taxonomy-popular-add', function () { - var $thiz = jQuery(this); - var taxonomy = $thiz.data('taxonomy'); - var slug = $thiz.data('slug'); - var _name = $thiz.data('name'); - setTaxonomyFromPopular(_name, taxonomy, this); - return false; -}); - -function setTaxonomyFromPopular(slug, taxonomy, $el) { - var $form = jQuery($el).closest('form'); - var tmp_tax = String(slug); - if (typeof tmp_tax === "undefined" || tmp_tax.trim() == '') - return; - var tax = jQuery('input[name=' + taxonomy + ']', $form).val(); - var arr = String(tax).split(','); - if (jQuery.inArray(tmp_tax, arr) !== -1) - return; - var toadd = (tax == '') ? tmp_tax : tax + ',' + tmp_tax; - jQuery('input[name=' + taxonomy + ']', $form).val(toadd); - updateTaxonomies(taxonomy, $form); -} - -function addTaxonomy(slug, taxonomy, $el) { - var $form = jQuery($el).closest('form'); - var curr = jQuery('input[name=tmp_' + taxonomy + ']', $form).val().trim(); - if ('' == curr) { - jQuery('input[name=tmp_' + taxonomy + ']', $form).val(slug); - setTaxonomy(taxonomy, $el); - } else { - if (curr.indexOf(slug) == -1) { - jQuery('input[name=tmp_' + taxonomy + ']', $form).val(curr + ',' + slug); - setTaxonomy(taxonomy, $el); - } - } - jQuery('input[name=tmp_' + taxonomy + ']', $form).val(''); -} - -jQuery(document).on('click', '.js-wpt-taxonomy-add-new', function () { - var $thiz = jQuery(this), - taxonomy = $thiz.data('taxonomy'); - setTaxonomy(taxonomy, this); -}); - -jQuery(document).on('keypress', '.js-wpt-new-taxonomy-title', function (e) { - if (13 === e.keyCode) { - e.preventDefault(); - var $thiz = jQuery(this), - taxonomy = $thiz.data('taxonomy'), - taxtype = $thiz.data('taxtype'); - if (taxtype == 'hierarchical') { - toolsetForms.cred_tax.add_taxonomy(taxonomy, this); - } else { - setTaxonomy(taxonomy, this); - } - } -}); - -function setTaxonomy(taxonomy, $el) { - var $form = jQuery($el).closest('form'); - var tmp_tax = jQuery('input[name=tmp_' + taxonomy + ']', $form).val(); - var rex = /<\/?(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|noframes|noscript|object|ol|optgroup|option|output|p|param|plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|spacer|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b[^<>]*>/ig; - tmp_tax = _.escape(tmp_tax.replace(rex, "")).trim(); - if (tmp_tax.trim() == '') { - return; - } - var tax = jQuery('input[name=' + taxonomy + ']', $form).val(); - var arr = tax.split(','); - if (jQuery.inArray(tmp_tax, arr) !== -1) - return; - var toadd = (tax == '') ? tmp_tax : tax + ',' + tmp_tax; - jQuery('input[name=' + taxonomy + ']', $form).val(toadd); - jQuery('input[name=tmp_' + taxonomy + ']', $form).val(''); - updateTaxonomies(taxonomy, $form); -} - -function updateTaxonomies(taxonomy, $form) { - var $taxonomies_selector = jQuery('input[name=' + taxonomy + ']', $form); - var taxonomies = $taxonomies_selector.val(); - jQuery('div.tagchecklist-' + taxonomy, $form).html(''); - if (!taxonomies || (taxonomies && taxonomies.trim() == '')) { - return; - } - - var toshow = taxonomies.split(','); - var str = ''; - for (var i = 0; i < toshow.length; i++) { - var sh = toshow[i].trim(); - if ($taxonomies_selector.data('output') == 'bootstrap') { - str += '' + sh + ' '; - } else { - str += 'X ' + sh + ''; - } - } - jQuery('div.tagchecklist-' + taxonomy, $form).html(str); - jQuery('div.tagchecklist-' + taxonomy + ' a', $form).bind('click', function () { - jQuery('input[name=' + taxonomy + ']', $form).val(''); - var del = jQuery(this).data('wpcf-i'); - var values = ''; - for (i = 0; i < toshow.length; i++) { - if (del == i) { - continue; - } - if (values) { - values += ','; - } - values += toshow[i]; - } - jQuery('input[name=' + taxonomy + ']', $form).val(values); - updateTaxonomies(taxonomy, $form); - - return false; - }); - -} - -function initTaxonomies(values, taxonomy, url, fieldId) { - var $form = jQuery('#' + fieldId.replace(/_field_\d+$/, '')).closest('form'); - jQuery('div.tagchecklist-' + taxonomy, $form).html(values); - jQuery('input[name=' + taxonomy + ']', $form).val(values); - updateTaxonomies(taxonomy, $form); - - jQuery('input[name=tmp_' + taxonomy + ']', $form).suggest( - wptoolset_taxonomy_settings.ajaxurl + '?action=wpt_suggest_taxonomy_term&taxonomy=' + taxonomy, - { - resultsClass: 'wpt-suggest-taxonomy-term', - selectClass: 'wpt-suggest-taxonomy-term-select' - } - ); - - if (jQuery('input[name=tmp_' + taxonomy + ']', $form).val() !== "") { - jQuery("input[name='new_tax_button_" + taxonomy + "']", $form).trigger("click"); - } -} - -// @bug This does not belong here: move to the CRED frontend script or write its own -// and make sure it includs the taxonomy initialization pseudo-mini-script around here -toolsetForms.CRED_taxonomy = function () { - - var self = this; - - self.init = function () { - self._new_taxonomy = new Array(); - jQuery(document).ready(self._document_ready); - }; - - self._document_ready = function () { - self._initialize_taxonomy_buttons(); - self._initialize_hierachical(); - }; - - /** - * Initialize hierarchical taxonomis on a form. - * - * The taxonomy field itself will add, hidden, the structure to add a new term, and the button to show/hide it. - * Here, we just take those structures and move them to the specific shortcode placeholder output, if any, - * or remove them otherwise. - * - * @since unknown - * @since 1.9.1 Make the structure be moved to the placeholder. - */ - self._initialize_hierachical = function () { - jQuery( '.js-wpt-hierarchical-taxonomy-add-new-container' ).each( function() { - - var $addNewContainer = jQuery( this ), - $form = $addNewContainer.closest( 'form' ), - $taxonomy = $addNewContainer.data( 'taxonomy' ), - $addNewShowHide = jQuery( '.js-wpt-hierarchical-taxonomy-add-new-show-hide[data-taxonomy="' + $taxonomy + '"]', $form ), - $placeholder = jQuery( '.js-taxonomy-hierarchical-button-placeholder[data-taxonomy="' + $taxonomy + '"]', $form ); - - if ( $placeholder.length > 0 ) { - $addNewShowHide - .insertAfter( $placeholder ) - .show(); - $placeholder.replaceWith( $addNewContainer ); - self._fill_parent_drop_down( $form ); - } else { - $addNewContainer.remove(); - $addNewShowHide.remove(); - } - - }); - }; - - /** - * Fill hierarchical taxonomy parent select dropdown. - * - * @param object $form - * - * @since unknown - * @since 1.9.1 Add a $form paramete to only initialize parent selectors for hierarchical taxonomies on a given form. - */ - self._fill_parent_drop_down = function ( $form ) { - jQuery('select.js-taxonomy-parent', $form ).each(function () { - var $select = jQuery(this); - - // remove all the options - jQuery(this).find('option').each(function () { - if (jQuery(this).val() != '-1') { - jQuery(this).remove(); - } - }); - - var taxonomy = jQuery(this).data('taxonomy'); - - // Copy all the checkbox values if it's checkbox mode - jQuery('input[name="' + taxonomy + '\[\]"]', $form).each(function () { - var id = jQuery(this).attr('id'); - var label = jQuery(this).data('value'); - var level = jQuery(this).closest('ul').data('level'); - var prefix = ''; - if (level) { - prefix = "\xA0\xA0" + Array(level).join("\xA0\xA0"); - } - $select.append(''); - }); - - // Copy all the select option values if it's select mode - jQuery('select[name="' + taxonomy + '\[\]"]', $form).find('option').each(function () { - var id = jQuery(this).val(); - var text = jQuery(this).text(); - $select.append(''); - }); - }); - }; - - self._initialize_taxonomy_buttons = function () { - // replace the taxonomy button placeholders with the actual buttons. - jQuery('.js-taxonomy-button-placeholder').each(function () { - var $placeholder = jQuery(this); - var label = jQuery(this).attr('data-label'); - var taxonomy = jQuery(this).data('taxonomy'); - var form = jQuery(this).closest('form'); - var $buttons = jQuery('[name="sh_' + taxonomy + '"]', form); - var selectors = []; - - if ($buttons.length) { - - $buttons.each(function () { - var $button = jQuery(this, form); - - if (label) { - $button.val(label); - } - - $placeholder.replaceWith($button); - - if ($button.hasClass('js-wpt-taxonomy-popular-show-hide')) { - if (showHideMostPopularButton(taxonomy, form)) { - $button.show(); - } - } else { - $button.show(); - } - - //Move anything else that should be moved with the button - //changed selector - selectors.push($button.data('after-selector')); - }); - } - }); - }; - - self.add_new_show_hide = function (taxonomy, $button) { - var $form = jQuery($button).closest('form'); - var $add_wrap = jQuery(".js-wpt-hierarchical-taxonomy-add-new-" + taxonomy, $form); - if ($add_wrap.is(":visible")) { - $add_wrap.hide(); - } else { - $add_wrap.show(); - } - self.hide_parent_button_if_no_terms(taxonomy, $button); - }; - - self.add_taxonomy_controls_bindings = function () { - jQuery('.js-wpt-hierarchical-taxonomy-add-new').on('click', function () { - var $thiz = jQuery(this), - taxonomy = $thiz.data('taxonomy'); - self.add_taxonomy(taxonomy, this); - }); - - jQuery('.js-wpt-hierarchical-taxonomy-add-new-show-hide').on('click', function () { - var $button = jQuery( this ), - $taxonomy = $button.data( 'taxonomy' ), - $output = $button.data( 'output' ); - if ( $output == 'bootstrap' ) { - // Dealing with an anchor button - if ( $button.text() == $button.data( 'close' ) ) { - $button - .html( $button.data('open') ) - .removeClass('dashicons-dismiss') - .addClass('dashicons-plus-alt'); - } else { - $button - .html( $button.data('close') ) - .removeClass('dashicons-plus-alt') - .addClass('dashicons-dismiss'); - } - } else { - // Dealing with an input button - if ( $button.val() == $button.data( 'close' ) ) { - $button - .val( $button.data('open') ) - .removeClass('btn-cancel'); - } else { - $button - .val( $button.data('close') ) - .addClass('btn-cancel'); - } - } - self.add_new_show_hide( $taxonomy, this ); - }); - }; - - self.terms_exist = function (taxonomy, $button) { - var form = jQuery($button).closest('form'); - var build_what = jQuery($button).data('build_what'), - parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', form).val(); - if (build_what === 'checkboxes') { - var first_checkbox = jQuery('input[name="' + taxonomy + '\[\]"][data-parent="' + parent + '"]:first', form); - return first_checkbox.length > 0; - } else { - var first_option = jQuery('select[name="' + taxonomy + '\[\]"]', form).find('option[data-parent="' + parent + '"]:first'); - return first_option.length > 0; - } - }; - - self.hide_parent_button_if_no_terms = function (taxonomy, $button) { - var $form = jQuery($button).closest('form'); - //var form_id = form.attr('id'); - var number_of_options = []; - jQuery('[name="new_tax_select_' + taxonomy + '"] option', $form).each(function () { - number_of_options++; - }); - - if (number_of_options > 1) { - jQuery('[name="new_tax_select_' + taxonomy + '"]', $form).prop('disabled', false); - } else { - jQuery('[name="new_tax_select_' + taxonomy + '"]', $form).prop('disabled', true); - } - }; - - self.add_taxonomy = function (taxonomy, $button) { - var $form = jQuery($button).closest('form'); - var dataTypeOutput = jQuery($button).data('output'); - var isBootstrap = ('bootstrap' === dataTypeOutput); - var new_taxonomy = jQuery('[name="new_tax_text_' + taxonomy + '"]', $form).val(); - var build_what = jQuery($button).data('build_what'); - new_taxonomy = new_taxonomy.trim(); - - if (new_taxonomy === '') { - return; - } - - // make sure we don't already have a taxonomy with the same name. - var exists = false; - jQuery('input[name="' + taxonomy + '\[\]"]').each(function () { - var id = jQuery(this).attr('id'); - var label = jQuery(this).data('value'); - if (new_taxonomy === label) { - exists = true; - self._flash_it(jQuery(this).parent('label')); - } - }); - - jQuery('select[name="' + taxonomy + '\[\]"]', $form).find('option').each(function () { - if (new_taxonomy === jQuery(this).text()) { - exists = true; - self._flash_it(jQuery(this)); - } - }); - - if (exists) { - jQuery('[name="new_tax_text_' + taxonomy + '"]', $form).val(''); - return; - } - - var parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', $form).val(), - add_position = null, - add_before = true, - $div_fields_wrap = jQuery('div[data-item_name="taxonomyhierarchical-' + taxonomy + '"]', $form), - level = 0; - - if (build_what === 'checkboxes') { - //Fix add new leaf - jQuery('div[data-item_name="taxonomyhierarchical-' + taxonomy + '"] li input[type=checkbox]', $form).each(function () { - if (this.value == parent || this.value == new_taxonomy) { - $div_fields_wrap = jQuery(this).parent(); - } - }); - - var new_checkbox = ""; - if (isBootstrap) { - new_checkbox = '
    • '; - } else { - new_checkbox = '
    • '; - } - // find the first checkbox sharing parent - var $first_checkbox = jQuery('input[name="' + taxonomy + '\[\]"][data-parent="' + parent + '"]:first', $form); - if ($first_checkbox.length == 0) { - // there are no existing brothers - // so we need to compose the ul wrapper and append to the parent li - //add_position = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]').closest('li'); - level = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]', $form).closest('ul').data('level'); - level++; - new_checkbox = '
        ' + new_checkbox + '
      '; - //first_checkbox = ; - //add_before = false; - //add_position = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]').closest('li'); - if (isBootstrap) { - jQuery(new_checkbox).insertAfter($div_fields_wrap); - } else { - jQuery(new_checkbox).appendTo($div_fields_wrap); - } - } else { - // there are brothers - // so we need to insert before all of them - add_position = $first_checkbox.closest('li'); - jQuery(new_checkbox).insertBefore(add_position); - } - jQuery('[name="new_tax_select_' + taxonomy + '"]', $form).show(); - } else if (build_what === 'select') { - // Select control - - jQuery('select[name="' + taxonomy + '\[\]"]', $form).show(); - - var label = ''; - var indent = ''; - var $first_option = jQuery('select[name="' + taxonomy + '\[\]"]', $form).find('option[data-parent="' + parent + '"]:first', $form); - if ($first_option.length == 0) { - // there a no children of this parent - $first_option = jQuery('select[name="' + taxonomy + '\[\]"]', $form).find('option[value="' + parent + '"]:first', $form); - add_before = false; - label = $first_option.text(); - for (var i = 0; i < label.length; i++) { - if (label[i] == '\xA0') { - indent += '\xA0'; - } else { - break; - } - } - indent += '\xA0'; - indent += '\xA0'; - add_position = jQuery('select[name="' + taxonomy + '\[\]"]', $form); - } else { - add_position = $first_option; - label = $first_option.text(); - for (var i = 0; i < label.length; i++) { - if (label[i] == '\xA0') { - indent += '\xA0'; - } else { - break; - } - } - } - - if (add_position) { - var new_option = ''; - if (add_before) { - jQuery(new_option).insertBefore(add_position); - } else { - jQuery(new_option).appendTo(add_position); - } - } - jQuery('[name="new_tax_select_' + taxonomy + '"]', $form).show() - } - - self._update_hierachy(taxonomy, new_taxonomy, $form); - - jQuery('[name="new_tax_text_' + taxonomy + '"]', $form).val(''); - - self._fill_parent_drop_down( $form ); - }; - - self._update_hierachy = function (taxonomy, new_taxonomy, $form) { - var $new_taxonomy_input = jQuery('input[name="' + taxonomy + '_hierarchy"]', $form); - if ($new_taxonomy_input.length <= 0) { - // add a hidden field for the hierarchy - jQuery('').insertAfter(jQuery('[name="new_tax_text_' + taxonomy + '"]', $form)); - $new_taxonomy_input = jQuery('input[name="' + taxonomy + '_hierarchy"]', $form); - } - - if (typeof self._new_taxonomy[taxonomy] === 'undefined') { - self._new_taxonomy[taxonomy] = new Array(); - } - - var parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', $form).val(); - self._new_taxonomy[taxonomy].push(parent + ',' + new_taxonomy); - - var value = ''; - for (var i = 0; i < self._new_taxonomy[taxonomy].length; i++) { - value += '{' + self._new_taxonomy[taxonomy][i] + '}'; - } - value = $new_taxonomy_input.val() + value; - $new_taxonomy_input.val(value); - }; - - self._flash_it = function ($element) { - $element.fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300); - }; - - self.init(); - - setTimeout(self.add_taxonomy_controls_bindings, 300); - -}; - -toolsetForms.cred_tax = new toolsetForms.CRED_taxonomy(); - -//removed return key press -jQuery(function () { - var keyStop = { - 8: ":not(input:text, textarea, input:file, input:password)", // stop backspace = back - 13: "input:text, input:password", // stop enter = submit - - end: null - }; - - jQuery(document).bind("keydown", function (event) { - var $thiz_selector = keyStop[event.which], - $thiz_target = jQuery(event.target); - - if ( - $thiz_target.closest("form.cred-form").length - && $thiz_selector !== undefined - && $thiz_target.is($thiz_selector) - ) { - event.preventDefault(); //stop event - } - - return true; - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/LICENSE b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/LICENSE deleted file mode 100644 index b612f71..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net -AUTHORS: - Mike Crawford - Ben Maurer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/README b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/README deleted file mode 100644 index 21f1a27..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/README +++ /dev/null @@ -1,7 +0,0 @@ -reCAPTCHA README -================ - -The reCAPTCHA PHP Lirary helps you use the reCAPTCHA API. Documentation -for this library can be found at - - http://recaptcha.net/plugins/php diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/recaptcha_ajax.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/recaptcha_ajax.js deleted file mode 100644 index 137275e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-php-1.11/recaptcha_ajax.js +++ /dev/null @@ -1,118 +0,0 @@ -var RecaptchaTemplates={};RecaptchaTemplates.VertHtml='

      ';RecaptchaTemplates.CleanCss=".recaptchatable td img{display:block}.recaptchatable .recaptcha_image_cell center img{height:57px}.recaptchatable .recaptcha_image_cell center{height:57px}.recaptchatable .recaptcha_image_cell{background-color:white;height:57px;padding:7px!important}.recaptchatable,#recaptcha_area tr,#recaptcha_area td,#recaptcha_area th{margin:0!important;border:0!important;border-collapse:collapse!important;vertical-align:middle!important}.recaptchatable *{margin:0;padding:0;border:0;color:black;position:static;top:auto;left:auto;right:auto;bottom:auto;text-align:left!important}.recaptchatable #recaptcha_image{margin:auto;border:1px solid #dfdfdf!important}.recaptchatable a img{border:0}.recaptchatable a,.recaptchatable a:hover{outline:none;border:0!important;padding:0!important;text-decoration:none;color:blue;background:none!important;font-weight:normal}.recaptcha_input_area{position:relative!important;background:none!important}.recaptchatable label.recaptcha_input_area_text{border:1px solid #dfdfdf!important;margin:0!important;padding:0!important;position:static!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important}.recaptcha_theme_red label.recaptcha_input_area_text,.recaptcha_theme_white label.recaptcha_input_area_text{color:black!important}.recaptcha_theme_blackglass label.recaptcha_input_area_text{color:white!important}.recaptchatable #recaptcha_response_field{font-size:11pt}.recaptcha_theme_blackglass #recaptcha_response_field,.recaptcha_theme_white #recaptcha_response_field{border:1px solid gray}.recaptcha_theme_red #recaptcha_response_field{border:1px solid #cca940}.recaptcha_audio_cant_hear_link{font-size:7pt;color:black}.recaptchatable{line-height:1em;border:1px solid #dfdfdf!important}.recaptcha_error_text{color:red}";RecaptchaTemplates.CleanHtml='
      ';RecaptchaTemplates.ContextHtml='

      ';RecaptchaTemplates.VertCss=".recaptchatable td img{display:block}.recaptchatable .recaptcha_r1_c1{background:url('IMGROOT/sprite.png') 0 -63px no-repeat;width:318px;height:9px}.recaptchatable .recaptcha_r2_c1{background:url('IMGROOT/sprite.png') -18px 0 no-repeat;width:9px;height:57px}.recaptchatable .recaptcha_r2_c2{background:url('IMGROOT/sprite.png') -27px 0 no-repeat;width:9px;height:57px}.recaptchatable .recaptcha_r3_c1{background:url('IMGROOT/sprite.png') 0 0 no-repeat;width:9px;height:63px}.recaptchatable .recaptcha_r3_c2{background:url('IMGROOT/sprite.png') -18px -57px no-repeat;width:300px;height:6px}.recaptchatable .recaptcha_r3_c3{background:url('IMGROOT/sprite.png') -9px 0 no-repeat;width:9px;height:63px}.recaptchatable .recaptcha_r4_c1{background:url('IMGROOT/sprite.png') -43px 0 no-repeat;width:171px;height:49px}.recaptchatable .recaptcha_r4_c2{background:url('IMGROOT/sprite.png') -36px 0 no-repeat;width:7px;height:57px}.recaptchatable .recaptcha_r4_c4{background:url('IMGROOT/sprite.png') -214px 0 no-repeat;width:97px;height:57px}.recaptchatable .recaptcha_r7_c1{background:url('IMGROOT/sprite.png') -43px -49px no-repeat;width:171px;height:8px}.recaptchatable .recaptcha_r8_c1{background:url('IMGROOT/sprite.png') -43px -49px no-repeat;width:25px;height:8px}.recaptchatable .recaptcha_image_cell center img{height:57px}.recaptchatable .recaptcha_image_cell center{height:57px}.recaptchatable .recaptcha_image_cell{background-color:white;height:57px}#recaptcha_area,#recaptcha_table{width:318px!important}.recaptchatable,#recaptcha_area tr,#recaptcha_area td,#recaptcha_area th{margin:0!important;border:0!important;padding:0!important;border-collapse:collapse!important;vertical-align:middle!important}.recaptchatable *{margin:0;padding:0;border:0;font-family:helvetica,sans-serif;font-size:8pt;color:black;position:static;top:auto;left:auto;right:auto;bottom:auto;text-align:left!important}.recaptchatable #recaptcha_image{margin:auto}.recaptchatable img{border:0!important;margin:0!important;padding:0!important}.recaptchatable a,.recaptchatable a:hover{outline:none;border:0!important;padding:0!important;text-decoration:none;color:blue;background:none!important;font-weight:normal}.recaptcha_input_area{position:relative!important;width:146px!important;height:45px!important;margin-left:20px!important;margin-right:5px!important;margin-top:4px!important;background:none!important}.recaptchatable label.recaptcha_input_area_text{margin:0!important;padding:0!important;position:static!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;background:none!important;height:auto!important;width:auto!important}.recaptcha_theme_red label.recaptcha_input_area_text,.recaptcha_theme_white label.recaptcha_input_area_text{color:black!important}.recaptcha_theme_blackglass label.recaptcha_input_area_text{color:white!important}.recaptchatable #recaptcha_response_field{width:145px!important;position:absolute!important;bottom:7px!important;padding:0!important;margin:0!important;font-size:10pt}.recaptcha_theme_blackglass #recaptcha_response_field,.recaptcha_theme_white #recaptcha_response_field{border:1px solid gray}.recaptcha_theme_red #recaptcha_response_field{border:1px solid #cca940}.recaptcha_audio_cant_hear_link{font-size:7pt;color:black}.recaptchatable{line-height:1em}#recaptcha_instructions_error{color:red!important}";var RecaptchaStr_en={visual_challenge:"Get a visual challenge",audio_challenge:"Get an audio challenge",refresh_btn:"Get a new challenge",instructions_visual:"Type the two words:",instructions_context:"Type the words in the boxes:",instructions_audio:"Type what you hear:",help_btn:"Help",play_again:"Play sound again",cant_hear_this:"Download sound as MP3",incorrect_try_again:"Incorrect. Try again.",image_alt_text:"reCAPTCHA challenge image"},RecaptchaStr_af={visual_challenge:"Kry 'n visuele verifi\u00ebring", -audio_challenge:"Kry 'n klankverifi\u00ebring",refresh_btn:"Kry 'n nuwe verifi\u00ebring",instructions_visual:"Tik die twee woorde:",instructions_context:"Tik die woorde in die kassies:",instructions_audio:"Tik wat jy hoor:",help_btn:"Hulp",play_again:"Speel geluid weer",cant_hear_this:"Laai die klank af as MP3",incorrect_try_again:"Verkeerd. Probeer weer.",image_alt_text:"reCAPTCHA-verifieerprent"},RecaptchaStr_am={visual_challenge:"\u12e8\u12a5\u12ed\u1273 \u1270\u130b\u1323\u121a \u12a0\u130d\u129d", -audio_challenge:"\u120c\u120b \u12a0\u12f2\u1235 \u12e8\u12f5\u121d\u133d \u1325\u12eb\u1244 \u12ed\u1245\u1228\u1265",refresh_btn:"\u120c\u120b \u12a0\u12f2\u1235 \u1325\u12eb\u1244 \u12ed\u1245\u1228\u1265",instructions_visual:"\u12a5\u1295\u12da\u1205\u1295 \u1201\u1208\u1275 \u1243\u120b\u1275 \u1270\u12ed\u1265 \u1366",instructions_context:"\u1260\u1233\u1325\u1296\u1279 \u12cd\u1235\u1325 \u1243\u120b\u1276\u1279\u1295 \u1270\u12ed\u1265\u1366",instructions_audio:"\u12e8\u121d\u1275\u1230\u121b\u12cd\u1295 \u1270\u12ed\u1265\u1361-", -help_btn:"\u12a5\u1308\u12db",play_again:"\u12f5\u121d\u1339\u1295 \u12a5\u1295\u12f0\u1308\u1293 \u12a0\u132b\u12cd\u1275",cant_hear_this:"\u12f5\u121d\u1339\u1295 \u1260MP3 \u1245\u122d\u133d \u12a0\u12cd\u122d\u12f5",incorrect_try_again:"\u1275\u12ad\u12ad\u120d \u12a0\u12ed\u12f0\u1208\u121d\u1362 \u12a5\u1295\u12f0\u1308\u1293 \u121e\u12ad\u122d\u1362",image_alt_text:"reCAPTCHA \u121d\u1235\u120d \u130d\u1320\u121d"},RecaptchaStr_ar={visual_challenge:"\u0627\u0644\u062d\u0635\u0648\u0644 \u0639\u0644\u0649 \u062a\u062d\u062f\u064d \u0645\u0631\u0626\u064a", -audio_challenge:"\u0627\u0644\u062d\u0635\u0648\u0644 \u0639\u0644\u0649 \u062a\u062d\u062f\u064d \u0635\u0648\u062a\u064a",refresh_btn:"\u0627\u0644\u062d\u0635\u0648\u0644 \u0639\u0644\u0649 \u062a\u062d\u062f\u064d \u062c\u062f\u064a\u062f",instructions_visual:"\u0627\u0643\u062a\u0628 \u0627\u0644\u0643\u0644\u0645\u062a\u064a\u0646:",instructions_context:"\u0627\u0643\u062a\u0628 \u0627\u0644\u0643\u0644\u0645\u0627\u062a \u0641\u064a \u0627\u0644\u0645\u0631\u0628\u0639\u0627\u062a:",instructions_audio:"\u0627\u0643\u062a\u0628 \u0645\u0627 \u062a\u0633\u0645\u0639\u0647:", -help_btn:"\u0645\u0633\u0627\u0639\u062f\u0629",play_again:"\u062a\u0634\u063a\u064a\u0644 \u0627\u0644\u0635\u0648\u062a \u0645\u0631\u0629 \u0623\u062e\u0631\u0649",cant_hear_this:"\u062a\u0646\u0632\u064a\u0644 \u0627\u0644\u0635\u0648\u062a \u0628\u062a\u0646\u0633\u064a\u0642 MP3",incorrect_try_again:"\u063a\u064a\u0631 \u0635\u062d\u064a\u062d. \u0623\u0639\u062f \u0627\u0644\u0645\u062d\u0627\u0648\u0644\u0629.",image_alt_text:"\u0635\u0648\u0631\u0629 \u0627\u0644\u062a\u062d\u062f\u064a \u0645\u0646 reCAPTCHA"}, -RecaptchaStr_bg={visual_challenge:"\u041f\u043e\u043b\u0443\u0447\u0430\u0432\u0430\u043d\u0435 \u043d\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430",audio_challenge:"\u0417\u0430\u0440\u0435\u0436\u0434\u0430\u043d\u0435 \u043d\u0430 \u0430\u0443\u0434\u0438\u043e\u0442\u0435\u0441\u0442",refresh_btn:"\u0417\u0430\u0440\u0435\u0436\u0434\u0430\u043d\u0435 \u043d\u0430 \u043d\u043e\u0432 \u0442\u0435\u0441\u0442",instructions_visual:"\u0412\u044a\u0432\u0435\u0434\u0435\u0442\u0435 \u0434\u0432\u0435\u0442\u0435 \u0434\u0443\u043c\u0438:", -instructions_context:"\u0412\u044a\u0432\u0435\u0434\u0435\u0442\u0435 \u0434\u0443\u043c\u0438\u0442\u0435:",instructions_audio:"\u0412\u044a\u0432\u0435\u0434\u0435\u0442\u0435 \u0447\u0443\u0442\u043e\u0442\u043e:",help_btn:"\u041f\u043e\u043c\u043e\u0449",play_again:"\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043f\u0443\u0441\u043a\u0430\u043d\u0435 \u043d\u0430 \u0437\u0432\u0443\u043a\u0430",cant_hear_this:"\u0418\u0437\u0442\u0435\u0433\u043b\u044f\u043d\u0435 \u043d\u0430 \u0437\u0432\u0443\u043a\u0430 \u0432\u044a\u0432 \u0444\u043e\u0440\u043c\u0430\u0442 MP3", -incorrect_try_again:"\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u043d\u043e. \u041e\u043f\u0438\u0442\u0430\u0439\u0442\u0435 \u043e\u0442\u043d\u043e\u0432\u043e.",image_alt_text:"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0442\u0430 \u0441 reCAPTCHA"},RecaptchaStr_bn={visual_challenge:"\u098f\u0995\u099f\u09bf \u09a6\u09c3\u09b6\u09cd\u09af\u09ae\u09be\u09a8 \u09aa\u09cd\u09b0\u09a4\u09bf\u09a6\u09cd\u09ac\u09a8\u09cd\u09a6\u09cd\u09ac\u09bf\u09a4\u09be \u09aa\u09be\u09a8", -audio_challenge:"\u098f\u0995\u099f\u09bf \u0985\u09a1\u09bf\u0993 \u09aa\u09cd\u09b0\u09a4\u09bf\u09a6\u09cd\u09ac\u09a8\u09cd\u09a6\u09cd\u09ac\u09bf\u09a4\u09be \u09aa\u09be\u09a8",refresh_btn:"\u098f\u0995\u099f\u09bf \u09a8\u09a4\u09c1\u09a8 \u09aa\u09cd\u09b0\u09a4\u09bf\u09a6\u09cd\u09ac\u09a8\u09cd\u09a6\u09cd\u09ac\u09bf\u09a4\u09be \u09aa\u09be\u09a8",instructions_visual:"\u09b6\u09ac\u09cd\u09a6 \u09a6\u09c1\u099f\u09bf \u09b2\u09bf\u0996\u09c1\u09a8:",instructions_context:"\u09ac\u09be\u0995\u09cd\u09b8\u09c7 \u09b6\u09ac\u09cd\u09a6\u0997\u09c1\u09b2\u09bf \u099f\u09be\u0987\u09aa \u0995\u09b0\u09c1\u09a8:", -instructions_audio:"\u0986\u09aa\u09a8\u09bf \u09af\u09be \u09b6\u09c1\u09a8\u099b\u09c7\u09a8 \u09a4\u09be \u09b2\u09bf\u0996\u09c1\u09a8:",help_btn:"\u09b8\u09b9\u09be\u09df\u09a4\u09be",play_again:"\u0986\u09ac\u09be\u09b0 \u09b8\u09be\u0989\u09a8\u09cd\u09a1 \u09aa\u09cd\u09b2\u09c7 \u0995\u09b0\u09c1\u09a8",cant_hear_this:"MP3 \u09b0\u09c2\u09aa\u09c7 \u09b6\u09ac\u09cd\u09a6 \u09a1\u09be\u0989\u09a8\u09b2\u09cb\u09a1 \u0995\u09b0\u09c1\u09a8",incorrect_try_again:"\u09ac\u09c7\u09a0\u09bf\u0995\u09f7 \u0986\u09ac\u09be\u09b0 \u099a\u09c7\u09b7\u09cd\u099f\u09be \u0995\u09b0\u09c1\u09a8\u09f7", -image_alt_text:"reCAPTCHA \u099a\u09cd\u09af\u09be\u09b2\u09c7\u099e\u09cd\u099c \u099a\u09bf\u09a4\u09cd\u09b0"},RecaptchaStr_ca={visual_challenge:"Obt\u00e9n un repte visual",audio_challenge:"Obteniu una prova d'\u00e0udio",refresh_btn:"Obteniu una prova nova",instructions_visual:"Escriviu les dues paraules:",instructions_context:"Escriviu les paraules dels quadres:",instructions_audio:"Escriviu el que escolteu:",help_btn:"Ajuda",play_again:"Torna a reproduir el so",cant_hear_this:"Baixa el so com a MP3", -incorrect_try_again:"No \u00e9s correcte. Torna-ho a provar.",image_alt_text:"Imatge del repte de reCAPTCHA"},RecaptchaStr_cs={visual_challenge:"Zobrazit vizu\u00e1ln\u00ed podobu v\u00fdrazu",audio_challenge:"P\u0159ehr\u00e1t zvukovou podobu v\u00fdrazu",refresh_btn:"Zobrazit nov\u00fd v\u00fdraz",instructions_visual:"Zadejte dv\u011b slova:",instructions_context:"Zadejte slova uveden\u00e1 v pol\u00edch:",instructions_audio:"Napi\u0161te, co jste sly\u0161eli:",help_btn:"N\u00e1pov\u011bda",play_again:"Znovu p\u0159ehr\u00e1t zvuk", -cant_hear_this:"St\u00e1hnout zvuk ve form\u00e1tu MP3",incorrect_try_again:"\u0160patn\u011b. Zkuste to znovu.",image_alt_text:"Obr\u00e1zek reCAPTCHA"},RecaptchaStr_da={visual_challenge:"Hent en visuel udfordring",audio_challenge:"Hent en lydudfordring",refresh_btn:"Hent en ny udfordring",instructions_visual:"Indtast de to ord:",instructions_context:"Indtast ordene i felterne:",instructions_audio:"Indtast det, du h\u00f8rer:",help_btn:"Hj\u00e6lp",play_again:"Afspil lyden igen",cant_hear_this:"Download lyd som MP3", -incorrect_try_again:"Forkert. Pr\u00f8v igen.",image_alt_text:"reCAPTCHA-udfordringsbillede"},RecaptchaStr_de={visual_challenge:"Captcha abrufen",audio_challenge:"Audio-Captcha abrufen",refresh_btn:"Neues Captcha abrufen",instructions_visual:"Geben Sie die 2 W\u00f6rter ein:",instructions_context:"Worte aus den Feldern eingeben:",instructions_audio:"Geben Sie das Geh\u00f6rte ein:",help_btn:"Hilfe",play_again:"Wort erneut abspielen",cant_hear_this:"Wort als MP3 herunterladen",incorrect_try_again:"Falsch. Bitte versuchen Sie es erneut.", -image_alt_text:"reCAPTCHA-Bild"},RecaptchaStr_el={visual_challenge:"\u039f\u03c0\u03c4\u03b9\u03ba\u03ae \u03c0\u03c1\u03cc\u03ba\u03bb\u03b7\u03c3\u03b7",audio_challenge:"\u0397\u03c7\u03b7\u03c4\u03b9\u03ba\u03ae \u03c0\u03c1\u03cc\u03ba\u03bb\u03b7\u03c3\u03b7",refresh_btn:"\u039d\u03ad\u03b1 \u03c0\u03c1\u03cc\u03ba\u03bb\u03b7\u03c3\u03b7",instructions_visual:"\u03a0\u03bb\u03b7\u03ba\u03c4\u03c1\u03bf\u03bb\u03bf\u03b3\u03ae\u03c3\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03bb\u03ad\u03be\u03b5\u03b9\u03c2:", -instructions_context:"\u03a0\u03bb\u03b7\u03ba\u03c4\u03c1\u03bf\u03bb\u03bf\u03b3\u03ae\u03c3\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03bb\u03ad\u03be\u03b5\u03b9\u03c2:",instructions_audio:"\u03a0\u03bb\u03b7\u03ba\u03c4\u03c1\u03bf\u03bb\u03bf\u03b3\u03ae\u03c3\u03c4\u03b5 \u03cc\u03c4\u03b9 \u03b1\u03ba\u03bf\u03cd\u03c4\u03b5:",help_btn:"\u0392\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1",play_again:"\u0391\u03bd\u03b1\u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03ae \u03ae\u03c7\u03bf\u03c5 \u03be\u03b1\u03bd\u03ac", -cant_hear_this:"\u039b\u03ae\u03c8\u03b7 \u03ae\u03c7\u03bf\u03c5 \u03c9\u03c2 \u039c\u03a13",incorrect_try_again:"\u039b\u03ac\u03b8\u03bf\u03c2. \u0394\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac.",image_alt_text:"\u0395\u03b9\u03ba\u03cc\u03bd\u03b1 \u03c0\u03c1\u03cc\u03ba\u03bb\u03b7\u03c3\u03b7\u03c2 reCAPTCHA"},RecaptchaStr_es={visual_challenge:"Obtener una pista visual",audio_challenge:"Obtener una pista sonora",refresh_btn:"Obtener una pista nueva",instructions_visual:"Escribe las dos palabras:", -instructions_context:"Escribe las palabras de los cuadros:",instructions_audio:"Escribe lo que oigas:",help_btn:"Ayuda",play_again:"Volver a reproducir el sonido",cant_hear_this:"Descargar el sonido en MP3",incorrect_try_again:"Incorrecto. Vu\u00e9lvelo a intentar.",image_alt_text:"Pista de imagen reCAPTCHA"},RecaptchaStr_es_419={visual_challenge:"Enfrentar un desaf\u00edo visual",audio_challenge:"Enfrentar un desaf\u00edo de audio",refresh_btn:"Enfrentar un nuevo desaf\u00edo",instructions_visual:"Tipea las dos palabras.", -instructions_context:"Tipea las palabras en los cuadros",instructions_audio:"Tipea lo que escuchas:",help_btn:"Ayuda",play_again:"Reproducir sonido de nuevo",cant_hear_this:"Descargar sonido en formato MP3",incorrect_try_again:"Incorrecto. Vuelve a intentarlo.",image_alt_text:"Imagen del desaf\u00edo de la reCAPTCHA"},RecaptchaStr_et={visual_challenge:"Kuva kuvap\u00f5hine robotil\u00f5ks",audio_challenge:"Kuva helip\u00f5hine robotil\u00f5ks",refresh_btn:"Kuva uus robotil\u00f5ks",instructions_visual:"Tippige kaks s\u00f5na.", -instructions_context:"Tippige kastides olevad s\u00f5nad.",instructions_audio:"Tippige, mida kuulete.",help_btn:"Abi",play_again:"Esita heli uuesti",cant_hear_this:"Laadi heli alla MP3-vormingus",incorrect_try_again:"Vale. Proovige uuesti.",image_alt_text:"reCAPTCHA robotil\u00f5ksu kujutis"},RecaptchaStr_eu={visual_challenge:"Eskuratu ikusizko erronka",audio_challenge:"Eskuratu audio-erronka",refresh_btn:"Eskuratu erronka berria",instructions_visual:"Idatzi bi hitzak:",instructions_context:"Idatzi koadroetako hitzak:", -instructions_audio:"Idatzi entzuten duzuna:",help_btn:"Laguntza",play_again:"Erreproduzitu soinua berriro",cant_hear_this:"Deskargatu soinua MP3 gisa",incorrect_try_again:"Ez da zuzena. Saiatu berriro.",image_alt_text:"reCAPTCHA erronkaren irudia"},RecaptchaStr_fa={visual_challenge:"\u062f\u0631\u06cc\u0627\u0641\u062a \u06cc\u06a9 \u0645\u0639\u0645\u0627\u06cc \u062f\u06cc\u062f\u0627\u0631\u06cc",audio_challenge:"\u062f\u0631\u06cc\u0627\u0641\u062a \u06cc\u06a9 \u0645\u0639\u0645\u0627\u06cc \u0635\u0648\u062a\u06cc", -refresh_btn:"\u062f\u0631\u06cc\u0627\u0641\u062a \u06cc\u06a9 \u0645\u0639\u0645\u0627\u06cc \u062c\u062f\u06cc\u062f",instructions_visual:"\u0627\u06cc\u0646 \u062f\u0648 \u06a9\u0644\u0645\u0647 \u0631\u0627 \u062a\u0627\u06cc\u067e \u06a9\u0646\u06cc\u062f:",instructions_context:"\u0648\u0627\u0698\u0647 \u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u06a9\u0627\u062f\u0631\u0647\u0627 \u0631\u0627 \u062a\u0627\u06cc\u067e \u06a9\u0646\u06cc\u062f:",instructions_audio:"\u0622\u0646\u0686\u0647 \u0631\u0627 \u06a9\u0647 \u0645\u06cc \u0634\u0646\u0648\u06cc\u062f \u062a\u0627\u06cc\u067e \u06a9\u0646\u06cc\u062f:", -help_btn:"\u0631\u0627\u0647\u0646\u0645\u0627\u06cc\u06cc",play_again:"\u067e\u062e\u0634 \u0645\u062c\u062f\u062f \u0635\u062f\u0627",cant_hear_this:"\u062f\u0627\u0646\u0644\u0648\u062f \u0635\u062f\u0627 \u0628\u0647 \u0635\u0648\u0631\u062a MP3",incorrect_try_again:"\u0646\u0627\u062f\u0631\u0633\u062a. \u062f\u0648\u0628\u0627\u0631\u0647 \u0627\u0645\u062a\u062d\u0627\u0646 \u06a9\u0646\u06cc\u062f.",image_alt_text:""},RecaptchaStr_fi={visual_challenge:"Kuvavahvistus",audio_challenge:"\u00c4\u00e4nivahvistus", -refresh_btn:"Uusi kuva",instructions_visual:"Kirjoita n\u00e4kem\u00e4si kaksi sanaa:",instructions_context:"Kirjoita n\u00e4kem\u00e4si sanat:",instructions_audio:"Kirjoita kuulemasi:",help_btn:"Ohje",play_again:"Toista \u00e4\u00e4ni uudelleen",cant_hear_this:"Lataa \u00e4\u00e4ni MP3-tiedostona",incorrect_try_again:"V\u00e4\u00e4rin. Yrit\u00e4 uudelleen.",image_alt_text:"reCAPTCHA-kuva"},RecaptchaStr_fil={visual_challenge:"Kumuha ng pagsubok na visual",audio_challenge:"Kumuha ng pagsubok na audio", -refresh_btn:"Kumuha ng bagong pagsubok",instructions_visual:"I-type ang dalawang mga salita:",instructions_context:"I-type ang mga salita sa mga kahon:",instructions_audio:"I-type ang iyong narinig",help_btn:"Tulong",play_again:"I-play muli ang tunog",cant_hear_this:"I-download ang tunog bilang MP3",incorrect_try_again:"Hindi wasto. Muling subukan.",image_alt_text:"larawang panghamon ng reCAPTCHA"},RecaptchaStr_fr={visual_challenge:"Test visuel",audio_challenge:"Test audio",refresh_btn:"Nouveau test", -instructions_visual:"Saisissez les deux mots :",instructions_context:"Saisissez les mots ci-dessus :",instructions_audio:"Qu'entendez-vous ?",help_btn:"Aide",play_again:"R\u00e9\u00e9couter",cant_hear_this:"T\u00e9l\u00e9charger l'audio au format MP3",incorrect_try_again:"Incorrect. Veuillez r\u00e9essayer.",image_alt_text:"Image reCAPTCHA"},RecaptchaStr_fr_ca={visual_challenge:"Obtenir un test visuel",audio_challenge:"Obtenir un test audio",refresh_btn:"Obtenir un nouveau test",instructions_visual:"Saisissez les deux mots :", -instructions_context:"Tapez les mots dans les bo\u00eetes de texte\u00a0:",instructions_audio:"Qu'entendez-vous?",help_btn:"Aide",play_again:"Jouer le son de nouveau",cant_hear_this:"T\u00e9l\u00e9charger le son en format MP3",incorrect_try_again:"Erreur, essayez \u00e0 nouveau",image_alt_text:"Image reCAPTCHA"},RecaptchaStr_gl={visual_challenge:"Obter unha proba visual",audio_challenge:"Obter unha proba de audio",refresh_btn:"Obter unha proba nova",instructions_visual:"Escribe as d\u00faas palabras:", -instructions_context:"Escribe as palabras nas caixas:",instructions_audio:"Escribe o que escoitas:",help_btn:"Axuda",play_again:"Reproducir o son de novo",cant_hear_this:"Descargar son como MP3",incorrect_try_again:"Incorrecto. T\u00e9ntao de novo.",image_alt_text:"Imaxe de proba de reCAPTCHA"},RecaptchaStr_gu={visual_challenge:"\u0a8f\u0a95 \u0aa6\u0ac3\u0ab6\u0acd\u0aaf\u0abe\u0aa4\u0acd\u0aae\u0a95 \u0aaa\u0aa1\u0a95\u0abe\u0ab0 \u0aae\u0ac7\u0ab3\u0ab5\u0acb",audio_challenge:"\u0a8f\u0a95 \u0a91\u0aa1\u0abf\u0a93 \u0aaa\u0aa1\u0a95\u0abe\u0ab0 \u0aae\u0ac7\u0ab3\u0ab5\u0acb", -refresh_btn:"\u0a8f\u0a95 \u0aa8\u0ab5\u0acb \u0aaa\u0aa1\u0a95\u0abe\u0ab0 \u0aae\u0ac7\u0ab3\u0ab5\u0acb",instructions_visual:"\u0aac\u0ac7 \u0ab6\u0aac\u0acd\u0aa6 \u0ab2\u0a96\u0acb:",instructions_context:"\u0aac\u0ac9\u0a95\u0acd\u0ab8\u0aae\u0abe\u0a82 \u0ab6\u0aac\u0acd\u0aa6\u0acb \u0ab2\u0a96\u0acb:",instructions_audio:"\u0aa4\u0aae\u0ac7 \u0a9c\u0ac7 \u0ab8\u0abe\u0a82\u0aad\u0ab3\u0acb \u0a9b\u0acb \u0aa4\u0ac7 \u0ab2\u0a96\u0acb:",help_btn:"\u0ab8\u0ab9\u0abe\u0aaf",play_again:"\u0aa7\u0acd\u0ab5\u0aa8\u0abf \u0aab\u0ab0\u0ac0\u0aa5\u0ac0 \u0a9a\u0ab2\u0abe\u0ab5\u0acb", -cant_hear_this:"MP3 \u0aa4\u0ab0\u0ac0\u0a95\u0ac7 \u0aa7\u0acd\u0ab5\u0aa8\u0abf\u0aa8\u0ac7 \u0aa1\u0abe\u0a89\u0aa8\u0ab2\u0acb\u0aa1 \u0a95\u0ab0\u0acb",incorrect_try_again:"\u0a96\u0acb\u0a9f\u0ac1\u0a82. \u0aab\u0ab0\u0ac0 \u0aaa\u0acd\u0ab0\u0aaf\u0abe\u0ab8 \u0a95\u0ab0\u0acb.",image_alt_text:"reCAPTCHA \u0aaa\u0aa1\u0a95\u0abe\u0ab0 \u0a9b\u0aac\u0ac0"},RecaptchaStr_hi={visual_challenge:"\u0915\u094b\u0908 \u0935\u093f\u091c\u0941\u0905\u0932 \u091a\u0941\u0928\u094c\u0924\u0940 \u0932\u0947\u0902", -audio_challenge:"\u0915\u094b\u0908 \u0911\u0921\u093f\u092f\u094b \u091a\u0941\u0928\u094c\u0924\u0940 \u0932\u0947\u0902",refresh_btn:"\u0915\u094b\u0908 \u0928\u0908 \u091a\u0941\u0928\u094c\u0924\u0940 \u0932\u0947\u0902",instructions_visual:"\u0926\u094b \u0936\u092c\u094d\u200d\u0926 \u0932\u093f\u0916\u0947\u0902:",instructions_context:"\u0936\u092c\u094d\u200d\u0926\u094b\u0902 \u0915\u094b \u092c\u0949\u0915\u094d\u200d\u0938 \u092e\u0947\u0902 \u0932\u093f\u0916\u0947\u0902:",instructions_audio:"\u091c\u094b \u0906\u092a \u0938\u0941\u0928 \u0930\u0939\u0947 \u0939\u0948\u0902 \u0909\u0938\u0947 \u0932\u093f\u0916\u0947\u0902:", -help_btn:"\u0938\u0939\u093e\u092f\u0924\u093e",play_again:"\u0927\u094d\u200d\u0935\u0928\u093f \u092a\u0941\u0928: \u091a\u0932\u093e\u090f\u0902",cant_hear_this:"\u0927\u094d\u200d\u0935\u0928\u093f \u0915\u094b MP3 \u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902 \u0921\u093e\u0909\u0928\u0932\u094b\u0921 \u0915\u0930\u0947\u0902",incorrect_try_again:"\u0917\u0932\u0924. \u092a\u0941\u0928: \u092a\u094d\u0930\u092f\u093e\u0938 \u0915\u0930\u0947\u0902.",image_alt_text:"reCAPTCHA \u091a\u0941\u0928\u094c\u0924\u0940 \u091b\u0935\u093f"}, -RecaptchaStr_hr={visual_challenge:"Dohvati vizualni upit",audio_challenge:"Dohvati zvu\u010dni upit",refresh_btn:"Dohvati novi upit",instructions_visual:"Upi\u0161ite obje rije\u010di:",instructions_context:"Upi\u0161ite rije\u010di u okvire:",instructions_audio:"Upi\u0161ite \u0161to \u010dujete:",help_btn:"Pomo\u0107",play_again:"Ponovi zvuk",cant_hear_this:"Preuzmi zvuk u MP3 formatu",incorrect_try_again:"Nije to\u010dno. Poku\u0161ajte ponovno.",image_alt_text:"Slikovni izazov reCAPTCHA"},RecaptchaStr_hu= -{visual_challenge:"Vizu\u00e1lis kih\u00edv\u00e1s k\u00e9r\u00e9se",audio_challenge:"Hangkih\u00edv\u00e1s k\u00e9r\u00e9se",refresh_btn:"\u00daj kih\u00edv\u00e1s k\u00e9r\u00e9se",instructions_visual:"Adja meg a k\u00e9t sz\u00f3t:",instructions_context:"\u00cdrja be a szavakat a mez\u0151kbe:",instructions_audio:"\u00cdrja le, amit hall:",help_btn:"S\u00fag\u00f3",play_again:"Hang ism\u00e9telt lej\u00e1tsz\u00e1sa",cant_hear_this:"Hang let\u00f6lt\u00e9se MP3 form\u00e1tumban",incorrect_try_again:"Hib\u00e1s. Pr\u00f3b\u00e1lkozzon \u00fajra.", -image_alt_text:"reCAPTCHA ellen\u0151rz\u0151 k\u00e9p"},RecaptchaStr_hy={visual_challenge:"\u054d\u057f\u0561\u0576\u0561\u056c \u057f\u0565\u057d\u0578\u0572\u0561\u056f\u0561\u0576 \u056d\u0576\u0564\u056b\u0580",audio_challenge:"\u054d\u057f\u0561\u0576\u0561\u056c \u0571\u0561\u0575\u0576\u0561\u0575\u056b\u0576 \u056d\u0576\u0564\u056b\u0580",refresh_btn:"\u054d\u057f\u0561\u0576\u0561\u056c \u0576\u0578\u0580 \u056d\u0576\u0564\u056b\u0580",instructions_visual:"\u0544\u0578\u0582\u057f\u0584\u0561\u0563\u0580\u0565\u0584 \u0561\u0575\u057d \u0565\u0580\u056f\u0578\u0582 \u0562\u0561\u057c\u0565\u0580\u0568\u055d", -instructions_context:"\u0544\u0578\u0582\u057f\u0584\u0561\u0563\u0580\u0565\u0584 \u0562\u0561\u057c\u0565\u0580\u0568 \u057f\u0578\u0582\u0583\u0565\u0580\u0578\u0582\u0574\u055d",instructions_audio:"\u0544\u0578\u0582\u057f\u0584\u0561\u0563\u0580\u0565\u0584 \u0561\u0575\u0576, \u056b\u0576\u0579 \u056c\u057d\u0578\u0582\u0574 \u0565\u0584\u055d",help_btn:"\u0555\u0563\u0576\u0578\u0582\u0569\u0575\u0578\u0582\u0576",play_again:"\u0546\u057e\u0561\u0563\u0561\u0580\u056f\u0565\u056c \u0571\u0561\u0575\u0576\u0568 \u056f\u0580\u056f\u056b\u0576", -cant_hear_this:"\u0532\u0565\u057c\u0576\u0565\u056c \u0571\u0561\u0575\u0576\u0568 \u0578\u0580\u057a\u0565\u057d MP3",incorrect_try_again:"\u054d\u056d\u0561\u056c \u0567: \u0553\u0578\u0580\u0571\u0565\u0584 \u056f\u0580\u056f\u056b\u0576:",image_alt_text:""},RecaptchaStr_id={visual_challenge:"Dapatkan kata pengujian berbentuk visual",audio_challenge:"Dapatkan kata pengujian berbentuk audio",refresh_btn:"Dapatkan kata pengujian baru",instructions_visual:"Ketik dua kata ini:",instructions_context:"Ketik kata di dalam kotak:", -instructions_audio:"Ketik yang Anda dengar:",help_btn:"Bantuan",play_again:"Putar suara sekali lagi",cant_hear_this:"Unduh suara sebagai MP3",incorrect_try_again:"Salah. Coba lagi.",image_alt_text:"Gambar tantangan reCAPTCHA"},RecaptchaStr_is={visual_challenge:"F\u00e1 a\u00f0gangspr\u00f3f sem mynd",audio_challenge:"F\u00e1 hlj\u00f3\u00f0pr\u00f3f",refresh_btn:"F\u00e1 n\u00fdtt a\u00f0gangspr\u00f3f",instructions_visual:"Sl\u00e1\u00f0u inn \u00feessi tv\u00f6 or\u00f0:",instructions_context:"Sl\u00e1\u00f0u or\u00f0in inn \u00ed reitina:", -instructions_audio:"Sl\u00e1\u00f0u inn \u00fea\u00f0 sem \u00fe\u00fa heyrir:",help_btn:"Hj\u00e1lp",play_again:"Spila hlj\u00f3\u00f0 aftur",cant_hear_this:"S\u00e6kja hlj\u00f3\u00f0 sem MP3",incorrect_try_again:"Rangt. Reyndu aftur.",image_alt_text:"mynd reCAPTCHA a\u00f0gangspr\u00f3fs"},RecaptchaStr_it={visual_challenge:"Verifica visiva",audio_challenge:"Verifica audio",refresh_btn:"Nuova verifica",instructions_visual:"Digita le due parole:",instructions_context:"Digita le parole nelle caselle:", -instructions_audio:"Digita ci\u00f2 che senti:",help_btn:"Guida",play_again:"Riproduci di nuovo audio",cant_hear_this:"Scarica audio in MP3",incorrect_try_again:"Sbagliato. Riprova.",image_alt_text:"Immagine di verifica reCAPTCHA"},RecaptchaStr_iw={visual_challenge:"\u05e7\u05d1\u05dc \u05d0\u05ea\u05d2\u05e8 \u05d7\u05d6\u05d5\u05ea\u05d9",audio_challenge:"\u05e7\u05d1\u05dc \u05d0\u05ea\u05d2\u05e8 \u05e9\u05de\u05e2",refresh_btn:"\u05e7\u05d1\u05dc \u05d0\u05ea\u05d2\u05e8 \u05d7\u05d3\u05e9", -instructions_visual:"\u05d4\u05e7\u05dc\u05d3 \u05d0\u05ea \u05e9\u05ea\u05d9 \u05d4\u05de\u05d9\u05dc\u05d9\u05dd:",instructions_context:"\u05d4\u05e7\u05dc\u05d3 \u05d0\u05ea \u05d4\u05de\u05d9\u05dc\u05d9\u05dd \u05d1\u05ea\u05d9\u05d1\u05d5\u05ea:",instructions_audio:"\u05d4\u05e7\u05dc\u05d3 \u05d0\u05ea \u05de\u05d4 \u05e9\u05d0\u05ea\u05d4 \u05e9\u05d5\u05de\u05e2:",help_btn:"\u05e2\u05d6\u05e8\u05d4",play_again:"\u05d4\u05e4\u05e2\u05dc \u05e9\u05d5\u05d1 \u05d0\u05ea \u05d4\u05e9\u05de\u05e2", -cant_hear_this:"\u05d4\u05d5\u05e8\u05d3 \u05e9\u05de\u05e2 \u05db-3MP",incorrect_try_again:"\u05e9\u05d2\u05d5\u05d9. \u05e0\u05e1\u05d4 \u05e9\u05d5\u05d1.",image_alt_text:"\u05ea\u05de\u05d5\u05e0\u05ea \u05d0\u05ea\u05d2\u05e8 \u05e9\u05dc reCAPTCHA"},RecaptchaStr_ja={visual_challenge:"\u753b\u50cf\u3067\u78ba\u8a8d\u3057\u307e\u3059",audio_challenge:"\u97f3\u58f0\u3067\u78ba\u8a8d\u3057\u307e\u3059",refresh_btn:"\u5225\u306e\u5358\u8a9e\u3067\u3084\u308a\u76f4\u3057\u307e\u3059",instructions_visual:"2 \u3064\u306e\u5358\u8a9e\u3092\u5165\u529b\u3057\u307e\u3059:", -instructions_context:"\u30dc\u30c3\u30af\u30b9\u5185\u306e\u5358\u8a9e\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044:",instructions_audio:"\u805e\u3053\u3048\u305f\u5358\u8a9e\u3092\u5165\u529b\u3057\u307e\u3059:",help_btn:"\u30d8\u30eb\u30d7",play_again:"\u3082\u3046\u4e00\u5ea6\u805e\u304f",cant_hear_this:"MP3 \u3067\u97f3\u58f0\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9",incorrect_try_again:"\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u3082\u3046\u4e00\u5ea6\u3084\u308a\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002", -image_alt_text:"reCAPTCHA \u78ba\u8a8d\u7528\u753b\u50cf"},RecaptchaStr_kn={visual_challenge:"\u0ca6\u0cc3\u0cb6\u0ccd\u0caf \u0cb8\u0cb5\u0cbe\u0cb2\u0cca\u0c82\u0ca6\u0ca8\u0ccd\u0ca8\u0cc1 \u0cb8\u0ccd\u0cb5\u0cc0\u0c95\u0cb0\u0cbf\u0cb8\u0cbf",audio_challenge:"\u0c86\u0ca1\u0cbf\u0caf\u0ccb \u0cb8\u0cb5\u0cbe\u0cb2\u0cca\u0c82\u0ca6\u0ca8\u0ccd\u0ca8\u0cc1 \u0cb8\u0ccd\u0cb5\u0cc0\u0c95\u0cb0\u0cbf\u0cb8\u0cbf",refresh_btn:"\u0cb9\u0cca\u0cb8 \u0cb8\u0cb5\u0cbe\u0cb2\u0cca\u0c82\u0ca6\u0ca8\u0ccd\u0ca8\u0cc1 \u0caa\u0ca1\u0cc6\u0caf\u0cbf\u0cb0\u0cbf", -instructions_visual:"\u0c8e\u0cb0\u0ca1\u0cc1 \u0caa\u0ca6\u0c97\u0cb3\u0ca8\u0ccd\u0ca8\u0cc1 \u0c9f\u0cc8\u0caa\u0ccd \u0cae\u0cbe\u0ca1\u0cbf:",instructions_context:"\u0cac\u0cbe\u0c95\u0ccd\u0cb8\u0ccd\u200c\u0ca8\u0cb2\u0ccd\u0cb2\u0cbf \u0caa\u0ca6\u0c97\u0cb3\u0ca8\u0ccd\u0ca8\u0cc1 \u0c9f\u0cc8\u0caa\u0ccd\u200c \u0cae\u0cbe\u0ca1\u0cbf:",instructions_audio:"\u0ca8\u0cbf\u0cae\u0c97\u0cc6 \u0c95\u0cc7\u0cb3\u0cbf\u0cb8\u0cc1\u0cb5\u0cc1\u0ca6\u0ca8\u0ccd\u0ca8\u0cc1 \u0c9f\u0cc8\u0caa\u0ccd\u200c \u0cae\u0cbe\u0ca1\u0cbf:", -help_btn:"\u0cb8\u0cb9\u0cbe\u0caf",play_again:"\u0ca7\u0ccd\u0cb5\u0ca8\u0cbf\u0caf\u0ca8\u0ccd\u0ca8\u0cc1 \u0cae\u0ca4\u0ccd\u0ca4\u0cc6 \u0caa\u0ccd\u0cb2\u0cc7 \u0cae\u0cbe\u0ca1\u0cbf",cant_hear_this:"\u0ca7\u0ccd\u0cb5\u0ca8\u0cbf\u0caf\u0ca8\u0ccd\u0ca8\u0cc1 MP3 \u0cb0\u0cc2\u0caa\u0ca6\u0cb2\u0ccd\u0cb2\u0cbf \u0ca1\u0ccc\u0ca8\u0ccd\u200c\u0cb2\u0ccb\u0ca1\u0ccd \u0cae\u0cbe\u0ca1\u0cbf",incorrect_try_again:"\u0ca4\u0caa\u0ccd\u0caa\u0cbe\u0c97\u0cbf\u0ca6\u0cc6. \u0cae\u0ca4\u0ccd\u0ca4\u0cca\u0cae\u0ccd\u0cae\u0cc6 \u0caa\u0ccd\u0cb0\u0caf\u0ca4\u0ccd\u0ca8\u0cbf\u0cb8\u0cbf.", -image_alt_text:"reCAPTCHA \u0cb8\u0cb5\u0cbe\u0cb2\u0cc1 \u0c9a\u0cbf\u0ca4\u0ccd\u0cb0"},RecaptchaStr_ko={visual_challenge:"\uadf8\ub9bc\uc73c\ub85c \ubcf4\uc548\ubb38\uc790 \ubc1b\uae30",audio_challenge:"\uc74c\uc131\uc73c\ub85c \ubcf4\uc548\ubb38\uc790 \ubc1b\uae30",refresh_btn:"\ubcf4\uc548\ubb38\uc790 \uc0c8\ub85c \ubc1b\uae30",instructions_visual:"\ub450 \ub2e8\uc5b4 \uc785\ub825:",instructions_context:"\uc785\ub825\ub780\uc5d0 \ub2e8\uc5b4 \uc785\ub825:",instructions_audio:"\uc74c\uc131 \ubcf4\uc548\ubb38\uc790 \uc785\ub825:", -help_btn:"\ub3c4\uc6c0\ub9d0",play_again:"\uc74c\uc131 \ub2e4\uc2dc \ub4e3\uae30",cant_hear_this:"\uc74c\uc131\uc744 MP3\ub85c \ub2e4\uc6b4\ub85c\ub4dc",incorrect_try_again:"\ud2c0\ub838\uc2b5\ub2c8\ub2e4. \ub2e4\uc2dc \uc2dc\ub3c4\ud574 \uc8fc\uc138\uc694.",image_alt_text:"reCAPTCHA \uc694\uccad \uc774\ubbf8\uc9c0"},RecaptchaStr_lt={visual_challenge:"Gauti vaizdin\u012f atpa\u017einimo test\u0105",audio_challenge:"Gauti garso atpa\u017einimo test\u0105",refresh_btn:"Gauti nauj\u0105 atpa\u017einimo test\u0105", -instructions_visual:"\u012eveskite du \u017eod\u017eius:",instructions_context:"\u012eveskite \u017eod\u017eius laukeliuose:",instructions_audio:"\u012eveskite tai, k\u0105 girdite:",help_btn:"Pagalba",play_again:"Dar kart\u0105 paleisti gars\u0105",cant_hear_this:"Atsisi\u0173sti gars\u0105 kaip MP3",incorrect_try_again:"Neteisingai. Bandykite dar kart\u0105.",image_alt_text:"Testo \u201ereCAPTCHA\u201c vaizdas"},RecaptchaStr_lv={visual_challenge:"Sa\u0146emt vizu\u0101lu izaicin\u0101jumu",audio_challenge:"Sa\u0146emt audio izaicin\u0101jumu", -refresh_btn:"Sa\u0146emt jaunu izaicin\u0101jumu",instructions_visual:"Ierakstiet divus v\u0101rdus:",instructions_context:"Ierakstiet v\u0101rdus lodzi\u0146os:",instructions_audio:"Ierakstiet dzirdamo:",help_btn:"Pal\u012bdz\u012bba",play_again:"V\u0113lreiz atska\u0146ot ska\u0146u",cant_hear_this:"Lejupiel\u0101d\u0113t ska\u0146u MP3\u00a0form\u0101t\u0101",incorrect_try_again:"Nepareizi. M\u0113\u0123iniet v\u0113lreiz.",image_alt_text:"reCAPTCHA izaicin\u0101juma att\u0113ls"},RecaptchaStr_ml= -{visual_challenge:"\u0d12\u0d30\u0d41 \u0d26\u0d43\u0d36\u0d4d\u0d2f \u0d1a\u0d32\u0d1e\u0d4d\u0d1a\u0d4d \u0d28\u0d47\u0d1f\u0d41\u0d15",audio_challenge:"\u0d12\u0d30\u0d41 \u0d13\u0d21\u0d3f\u0d2f\u0d4b \u0d1a\u0d32\u0d1e\u0d4d\u0d1a\u0d4d \u0d28\u0d47\u0d1f\u0d41\u0d15",refresh_btn:"\u0d12\u0d30\u0d41 \u0d2a\u0d41\u0d24\u0d3f\u0d2f \u0d1a\u0d32\u0d1e\u0d4d\u0d1a\u0d4d \u0d28\u0d47\u0d1f\u0d41\u0d15",instructions_visual:"\u0d30\u0d23\u0d4d\u0d1f\u0d4d \u0d2a\u0d26\u0d19\u0d4d\u0d19\u0d7e \u0d1f\u0d48\u0d2a\u0d4d\u0d2a\u0d4d \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d41\u0d15:", -instructions_context:"\u0d2c\u0d4b\u0d15\u0d4d\u200c\u0d38\u0d41\u0d15\u0d33\u0d3f\u0d32\u0d46 \u0d2a\u0d26\u0d19\u0d4d\u0d19\u0d7e \u0d1f\u0d48\u0d2a\u0d4d\u0d2a\u0d41\u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d41\u0d15:",instructions_audio:"\u0d15\u0d47\u0d7e\u0d15\u0d4d\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d24\u0d4d \u0d1f\u0d48\u0d2a\u0d4d\u0d2a\u0d4d \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d42:",help_btn:"\u0d38\u0d39\u0d3e\u0d2f\u0d02",play_again:"\u0d36\u0d2c\u0d4d\u200c\u0d26\u0d02 \u0d35\u0d40\u0d23\u0d4d\u0d1f\u0d41\u0d02 \u0d2a\u0d4d\u0d32\u0d47 \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d41\u0d15", -cant_hear_this:"\u0d36\u0d2c\u0d4d\u200c\u0d26\u0d02 MP3 \u0d06\u0d2f\u0d3f \u0d21\u0d57\u0d7a\u0d32\u0d4b\u0d21\u0d4d \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d41\u0d15",incorrect_try_again:"\u0d24\u0d46\u0d31\u0d4d\u0d31\u0d3e\u0d23\u0d4d. \u0d35\u0d40\u0d23\u0d4d\u0d1f\u0d41\u0d02 \u0d36\u0d4d\u0d30\u0d2e\u0d3f\u0d15\u0d4d\u0d15\u0d41\u0d15.",image_alt_text:"reCAPTCHA \u0d1a\u0d32\u0d1e\u0d4d\u0d1a\u0d4d \u0d07\u0d2e\u0d47\u0d1c\u0d4d"},RecaptchaStr_mr={visual_challenge:"\u0926\u0943\u0936\u094d\u200d\u092f\u092e\u093e\u0928 \u0906\u0935\u094d\u0939\u093e\u0928 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u093e", -audio_challenge:"\u0911\u0921\u0940\u0913 \u0906\u0935\u094d\u0939\u093e\u0928 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u093e",refresh_btn:"\u090f\u0915 \u0928\u0935\u0940\u0928 \u0906\u0935\u094d\u0939\u093e\u0928 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u093e",instructions_visual:"\u0926\u094b\u0928 \u0936\u092c\u094d\u0926 \u091f\u093e\u0907\u092a \u0915\u0930\u093e:",instructions_context:"\u092c\u0949\u0915\u094d\u200d\u0938\u0947\u0938\u092e\u0927\u0940\u0932 \u0936\u092c\u094d\u200d\u0926 \u091f\u093e\u0907\u092a \u0915\u0930\u093e:", -instructions_audio:"\u0906\u092a\u0932\u094d\u092f\u093e\u0932\u093e \u091c\u0947 \u0910\u0915\u0942 \u092f\u0947\u0908\u0932 \u0924\u0947 \u091f\u093e\u0907\u092a \u0915\u0930\u093e:",help_btn:"\u092e\u0926\u0924",play_again:"\u0927\u094d\u200d\u0935\u0928\u0940 \u092a\u0941\u0928\u094d\u0939\u093e \u092a\u094d\u200d\u0932\u0947 \u0915\u0930\u093e",cant_hear_this:"MP3 \u0930\u0941\u092a\u093e\u0924 \u0927\u094d\u200d\u0935\u0928\u0940 \u0921\u093e\u0909\u0928\u0932\u094b\u0921 \u0915\u0930\u093e", -incorrect_try_again:"\u0905\u092f\u094b\u0917\u094d\u200d\u092f. \u092a\u0941\u0928\u094d\u200d\u0939\u093e \u092a\u094d\u0930\u092f\u0924\u094d\u200d\u0928 \u0915\u0930\u093e.",image_alt_text:"reCAPTCHA \u0906\u0935\u094d\u200d\u0939\u093e\u0928 \u092a\u094d\u0930\u0924\u093f\u092e\u093e"},RecaptchaStr_ms={visual_challenge:"Dapatkan cabaran visual",audio_challenge:"Dapatkan cabaran audio",refresh_btn:"Dapatkan cabaran baru",instructions_visual:"Taip kedua-dua perkataan:",instructions_context:"Taip perkataan dalam kotak:", -instructions_audio:"Taip apa yang didengari:",help_btn:"Bantuan",play_again:"Mainkan bunyi sekali lagi",cant_hear_this:"Muat turun bunyi sebagai MP3",incorrect_try_again:"Tidak betul. Cuba lagi.",image_alt_text:"Imej cabaran reCAPTCHA"},RecaptchaStr_nl={visual_challenge:"Een visuele uitdaging proberen",audio_challenge:"Een audio-uitdaging proberen",refresh_btn:"Een nieuwe uitdaging proberen",instructions_visual:"Typ de twee woorden:",instructions_context:"Typ de woorden in de vakken:",instructions_audio:"Typ wat u hoort:", -help_btn:"Help",play_again:"Geluid opnieuw afspelen",cant_hear_this:"Geluid downloaden als MP3",incorrect_try_again:"Onjuist. Probeer het opnieuw.",image_alt_text:"reCAPTCHA-uitdagingsafbeelding"},RecaptchaStr_no={visual_challenge:"F\u00e5 en bildeutfordring",audio_challenge:"F\u00e5 en lydutfordring",refresh_btn:"F\u00e5 en ny utfordring",instructions_visual:"Skriv inn de to ordene:",instructions_context:"Skriv inn ordene i feltene:",instructions_audio:"Skriv inn det du h\u00f8rer:",help_btn:"Hjelp", -play_again:"Spill av lyd p\u00e5 nytt",cant_hear_this:"Last ned lyd som MP3",incorrect_try_again:"Feil. Pr\u00f8v p\u00e5 nytt.",image_alt_text:"reCAPTCHA-utfordringsbilde"},RecaptchaStr_pl={visual_challenge:"Poka\u017c podpowied\u017a wizualn\u0105",audio_challenge:"Odtw\u00f3rz podpowied\u017a d\u017awi\u0119kow\u0105",refresh_btn:"Nowa podpowied\u017a",instructions_visual:"Wpisz oba wyrazy:",instructions_context:"Wpisz s\u0142owa wy\u015bwietlane w polach:",instructions_audio:"Wpisz us\u0142yszane s\u0142owa:", -help_btn:"Pomoc",play_again:"Odtw\u00f3rz d\u017awi\u0119k ponownie",cant_hear_this:"Pobierz d\u017awi\u0119k jako plik MP3",incorrect_try_again:"Nieprawid\u0142owo. Spr\u00f3buj ponownie.",image_alt_text:"Zadanie obrazkowe reCAPTCHA"},RecaptchaStr_pt={visual_challenge:"Obter um desafio visual",audio_challenge:"Obter um desafio de \u00e1udio",refresh_btn:"Obter um novo desafio",instructions_visual:"Digite as duas palavras:",instructions_context:"Digite as palavras das caixas:",instructions_audio:"Digite o que voc\u00ea ouve:", -help_btn:"Ajuda",play_again:"Reproduzir som novamente",cant_hear_this:"Fazer download do som no formato MP3",incorrect_try_again:"Incorreto. Tente novamente.",image_alt_text:"Imagem de desafio reCAPTCHA"},RecaptchaStr_pt_pt={visual_challenge:"Obter um desafio visual",audio_challenge:"Obter um desafio de \u00e1udio",refresh_btn:"Obter um novo desafio",instructions_visual:"Escreva as duas palavras:",instructions_context:"Escreva as palavras nas caixas:",instructions_audio:"Escreva o que ouvir:",help_btn:"Ajuda", -play_again:"Reproduzir som novamente",cant_hear_this:"Transferir som como MP3",incorrect_try_again:"Incorreto. Tente novamente.",image_alt_text:"Imagem de desafio reCAPTCHA"},RecaptchaStr_ro={visual_challenge:"Ob\u0163ine\u0163i un cod captcha vizual",audio_challenge:"Ob\u0163ine\u0163i un cod captcha audio",refresh_btn:"Ob\u0163ine\u0163i un nou cod captcha",instructions_visual:"Introduce\u0163i cele dou\u0103 cuvinte:",instructions_context:"Introduce\u0163i cuvintele \u00een casete:",instructions_audio:"Introduce\u0163i ceea ce auzi\u0163i:", -help_btn:"Ajutor",play_again:"Reda\u0163i sunetul din nou",cant_hear_this:"Desc\u0103rca\u0163i fi\u015fierul audio ca MP3",incorrect_try_again:"Incorect. \u00cencerca\u0163i din nou.",image_alt_text:"Imagine de verificare reCAPTCHA"},RecaptchaStr_ru={visual_challenge:"\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430",audio_challenge:"\u0417\u0432\u0443\u043a\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430",refresh_btn:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c", -instructions_visual:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u043e, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u0442\u0435:",instructions_context:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u043e\u0432\u0430:",instructions_audio:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u043e, \u0447\u0442\u043e \u0441\u043b\u044b\u0448\u0438\u0442\u0435:",help_btn:"\u0421\u043f\u0440\u0430\u0432\u043a\u0430",play_again:"\u041f\u0440\u043e\u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0435\u0449\u0435 \u0440\u0430\u0437", -cant_hear_this:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c MP3-\u0444\u0430\u0439\u043b",incorrect_try_again:"\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.",image_alt_text:"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e \u0441\u043b\u043e\u0432\u0443 reCAPTCHA"},RecaptchaStr_sk={visual_challenge:"Zobrazi\u0165 vizu\u00e1lnu podobu",audio_challenge:"Prehra\u0165 zvukov\u00fa podobu", -refresh_btn:"Zobrazi\u0165 nov\u00fd v\u00fdraz",instructions_visual:"Zadajte tieto dve slov\u00e1:",instructions_context:"Zadajte slov\u00e1 v poliach:",instructions_audio:"Zadajte, \u010do po\u010dujete:",help_btn:"Pomocn\u00edk",play_again:"Znova prehra\u0165 zvuk",cant_hear_this:"Prevzia\u0165 zvuk v podobe s\u00faboru MP3",incorrect_try_again:"Nespr\u00e1vne. Sk\u00faste to znova.",image_alt_text:"Obr\u00e1zok zadania reCAPTCHA"},RecaptchaStr_sl={visual_challenge:"Vizualni preskus",audio_challenge:"Zvo\u010dni preskus", -refresh_btn:"Nov preskus",instructions_visual:"Vnesite besedi:",instructions_context:"Vnesite besede v okvir\u010dkih:",instructions_audio:"Natipkajte, kaj sli\u0161ite:",help_btn:"Pomo\u010d",play_again:"Znova predvajaj zvok",cant_hear_this:"Prenesi zvok kot MP3",incorrect_try_again:"Napa\u010dno. Poskusite znova.",image_alt_text:"Slika izziva reCAPTCHA"},RecaptchaStr_sr={visual_challenge:"\u041f\u0440\u0438\u043c\u0438\u0442\u0435 \u0432\u0438\u0437\u0443\u0435\u043b\u043d\u0438 \u0443\u043f\u0438\u0442", -audio_challenge:"\u041f\u0440\u0438\u043c\u0438\u0442\u0435 \u0430\u0443\u0434\u0438\u043e \u0443\u043f\u0438\u0442",refresh_btn:"\u041f\u0440\u0438\u043c\u0438\u0442\u0435 \u043d\u043e\u0432\u0438 \u0443\u043f\u0438\u0442",instructions_visual:"\u041e\u0442\u043a\u0443\u0446\u0430\u0458\u0442\u0435 \u0434\u0432\u0435 \u0440\u0435\u0447\u0438:",instructions_context:"\u0423\u043a\u0443\u0446\u0430\u0458\u0442\u0435 \u0440\u0435\u0447\u0438 \u0443 \u043f\u043e\u0459\u0430:",instructions_audio:"\u041e\u0442\u043a\u0443\u0446\u0430\u0458\u0442\u0435 \u043e\u043d\u043e \u0448\u0442\u043e \u0447\u0443\u0458\u0435\u0442\u0435:", -help_btn:"\u041f\u043e\u043c\u043e\u045b",play_again:"\u041f\u043e\u043d\u043e\u0432\u043e \u043f\u0443\u0441\u0442\u0438 \u0437\u0432\u0443\u043a",cant_hear_this:"\u041f\u0440\u0435\u0443\u0437\u043c\u0438 \u0437\u0432\u0443\u043a \u043a\u0430\u043e MP3 \u0441\u043d\u0438\u043c\u0430\u043a",incorrect_try_again:"\u041d\u0435\u0442\u0430\u0447\u043d\u043e. \u041f\u043e\u043a\u0443\u0448\u0430\u0458\u0442\u0435 \u043f\u043e\u043d\u043e\u0432\u043e.",image_alt_text:"\u0421\u043b\u0438\u043a\u0430 reCAPTCHA \u043f\u0440\u043e\u0432\u0435\u0440\u0435"}, -RecaptchaStr_sv={visual_challenge:"H\u00e4mta captcha i bildformat",audio_challenge:"H\u00e4mta captcha i ljudformat",refresh_btn:"H\u00e4mta ny captcha",instructions_visual:"Skriv b\u00e5da orden:",instructions_context:"Skriv orden i rutorna:",instructions_audio:"Skriv det du h\u00f6r:",help_btn:"Hj\u00e4lp",play_again:"Spela upp ljudet igen",cant_hear_this:"H\u00e4mta ljud som MP3",incorrect_try_again:"Fel. F\u00f6rs\u00f6k igen.",image_alt_text:"reCAPTCHA-bild"},RecaptchaStr_sw={visual_challenge:"Pata changamoto ya kuona", -audio_challenge:"Pata changamoto ya sauti",refresh_btn:"Pata changamoto mpya",instructions_visual:"Charaza maneno mawili:",instructions_context:"Charaza maneno katika masanduku:",instructions_audio:"Charaza unachosikia:",help_btn:"Msaada",play_again:"Cheza sauti tena",cant_hear_this:"Pakua sauti kama MP3",incorrect_try_again:"Sio sahihi. Jaribu tena.",image_alt_text:"picha ya changamoto ya reCAPTCHA"},RecaptchaStr_ta={visual_challenge:"\u0baa\u0bbe\u0bb0\u0bcd\u0bb5\u0bc8 \u0b9a\u0bc7\u0bb2\u0b9e\u0bcd\u0b9a\u0bc8\u0baa\u0bcd \u0baa\u0bc6\u0bb1\u0bc1\u0b95", -audio_challenge:"\u0b86\u0b9f\u0bbf\u0baf\u0bcb \u0b9a\u0bc7\u0bb2\u0b9e\u0bcd\u0b9a\u0bc8\u0baa\u0bcd \u0baa\u0bc6\u0bb1\u0bc1\u0b95",refresh_btn:"\u0baa\u0bc1\u0ba4\u0bbf\u0baf \u0b9a\u0bc7\u0bb2\u0b9e\u0bcd\u0b9a\u0bc8\u0baa\u0bcd \u0baa\u0bc6\u0bb1\u0bc1\u0b95",instructions_visual:"\u0b9a\u0bca\u0bb1\u0bcd\u0b95\u0bb3\u0bc8 \u0b9f\u0bc8\u0baa\u0bcd \u0b9a\u0bc6\u0baf\u0bcd\u0b95:",instructions_context:"\u0baa\u0bc6\u0b9f\u0bcd\u0b9f\u0bbf\u0baf\u0bbf\u0bb2\u0bcd \u0b89\u0bb3\u0bcd\u0bb3 \u0b9a\u0bca\u0bb1\u0bcd\u0b95\u0bb3\u0bc8 \u0b89\u0bb3\u0bcd\u0bb3\u0bbf\u0b9f\u0bc1\u0b95:", -instructions_audio:"\u0b95\u0bc7\u0b9f\u0bcd\u0baa\u0ba4\u0bc8 \u0b9f\u0bc8\u0baa\u0bcd \u0b9a\u0bc6\u0baf\u0bcd\u0b95:",help_btn:"\u0b89\u0ba4\u0bb5\u0bbf",play_again:"\u0b92\u0bb2\u0bbf\u0baf\u0bc8 \u0bae\u0bc0\u0ba3\u0bcd\u0b9f\u0bc1\u0bae\u0bcd \u0b87\u0baf\u0b95\u0bcd\u0b95\u0bc1",cant_hear_this:"\u0b92\u0bb2\u0bbf\u0baf\u0bc8 MP3 \u0b86\u0b95 \u0baa\u0ba4\u0bbf\u0bb5\u0bbf\u0bb1\u0b95\u0bcd\u0b95\u0bc1\u0b95",incorrect_try_again:"\u0ba4\u0bb5\u0bb1\u0bbe\u0ba9\u0ba4\u0bc1. \u0bae\u0bc0\u0ba3\u0bcd\u0b9f\u0bc1\u0bae\u0bcd \u0bae\u0bc1\u0baf\u0bb2\u0bb5\u0bc1\u0bae\u0bcd.", -image_alt_text:"reCAPTCHA \u0b9a\u0bc7\u0bb2\u0b9e\u0bcd\u0b9a\u0bcd \u0baa\u0b9f\u0bae\u0bcd"},RecaptchaStr_te={visual_challenge:"\u0c12\u0c15 \u0c26\u0c43\u0c36\u0c4d\u0c2f\u0c2e\u0c3e\u0c28 \u0c38\u0c35\u0c3e\u0c32\u0c41\u0c28\u0c41 \u0c38\u0c4d\u0c35\u0c40\u0c15\u0c30\u0c3f\u0c02\u0c1a\u0c02\u0c21\u0c3f",audio_challenge:"\u0c12\u0c15 \u0c06\u0c21\u0c3f\u0c2f\u0c4b \u0c38\u0c35\u0c3e\u0c32\u0c41\u0c28\u0c41 \u0c38\u0c4d\u0c35\u0c40\u0c15\u0c30\u0c3f\u0c02\u0c1a\u0c02\u0c21\u0c3f",refresh_btn:"\u0c15\u0c4d\u0c30\u0c4a\u0c24\u0c4d\u0c24 \u0c38\u0c35\u0c3e\u0c32\u0c41\u0c28\u0c41 \u0c38\u0c4d\u0c35\u0c40\u0c15\u0c30\u0c3f\u0c02\u0c1a\u0c02\u0c21\u0c3f", -instructions_visual:"\u0c30\u0c46\u0c02\u0c21\u0c41 \u0c2a\u0c26\u0c3e\u0c32\u0c28\u0c41 \u0c1f\u0c48\u0c2a\u0c4d \u0c1a\u0c47\u0c2f\u0c02\u0c21\u0c3f:",instructions_context:"\u0c2a\u0c26\u0c3e\u0c32\u0c28\u0c41 \u0c2a\u0c46\u0c1f\u0c4d\u0c1f\u0c46\u0c32\u0c4d\u0c32\u0c4b \u0c1f\u0c48\u0c2a\u0c4d \u0c1a\u0c47\u0c2f\u0c02\u0c21\u0c3f:",instructions_audio:"\u0c2e\u0c40\u0c30\u0c41 \u0c35\u0c3f\u0c28\u0c4d\u0c28\u0c26\u0c3f \u0c1f\u0c48\u0c2a\u0c4d \u0c1a\u0c47\u0c2f\u0c02\u0c21\u0c3f:",help_btn:"\u0c38\u0c39\u0c3e\u0c2f\u0c02", -play_again:"\u0c27\u0c4d\u0c35\u0c28\u0c3f\u0c28\u0c3f \u0c2e\u0c33\u0c4d\u0c32\u0c40 \u0c2a\u0c4d\u0c32\u0c47 \u0c1a\u0c47\u0c2f\u0c3f",cant_hear_this:"\u0c27\u0c4d\u0c35\u0c28\u0c3f\u0c28\u0c3f MP3 \u0c35\u0c32\u0c46 \u0c21\u0c4c\u0c28\u0c4d\u200c\u0c32\u0c4b\u0c21\u0c4d \u0c1a\u0c47\u0c2f\u0c3f",incorrect_try_again:"\u0c24\u0c2a\u0c4d\u0c2a\u0c41. \u0c2e\u0c33\u0c4d\u0c32\u0c40 \u0c2a\u0c4d\u0c30\u0c2f\u0c24\u0c4d\u0c28\u0c3f\u0c02\u0c1a\u0c02\u0c21\u0c3f.",image_alt_text:"reCAPTCHA \u0c38\u0c35\u0c3e\u0c32\u0c41 \u0c1a\u0c3f\u0c24\u0c4d\u0c30\u0c02"}, -RecaptchaStr_th={visual_challenge:"\u0e23\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e17\u0e49\u0e32\u0e17\u0e32\u0e22\u0e14\u0e49\u0e32\u0e19\u0e20\u0e32\u0e1e",audio_challenge:"\u0e23\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e17\u0e49\u0e32\u0e17\u0e32\u0e22\u0e14\u0e49\u0e32\u0e19\u0e40\u0e2a\u0e35\u0e22\u0e07",refresh_btn:"\u0e23\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e17\u0e49\u0e32\u0e17\u0e32\u0e22\u0e43\u0e2b\u0e21\u0e48",instructions_visual:"\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e04\u0e33\u0e2a\u0e2d\u0e07\u0e04\u0e33\u0e19\u0e31\u0e49\u0e19:", -instructions_context:"\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e04\u0e33\u0e19\u0e31\u0e49\u0e19\u0e43\u0e19\u0e0a\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49:",instructions_audio:"\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e2a\u0e34\u0e48\u0e07\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e44\u0e14\u0e49\u0e22\u0e34\u0e19:",help_btn:"\u0e04\u0e27\u0e32\u0e21\u0e0a\u0e48\u0e27\u0e22\u0e40\u0e2b\u0e25\u0e37\u0e2d",play_again:"\u0e40\u0e25\u0e48\u0e19\u0e40\u0e2a\u0e35\u0e22\u0e07\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07",cant_hear_this:"\u0e14\u0e32\u0e27\u0e42\u0e2b\u0e25\u0e14\u0e40\u0e2a\u0e35\u0e22\u0e07\u0e40\u0e1b\u0e47\u0e19 MP3", -incorrect_try_again:"\u0e44\u0e21\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07 \u0e25\u0e2d\u0e07\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07",image_alt_text:"\u0e23\u0e2b\u0e31\u0e2a\u0e20\u0e32\u0e1e reCAPTCHA"},RecaptchaStr_tr={visual_challenge:"G\u00f6rsel sorgu al",audio_challenge:"Sesli sorgu al",refresh_btn:"Yeniden y\u00fckle",instructions_visual:"\u0130ki kelimeyi yaz\u0131n:",instructions_context:"Kutudaki kelimeleri yaz\u0131n:",instructions_audio:"Duydu\u011funuzu yaz\u0131n:", -help_btn:"Yard\u0131m",play_again:"Sesi tekrar \u00e7al",cant_hear_this:"Sesi MP3 olarak indir",incorrect_try_again:"Yanl\u0131\u015f. Tekrar deneyin.",image_alt_text:"reCAPTCHA sorusu resmi"},RecaptchaStr_uk={visual_challenge:"\u041e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0432\u0456\u0437\u0443\u0430\u043b\u044c\u043d\u0438\u0439 \u0442\u0435\u043a\u0441\u0442",audio_challenge:"\u041e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0430\u0443\u0434\u0456\u043e\u0437\u0430\u043f\u0438\u0441",refresh_btn:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u0442\u0435\u043a\u0441\u0442", -instructions_visual:"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0434\u0432\u0430 \u0441\u043b\u043e\u0432\u0430:",instructions_context:"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u0432 \u043f\u043e\u043b\u044f:",instructions_audio:"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0447\u0443\u0442\u0435:",help_btn:"\u0414\u043e\u0432\u0456\u0434\u043a\u0430",play_again:"\u0412\u0456\u0434\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u0430\u043f\u0438\u0441 \u0449\u0435 \u0440\u0430\u0437", -cant_hear_this:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0437\u0430\u043f\u0438\u0441 \u044f\u043a MP3",incorrect_try_again:"\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.",image_alt_text:"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f reCAPTCHA"},RecaptchaStr_ur={visual_challenge:"\u0627\u06cc\u06a9 \u0645\u0631\u0626\u06cc \u0686\u06cc\u0644\u0646\u062c \u062d\u0627\u0635\u0644 \u06a9\u0631\u06cc\u06ba", -audio_challenge:"\u0627\u06cc\u06a9 \u0622\u0688\u06cc\u0648 \u0686\u06cc\u0644\u0646\u062c \u062d\u0627\u0635\u0644 \u06a9\u0631\u06cc\u06ba",refresh_btn:"\u0627\u06cc\u06a9 \u0646\u06cc\u0627 \u0686\u06cc\u0644\u0646\u062c \u062d\u0627\u0635\u0644 \u06a9\u0631\u06cc\u06ba",instructions_visual:"\u062f\u0648 \u0627\u0644\u0641\u0627\u0638 \u0679\u0627\u0626\u067e \u06a9\u0631\u06cc\u06ba:",instructions_context:"\u0627\u0644\u0641\u0627\u0638 \u06a9\u0648 \u062e\u0627\u0646\u0648\u06ba \u0645\u06cc\u06ba \u0679\u0627\u0626\u067e \u06a9\u0631\u06cc\u06ba:", -instructions_audio:"\u0622\u067e \u06a9\u0648 \u062c\u0648 \u0633\u0646\u0627\u0626\u06cc \u062f\u06cc\u062a\u0627 \u06c1\u06d2 \u0627\u0633\u06d2 \u0679\u0627\u0626\u067e \u06a9\u0631\u06cc\u06ba:",help_btn:"\u0645\u062f\u062f",play_again:"\u0622\u0648\u0627\u0632 \u062f\u0648\u0628\u0627\u0631\u06c1 \u0686\u0644\u0627\u0626\u06cc\u06ba",cant_hear_this:"\u0622\u0648\u0627\u0632 \u06a9\u0648 MP3 \u06a9\u06d2 \u0628\u0637\u0648\u0631 \u0688\u0627\u0624\u0646 \u0644\u0648\u0688 \u06a9\u0631\u06cc\u06ba", -incorrect_try_again:"\u063a\u0644\u0637\u06d4 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06cc\u06ba\u06d4",image_alt_text:"reCAPTCHA \u0686\u06cc\u0644\u0646\u062c \u0648\u0627\u0644\u06cc \u0634\u0628\u06cc\u06c1"},RecaptchaStr_vi={visual_challenge:"Nh\u1eadn th\u1eed th\u00e1ch h\u00ecnh \u1ea3nh",audio_challenge:"Nh\u1eadn th\u1eed th\u00e1ch \u00e2m thanh",refresh_btn:"Nh\u1eadn th\u1eed th\u00e1ch m\u1edbi",instructions_visual:"Nh\u1eadp hai t\u1eeb:",instructions_context:"Nh\u1eadp c\u00e1c t\u1eeb trong c\u00e1c \u00f4:", -instructions_audio:"Nh\u1eadp n\u1ed9i dung b\u1ea1n nghe th\u1ea5y:",help_btn:"Tr\u1ee3 gi\u00fap",play_again:"Ph\u00e1t l\u1ea1i \u00e2m thanh",cant_hear_this:"T\u1ea3i \u00e2m thanh xu\u1ed1ng d\u01b0\u1edbi d\u1ea1ng MP3",incorrect_try_again:"Kh\u00f4ng ch\u00ednh x\u00e1c. H\u00e3y th\u1eed l\u1ea1i.",image_alt_text:"H\u00ecnh x\u00e1c th\u1ef1c reCAPTCHA"},RecaptchaStr_zh_cn={visual_challenge:"\u6536\u5230\u4e00\u4e2a\u89c6\u9891\u9080\u8bf7",audio_challenge:"\u6362\u4e00\u7ec4\u97f3\u9891\u9a8c\u8bc1\u7801", -refresh_btn:"\u6362\u4e00\u7ec4\u9a8c\u8bc1\u7801",instructions_visual:"\u8bf7\u952e\u5165\u8fd9\u4e24\u4e2a\u8bcd\uff1a",instructions_context:"\u952e\u5165\u6846\u4e2d\u663e\u793a\u7684\u5b57\u8bcd\uff1a",instructions_audio:"\u8bf7\u952e\u5165\u60a8\u542c\u5230\u7684\u5185\u5bb9\uff1a",help_btn:"\u5e2e\u52a9",play_again:"\u91cd\u65b0\u64ad\u653e",cant_hear_this:"\u4ee5 MP3 \u683c\u5f0f\u4e0b\u8f7d\u58f0\u97f3",incorrect_try_again:"\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u8bd5\u3002",image_alt_text:"reCAPTCHA \u9a8c\u8bc1\u56fe\u7247"}, -RecaptchaStr_zh_hk={visual_challenge:"\u56de\u7b54\u5716\u50cf\u9a57\u8b49\u554f\u984c",audio_challenge:"\u53d6\u5f97\u8a9e\u97f3\u9a57\u8b49\u554f\u984c",refresh_btn:"\u63db\u4e00\u500b\u9a57\u8b49\u554f\u984c",instructions_visual:"\u8acb\u8f38\u5165\u9019\u5169\u500b\u5b57\uff1a",instructions_context:"\u5728\u6846\u5167\u8f38\u5165\u5b57\u8a5e\uff1a",instructions_audio:"\u9375\u5165\u60a8\u6240\u807d\u5230\u7684\uff1a",help_btn:"\u8aaa\u660e",play_again:"\u518d\u6b21\u64ad\u653e\u8072\u97f3",cant_hear_this:"\u5c07\u8072\u97f3\u4e0b\u8f09\u70ba MP3", -incorrect_try_again:"\u4e0d\u6b63\u78ba\uff0c\u518d\u8a66\u4e00\u6b21\u3002",image_alt_text:"reCAPTCHA \u9a57\u8b49\u6587\u5b57\u5716\u7247"},RecaptchaStr_zh_tw={visual_challenge:"\u53d6\u5f97\u5716\u7247\u9a57\u8b49\u554f\u984c",audio_challenge:"\u53d6\u5f97\u8a9e\u97f3\u9a57\u8b49\u554f\u984c",refresh_btn:"\u53d6\u5f97\u65b0\u7684\u9a57\u8b49\u554f\u984c",instructions_visual:"\u8acb\u8f38\u5165\u4e0b\u5716\u4e2d\u7684\u5169\u500b\u5b57\uff1a",instructions_context:"\u8acb\u8f38\u5165\u65b9\u584a\u4e2d\u7684\u6587\u5b57\uff1a", -instructions_audio:"\u8acb\u8f38\u5165\u8a9e\u97f3\u5167\u5bb9\uff1a",help_btn:"\u8aaa\u660e",play_again:"\u518d\u6b21\u64ad\u653e",cant_hear_this:"\u4ee5 MP3 \u683c\u5f0f\u4e0b\u8f09\u8072\u97f3",incorrect_try_again:"\u9a57\u8b49\u78bc\u6709\u8aa4\uff0c\u8acb\u518d\u8a66\u4e00\u6b21\u3002",image_alt_text:"reCAPTCHA \u9a57\u8b49\u6587\u5b57\u5716\u7247"},RecaptchaStr_zu={visual_challenge:"Thola inselelo ebonakalayo",audio_challenge:"Thola inselelo yokulalelwayo",refresh_btn:"Thola inselelo entsha", -instructions_visual:"Bhala lawa magama amabili:",instructions_context:"Bhala amagama asemabhokisini:",instructions_audio:"Bhala okuzwayo:",help_btn:"Usizo",play_again:"Phinda udlale okulalelwayo futhi",cant_hear_this:"Layisha umsindo njenge-MP3",incorrect_try_again:"Akulungile. Zama futhi.",image_alt_text:"umfanekiso oyinselelo we-reCAPTCHA"},RecaptchaLangMap={en:RecaptchaStr_en,af:RecaptchaStr_af,am:RecaptchaStr_am,ar:RecaptchaStr_ar,"ar-EG":RecaptchaStr_ar,bg:RecaptchaStr_bg,bn:RecaptchaStr_bn, -ca:RecaptchaStr_ca,cs:RecaptchaStr_cs,da:RecaptchaStr_da,de:RecaptchaStr_de,el:RecaptchaStr_el,"en-GB":RecaptchaStr_en,"en-US":RecaptchaStr_en,es:RecaptchaStr_es,"es-419":RecaptchaStr_es_419,"es-ES":RecaptchaStr_es,et:RecaptchaStr_et,eu:RecaptchaStr_eu,fa:RecaptchaStr_fa,fi:RecaptchaStr_fi,fil:RecaptchaStr_fil,fr:RecaptchaStr_fr,"fr-CA":RecaptchaStr_fr_ca,"fr-FR":RecaptchaStr_fr,gl:RecaptchaStr_gl,gu:RecaptchaStr_gu,hi:RecaptchaStr_hi,hr:RecaptchaStr_hr,hu:RecaptchaStr_hu,hy:RecaptchaStr_hy,id:RecaptchaStr_id, -is:RecaptchaStr_is,it:RecaptchaStr_it,iw:RecaptchaStr_iw,ja:RecaptchaStr_ja,kn:RecaptchaStr_kn,ko:RecaptchaStr_ko,ln:RecaptchaStr_fr,lt:RecaptchaStr_lt,lv:RecaptchaStr_lv,ml:RecaptchaStr_ml,mr:RecaptchaStr_mr,ms:RecaptchaStr_ms,nl:RecaptchaStr_nl,no:RecaptchaStr_no,pl:RecaptchaStr_pl,pt:RecaptchaStr_pt,"pt-BR":RecaptchaStr_pt,"pt-PT":RecaptchaStr_pt_pt,ro:RecaptchaStr_ro,ru:RecaptchaStr_ru,sk:RecaptchaStr_sk,sl:RecaptchaStr_sl,sr:RecaptchaStr_sr,sv:RecaptchaStr_sv,sw:RecaptchaStr_sw,ta:RecaptchaStr_ta, -te:RecaptchaStr_te,th:RecaptchaStr_th,tr:RecaptchaStr_tr,uk:RecaptchaStr_uk,ur:RecaptchaStr_ur,vi:RecaptchaStr_vi,"zh-CN":RecaptchaStr_zh_cn,"zh-HK":RecaptchaStr_zh_hk,"zh-TW":RecaptchaStr_zh_tw,zu:RecaptchaStr_zu,tl:RecaptchaStr_fil,he:RecaptchaStr_iw,"in":RecaptchaStr_id,mo:RecaptchaStr_ro,zh:RecaptchaStr_zh_cn};var RecaptchaStr=RecaptchaStr_en,RecaptchaOptions,RecaptchaDefaultOptions={tabindex:0,theme:"red",callback:null,lang:null,custom_theme_widget:null,custom_translations:null,includeContext:!1},Recaptcha={widget:null,timer_id:-1,style_set:!1,theme:null,type:"image",ajax_verify_cb:null,$:function(a){return"string"==typeof a?document.getElementById(a):a},create:function(a,b,c){Recaptcha.destroy();b&&(Recaptcha.widget=Recaptcha.$(b));Recaptcha._init_options(c);Recaptcha._call_challenge(a)},destroy:function(){var a= -Recaptcha.$("recaptcha_challenge_field");a&&a.parentNode.removeChild(a);-1!=Recaptcha.timer_id&&clearInterval(Recaptcha.timer_id);Recaptcha.timer_id=-1;if(a=Recaptcha.$("recaptcha_image"))a.innerHTML="";Recaptcha.widget&&("custom"!=Recaptcha.theme?Recaptcha.widget.innerHTML="":Recaptcha.widget.style.display="none",Recaptcha.widget=null)},focus_response_field:function(){var a=Recaptcha.$("recaptcha_response_field");a.focus()},get_challenge:function(){return"undefined"==typeof RecaptchaState?null:RecaptchaState.challenge}, -get_response:function(){var a=Recaptcha.$("recaptcha_response_field");return!a?null:a.value},ajax_verify:function(a){Recaptcha.ajax_verify_cb=a;var a=Recaptcha.get_challenge()||"",b=Recaptcha.get_response()||"",a=Recaptcha._get_api_server()+"/ajaxverify?c="+encodeURIComponent(a)+"&response="+encodeURIComponent(b);Recaptcha._add_script(a)},_ajax_verify_callback:function(a){Recaptcha.ajax_verify_cb(a)},_get_api_server:function(){var a=window.location.protocol,b;if("undefined"!=typeof _RecaptchaOverrideApiServer)b= -_RecaptchaOverrideApiServer;else{if("undefined"!=typeof RecaptchaState&&"string"==typeof RecaptchaState.server&&0a.length?document.body:a[0]},_hash_merge:function(a){for(var b={},c=0;c'+a+"");else{var b=document.createElement("style");b.type="text/css";b.styleSheet? -b.styleSheet.cssText=a:(a=document.createTextNode(a),b.appendChild(a));Recaptcha._get_script_area().appendChild(b)}},_set_style:function(a){Recaptcha.style_set||(Recaptcha.style_set=!0,Recaptcha._add_css(a+"\n\n.recaptcha_is_showing_audio .recaptcha_only_if_image,.recaptcha_isnot_showing_audio .recaptcha_only_if_audio,.recaptcha_had_incorrect_sol .recaptcha_only_if_no_incorrect_sol,.recaptcha_nothad_incorrect_sol .recaptcha_only_if_incorrect_sol{display:none !important}"))},_init_builtin_theme:function(){var a= -Recaptcha.$,b=Recaptcha._get_api_server(),c=b.length-1;"/"==b[c]&&(b=b.substring(0,c));var c=RecaptchaTemplates.VertCss,d=RecaptchaTemplates.VertHtml,e=b+"/img/"+Recaptcha.theme,f="gif",b=Recaptcha.theme;"clean"==b&&(c=RecaptchaTemplates.CleanCss,d=RecaptchaTemplates.CleanHtml,f="png");"context"==b&&(d=RecaptchaTemplates.ContextHtml);c=c.replace(/IMGROOT/g,e);Recaptcha._set_style(c);Recaptcha.widget.innerHTML='
      '+d+"
      ";c=function(b,c,d,h){var g=a(b+"_btn"),b=a(b);b.src= -e+"/"+c+"."+f;c=RecaptchaStr[d];b.alt=c;g.title=c;g.href=h};c("recaptcha_reload","refresh","refresh_btn","javascript:Recaptcha.reload();");c("recaptcha_switch_audio","audio","audio_challenge","javascript:Recaptcha.switch_type('audio');");c("recaptcha_switch_img","text","visual_challenge","javascript:Recaptcha.switch_type('image');");c("recaptcha_whatsthis","help","help_btn",Recaptcha._get_help_link());a("recaptcha_whatsthis_btn").target="_blank";a("recaptcha_whatsthis_btn").onclick=function(){Recaptcha.showhelp(); -return false};"clean"==b&&(a("recaptcha_logo").src=e+"/logo."+f,a("recaptcha_tagline").src=e+"/tagline."+f);a("recaptcha_table").className="recaptchatable recaptcha_theme_"+Recaptcha.theme;b=function(b,c){var d=a(b);if(d){if(RecaptchaState.rtl&&"span"==d.tagName.toLowerCase())d.dir="rtl";d.appendChild(document.createTextNode(RecaptchaStr[c]))}};b("recaptcha_instructions_image","instructions_visual");b("recaptcha_instructions_context","instructions_context");b("recaptcha_instructions_audio","instructions_audio"); -b("recaptcha_instructions_error","incorrect_try_again")},_finish_widget:function(){var a=Recaptcha.$,b=RecaptchaOptions,c=b.theme,d={blackglass:1,clean:1,context:1,custom:1,red:1,white:1};c in d||(c="red");Recaptcha.theme||(Recaptcha.theme=c);"custom"!=Recaptcha.theme?Recaptcha._init_builtin_theme():Recaptcha._set_style("");c=document.createElement("span");c.id="recaptcha_challenge_field_holder";c.style.display="none";a("recaptcha_response_field").parentNode.insertBefore(c,a("recaptcha_response_field")); -a("recaptcha_response_field").setAttribute("autocomplete","off");a("recaptcha_image").style.width="300px";a("recaptcha_image").style.height="57px";Recaptcha.should_focus=!1;Recaptcha._set_challenge(RecaptchaState.challenge,"image");Recaptcha.updateTabIndexes_();Recaptcha.widget&&(Recaptcha.widget.style.display="");b.callback&&b.callback()},updateTabIndexes_:function(){var a=Recaptcha.$,b=RecaptchaOptions;if(b.tabindex&&(b=b.tabindex,a("recaptcha_response_field").tabIndex=b++,"audio"==Recaptcha.type&& -a("recaptcha_audio_play_again")&&(a("recaptcha_audio_play_again").tabIndex=b++,a("recaptcha_audio_download"),a("recaptcha_audio_download").tabIndex=b++),"custom"!=Recaptcha.theme))a("recaptcha_reload_btn").tabIndex=b++,a("recaptcha_switch_audio_btn").tabIndex=b++,a("recaptcha_switch_img_btn").tabIndex=b++,a("recaptcha_whatsthis_btn").tabIndex=b},switch_type:function(a){Recaptcha.type=a;Recaptcha.reload("audio"==Recaptcha.type?"a":"v")},reload:function(a){var b=RecaptchaOptions,c=RecaptchaState;"undefined"== -typeof a&&(a="r");c=Recaptcha._get_api_server()+"/reload?c="+c.challenge+"&k="+c.site+"&reason="+a+"&type="+Recaptcha.type;b.includeContext&&(c+="&includeContext=1");Recaptcha.getLang_()&&(c+="&lang="+Recaptcha.getLang_());"undefined"!=typeof b.extra_challenge_params&&(c+="&"+b.extra_challenge_params);"audio"==Recaptcha.type&&(c=b.audio_beta_12_08?c+"&audio_beta_12_08=1":c+"&new_audio_default=1");Recaptcha.should_focus="t"!=a;Recaptcha._add_script(c)},finish_reload:function(a,b){RecaptchaState.is_incorrect= -!1;Recaptcha._set_challenge(a,b);Recaptcha.updateTabIndexes_()},_set_challenge:function(a,b){var c=Recaptcha.$,d=RecaptchaState;d.challenge=a;Recaptcha.type=b;c("recaptcha_challenge_field_holder").innerHTML='';if("audio"==b)c("recaptcha_image").innerHTML=Recaptcha.getAudioCaptchaHtml();else if("image"==b){var e=Recaptcha._get_api_server()+"/image?c="+d.challenge;c("recaptcha_image").innerHTML= -''+RecaptchaStr.image_alt_text+''}Recaptcha._css_toggle("recaptcha_had_incorrect_sol","recaptcha_nothad_incorrect_sol",d.is_incorrect);Recaptcha._css_toggle("recaptcha_is_showing_audio","recaptcha_isnot_showing_audio","audio"==b);Recaptcha._clear_input();Recaptcha.should_focus&&Recaptcha.focus_response_field();Recaptcha._reset_timer()},_reset_timer:function(){clearInterval(Recaptcha.timer_id);var a=Math.max(1E3*(RecaptchaState.timeout- -60),6E4);Recaptcha.timer_id=setInterval('Recaptcha.reload("t");',a);return a},showhelp:function(){window.open(Recaptcha._get_help_link(),"recaptcha_popup","width=460,height=580,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes")},_clear_input:function(){Recaptcha.$("recaptcha_response_field").value=""},_displayerror:function(a){var b=Recaptcha.$;b("recaptcha_image").innerHTML="";b("recaptcha_image").appendChild(document.createTextNode(a))},reloaderror:function(a){Recaptcha._displayerror(a)}, -_is_ie:function(){return 0
      ': -'',c="";Recaptcha.checkFlashVer()&&(c="
      "+Recaptcha.getSpan_(''+RecaptchaStr.play_again+"")); -c+="
      "+Recaptcha.getSpan_(''+RecaptchaStr.cant_hear_this+"");return b+c},getSpan_:function(a){return""+a+""},gethttpwavurl:function(){if("audio"!=Recaptcha.type)return"";var a=Recaptcha._get_api_server()+"/image?c="+RecaptchaState.challenge;0==a.indexOf("https://")&&(a="http://"+a.substring(8));return a},checkFlashVer:function(){var a= --1!=navigator.appVersion.indexOf("MSIE"),b=-1!=navigator.appVersion.toLowerCase().indexOf("win"),c=-1!=navigator.userAgent.indexOf("Opera"),d=-1;if(null!=navigator.plugins&&0 $value ) - $req .= $key . '=' . urlencode( stripslashes($value) ) . '&'; - - // Cut the last '&' - $req=substr($req,0,strlen($req)-1); - return $req; -} -} - - - -/** - * Submits an HTTP POST to a reCAPTCHA server - * @param string $host - * @param string $path - * @param array $data - * @param int port - * @return array response - */ -if ( ! function_exists( '_recaptcha_http_post' ) ) { -function _recaptcha_http_post($host, $path, $data, $port = 80) { - - $req = _recaptcha_qsencode ($data); - - $http_request = "POST $path HTTP/1.0\r\n"; - $http_request .= "Host: $host\r\n"; - $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; - $http_request .= "Content-Length: " . strlen($req) . "\r\n"; - $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; - $http_request .= "\r\n"; - $http_request .= $req; - - $response = ''; - if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) { - throw new Exception('Could not open socket'); - } - - fwrite($fs, $http_request); - - while ( !feof($fs) ) - $response .= fgets($fs, 1160); // One TCP-IP packet - fclose($fs); - $response = explode("\r\n\r\n", $response, 2); - - return $response; -} -} - - - -/** - * Gets the challenge HTML (javascript and non-javascript version). - * This is called from the browser, and the resulting reCAPTCHA HTML widget - * is embedded within the HTML form it was called from. - * @param string $pubkey A public key for reCAPTCHA - * @param string $error The error given by reCAPTCHA (optional, default is null) - * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false) - - * @return string - The HTML to be embedded in the user's form. - */ -if ( ! function_exists( 'recaptcha_get_html' ) ) { -function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) -{ - if ($pubkey == null || $pubkey == '') { - throw new Exception ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); - } - - if ($use_ssl) { - $server = RECAPTCHA_API_SECURE_SERVER; - } else { - $server = RECAPTCHA_API_SERVER; - } - - $errorpart = ""; - if ($error) { - $errorpart = "&error=" . $error; - } - return ' - - '; -} -} - - - - -/** - * A ReCaptchaResponse is returned from recaptcha_check_answer() - */ -if ( ! class_exists( 'ReCaptchaResponse' ) ) { -class ReCaptchaResponse { - var $is_valid; - var $error; -} -} - - -/** - * Calls an HTTP POST function to verify if the user's guess was correct - * @param string $privkey - * @param string $remoteip - * @param string $challenge - * @param string $response - * @param array $extra_params an array of extra variables to post to the server - * @return ReCaptchaResponse - */ -if ( ! function_exists( 'recaptcha_check_answer' ) ) { -function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array()) -{ - if ($privkey == null || $privkey == '') { - throw new Exception("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); - } - - if ($remoteip == null || $remoteip == '') { - throw new Exception ("For security reasons, you must pass the remote ip to reCAPTCHA"); - } - - - - //discard spam submissions - if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) { - $recaptcha_response = new ReCaptchaResponse(); - $recaptcha_response->is_valid = false; - $recaptcha_response->error = 'incorrect-captcha-sol'; - return $recaptcha_response; - } - - $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify", - array ( - 'privatekey' => $privkey, - 'remoteip' => $remoteip, - 'challenge' => $challenge, - 'response' => $response - ) + $extra_params - ); - - $answers = explode ("\n", $response [1]); - $recaptcha_response = new ReCaptchaResponse(); - - if (trim ($answers [0]) == 'true') { - $recaptcha_response->is_valid = true; - } - else { - $recaptcha_response->is_valid = false; - $recaptcha_response->error = $answers [1]; - } - return $recaptcha_response; - -} -} - -/** - * gets a URL where the user can sign up for reCAPTCHA. If your application - * has a configuration page where you enter a key, you should provide a link - * using this function. - * @param string $domain The domain where the page is hosted - * @param string $appname The name of your application - */ -if ( ! function_exists( 'recaptcha_get_signup_url' ) ) { -function recaptcha_get_signup_url ($domain = null, $appname = null) { - return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname)); -} -} - -if ( ! function_exists( '_recaptcha_aes_pad' ) ) { -function _recaptcha_aes_pad($val) { - $block_size = 16; - $numpad = $block_size - (strlen ($val) % $block_size); - return str_pad($val, strlen ($val) + $numpad, chr($numpad)); -} -} - -/* Mailhide related code */ -if ( ! function_exists( '_recaptcha_mailhide_urlbase64' ) ) { -function _recaptcha_mailhide_urlbase64 ($x) { - return strtr(base64_encode ($x), '+/', '-_'); -} -} - -/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */ -if ( ! function_exists( 'recaptcha_mailhide_url' ) ) { -function recaptcha_mailhide_url($pubkey, $privkey, $email) { - if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) { - throw new Exception("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " . - "you can do so at http://www.google.com/recaptcha/mailhide/apikey"); - } - - - $ky = pack('H*', $privkey); - - $cryptmail = function_exists( '_recaptcha_aes_encrypt' ) - ? _recaptcha_aes_encrypt ($email, $ky) - : $email; - - return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail); -} -} - -/** - * gets the parts of the email to expose to the user. - * eg, given johndoe@example,com return ["john", "example.com"]. - * the email is then displayed as john...@example.com - */ -if ( ! function_exists( '_recaptcha_mailhide_email_parts' ) ) { -function _recaptcha_mailhide_email_parts ($email) { - $arr = preg_split("/@/", $email ); - - if (strlen ($arr[0]) <= 4) { - $arr[0] = substr ($arr[0], 0, 1); - } else if (strlen ($arr[0]) <= 6) { - $arr[0] = substr ($arr[0], 0, 3); - } else { - $arr[0] = substr ($arr[0], 0, 4); - } - return $arr; -} -} - -/** - * Gets html to display an email address given a public an private key. - * to get a key, go to: - * - * http://www.google.com/recaptcha/mailhide/apikey - */ -if ( ! function_exists( 'recaptcha_mailhide_html' ) ) { -function recaptcha_mailhide_html($pubkey, $privkey, $email) { - $emailparts = _recaptcha_mailhide_email_parts ($email); - $url = recaptcha_mailhide_url ($pubkey, $privkey, $email); - - return htmlentities($emailparts[0]) . "...@" . htmlentities ($emailparts [1]); - -} -} - - -?> diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-v2/api.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-v2/api.js deleted file mode 100644 index 0cc7997..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/recaptcha-v2/api.js +++ /dev/null @@ -1 +0,0 @@ -/* PLEASE DO NOT COPY AND PASTE THIS CODE. */(function() {if (!window['___grecaptcha_cfg']) { window['___grecaptcha_cfg'] = {}; };if (!window['___grecaptcha_cfg']['render']) { window['___grecaptcha_cfg']['render'] = 'onload'; };window['__google_recaptcha_client'] = true;var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;po.src = 'https://www.gstatic.com/recaptcha/api2/r20160229165133/recaptcha__it.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);})(); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/repetitive.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/repetitive.js deleted file mode 100644 index 718e3df..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/repetitive.js +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Repetitive JS. - * - * - */ -var wptRep = (function ($) { - var count = {}; - function initRepetitiveFields() { - // Reorder label and description for repetitive - // Note that we target usual labels and descriptions but a classname can be used to keep some auxiliar items - $('.js-wpt-repetitive').each(function () { - var $this = $(this), - $parent; - if ($('body').hasClass('wp-admin')) { - var title = $('label:not(.js-wpt-auxiliar-label)', $this).first().clone(); - var description = $('.description:not(.js-wpt-auxiliar-description)', $this).first().clone(); - $('.js-wpt-field-item', $this).each(function () { - $('label:not(.js-wpt-auxiliar-label)', $this).remove(); - $('.description:not(.js-wpt-auxiliar-description)', $this).remove(); - }); - $this.prepend(description).prepend(title); - } - if ($this.hasClass('js-wpt-field-items')) {// This happens on the frontent - $parent = $this; - } else {// This happens on the backend - $parent = $this.find('.js-wpt-field-items'); - } - if ($(this).find('.js-wpt-repdelete').length > 1) { - $(this).find('.js-wpt-repdelete').show(); - } else if ($(this).find('.js-wpt-repdelete').length == 1) { - $(this).find('.js-wpt-repdelete').hide(); - } - _toggleCtl($parent); - }); - - } - function init() { - _.defer(function() { - initRepetitiveFields(); - }); - - // Add field - $(document).off('click', '.js-wpt-repadd', null); - $(document).on('click', '.js-wpt-repadd', function (e) { - e.preventDefault(); - var $this = $(this), - parent, - tpl; - $parent = $this.closest('.js-wpt-field-items'); - if (1 > $parent.length) { - return; - } - if ($('body').hasClass('wp-admin')) { - // Get template from the footer templates by wpt-id data attribute - tpl = $('
      ' + $('#tpl-wpt-field-' + $this.data('wpt-id')).html() + '
      '); - // Remove label and descriptions from the template - // Note that we target usual labels and descriptions but a classname can be used to keep some auxiliar items - $('label:not(.js-wpt-auxiliar-label)', tpl).first().remove(); - $('.description:not(.js-wpt-auxiliar-description)', tpl).first().remove(); - // Adjust ids and labels where needed for the template content - $('[id]', tpl).each(function () { - var $this = $(this), uniqueId = _.uniqueId('wpt-form-el'); - tpl.find('label[for="' + $this.attr('id') + '"]').attr('for', uniqueId); - $this.attr('id', uniqueId); - }); - // Calculate _count to build the name atribute - var _count = tpl.html().match(/\[%%(\d+)%%\]/); - if (_count != null) { - _count = _countIt(_count[1], $this.data('wpt-id')); - } else { - _count = ''; - } - // Adjust the _count to avoid duplicates when some intermediary has been deleted - while ($('[name*="[' + _count + ']"]', $parent).length > 0) { - _count++; - } - // Insert the template before the button - $this.before(tpl.html().replace(/\[%%(\d+)%%\]/g, '[' + _count + ']')); - } else { - /** - * template - */ - tpl = $('
      ' + $('#tpl-wpt-field-' + $this.data('wpt-id')).html() + '
      '); - - $('[id]', tpl).each(function () { - var $this = $(this), uniqueId = _.uniqueId('wpt-form-el'); - $this.attr('id', uniqueId); - }); - // Calculate _count to build the name atribute - var _count = tpl.html().match(/\[%%(\d+)%%\]/); - if (_count != null) { - _count = _countIt(_count[1], $this.data('wpt-id')); - } else { - _count = ''; - } - // Adjust the _count to avoid duplicates when some intermediary has been deleted - while ($('[name*="[' + _count + ']"]', $parent).length > 0) { - _count++; - } - // Insert the template before the button - $this.before(tpl.html().replace(/\[%%(\d+)%%\]/g, '[' + _count + ']')); - - } - wptCallbacks.addRepetitive.fire($parent); - _toggleCtl($parent); - $this.trigger('blur');// To prevent it from staying on the active state - - /* - * Fires after the creation of a new repetitive field holding the parent div for the field - * @since 2.5.0 - */ - jQuery(document).trigger('toolset_repetitive_field_added', $parent); - - return false; - }); - // Delete field - $(document).off('click', '.js-wpt-repdelete', null); - $(document).on('click', '.js-wpt-repdelete', function (e) { - //$('.js-wpt-field-items').on('click', '.js-wpt-repdelete', function (e) { - e.preventDefault(); - $parent = $(this).closest('.js-wpt-field-items'); - if ($('body').hasClass('wp-admin')) { - var $this = $(this), value; - // Allow deleting if more than one field item - if ($('.js-wpt-field-item', $parent).length > 1) { - var formID = $this.parents('form').attr('id'); - $this.parents('.js-wpt-field-item').remove(); - wptCallbacks.removeRepetitive.fire(formID); - } - /** - * if image, try delete images - * TODO check this, I do not like using parent() for this kind of things - */ - if ('image' == $this.data('wpt-type')) { - value = $this.parent().parent().find('input').val(); - $parent.parent().append( - '' - ); - } - } else { - if ($('.wpt-repctl', $parent).length > 1) { - $(this).closest('.wpt-repctl').remove(); - wptCallbacks.removeRepetitive.fire(formID); - } - } - _toggleCtl($parent); - return false; - }); - } - function _toggleCtl($sortable) { - var sorting_count; - if ($('body').hasClass('wp-admin')) { - sorting_count = $('.js-wpt-field-item', $sortable).length; - } else { - sorting_count = $('.wpt-repctl', $sortable).length; - } - if (sorting_count > 1) { - $('.js-wpt-repdelete', $sortable).prop('disabled', false).show(); - $('.js-wpt-repdrag', $sortable).css({opacity: 1, cursor: 'move'}).show(); - if (!$sortable.hasClass('ui-sortable')) { - $sortable.sortable({ - handle: '.js-wpt-repdrag', - axis: 'y', - stop: function (event, ui) { - $sortable.find('.js-wpt-repadd').detach().appendTo($sortable); - } - }); - } - } else { - $('.js-wpt-repdelete', $sortable).prop('disabled', true).hide(); - $('.js-wpt-repdrag', $sortable).css({opacity: 0.5, cursor: 'default'}).hide(); - if ($sortable.hasClass('ui-sortable')) { - $sortable.sortable('destroy'); - } - } - } - function _countIt(_count, id) { - if (typeof count[id] == 'undefined') { - count[id] = _count; - return _count; - } - return ++count[id]; - } - return { - init: init - }; -})(jQuery); - -jQuery(document).ready(wptRep.init); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/skype.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/skype.js deleted file mode 100644 index 82ecc0c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/skype.js +++ /dev/null @@ -1,158 +0,0 @@ - -var wptSkype = (function($) { - var $parent, $skypename, $preview, $fields; - var $popup = $('#tpl-wpt-skype-edit-button > div'); - function init() { - $('body').on('click', '.js-wpt-skype-edit-button', function() { - $parent = $(this).parents('.js-wpt-field-item'); - $skypename = $('.js-wpt-skypename', $parent); - $preview = $('.js-wpt-skype-preview', $parent); - $('.js-wpt-skypename-popup', $popup).val($skypename.val()); - tb_show(wptSkypeData.title, "#TB_inline?inlineId=tpl-wpt-skype-edit-button&height=500&width=600", ""); - $('.js-wpt-skype', $popup).on("change", function(){ - wptSkype.preview($popup, this); - }); - $('.js-wpt-skype', $popup).on("keyup", function(){ - wptSkype.preview($popup, this); - }); - wptSkype.preview($popup, this, 'init'); - }); - $('#wpt-skype-edit-button-popup').on('click', '.js-wpt-close-thickbox', function() { - var button = $('.js-wpt-skype-edit-button', $parent); - var $extra_skype_data = {}; - $skypename.val($('.js-wpt-skypename-popup', $popup).val()); - $('.js-wpt-skype', $popup).each(function() { - var $field_name = $(this).data('skype-field-name'); - var $val = $(this).val(); - if ( $field_name ) { - switch($(this).data('wpt-type')) { - case 'checkbox': - if ( $(this).is(':checked') ) { - $('.js-wpt-skype-'+$field_name, $parent).val($val); - button.data($field_name, $val); - } - break; - case 'option': - if ( $(this).is(':selected') ) { - $('.js-wpt-skype-'+$field_name, $parent).val($val); - button.data($field_name, $val); - } - break; - case 'textfield': - $('.js-wpt-skype-'+$field_name, $parent).val($val); - button.data($field_name, $val); - break; - } - } - }); - /** - * fix data for action - */ - if ( 1 < $('.js-wpt-skype-action:checked', $popup).length ) { - $('.js-wpt-skype-action', $popup).val('dropdown');; - $(this).data('action', 'dropdown'); - } - tb_remove(); - }); - } - function preview($popup, object, mode) { - var $object = $(object); - /** - * be sure, that at lest one action is on - */ - if ( 'checkbox' == $object.attr('type') ) { - if ( 0 == $('.js-wpt-skype-action:checked', $popup).length ) { - $('.js-wpt-skype-action', $popup).each(function() { - if ( this != object ) { - $(this).attr('checked', 'checked'); - } - }); - } - } - - /** - * participants - */ - var $button = $('#wpt-skype-edit-button-popup-preview-button'); - $('#wpt-skype-preview', $button).html(''); - var $skypeNamePopup = $('.js-wpt-skypename-popup', $popup); - var participants = $skypeNamePopup.length - ? $skypeNamePopup.val() - : ''; - - /** - * setup values - */ - if ( 'undefined' != typeof mode && 'init' == mode ) { - if ( value = $object.data('size') ) { - $('.js-wpt-skype-size option', $popup).removeAttr('selected'); - $('.js-wpt-skype-size [value='+value+']', $popup).attr('selected', 'selected'); - } - if ( value = $object.data('color') ) { - $('.js-wpt-skype-color option', $popup).removeAttr('selected'); - $('.js-wpt-skype-color [value='+value+']', $popup).attr('selected', 'selected'); - } - if ( value = $object.data('action') ) { - switch(value) { - case 'dropdown': - $('.js-wpt-skype-action', $popup).attr('checked', 'checked'); - break; - case 'chat': - case 'call': - $('.js-wpt-skype-action', $popup).removeAttr('checked'); - $('.js-wpt-skype-action-'+value, $popup).attr('checked', 'checked'); - break; - default: - $('.js-wpt-skype-action', $popup).removeAttr('checked'); - $('.js-wpt-skype-action-call', $popup).attr('checked', 'checked'); - break; - } - } - } - /** - * skypename - */ - var skypename = "dropdown"; - if ($('.js-wpt-skype-action:checked', $popup).length < 2 ) { - skypename = $('.js-wpt-skype-action:checked', $popup).val(); - } - /** - * Skype.ui - */ - if ( participants.length > 2 ) { - if ( 'object' == typeof Skype) { - data = { - name: skypename, - element: "wpt-skype-preview", - participants: [participants], - imageSize: parseInt($('.js-wpt-skype-size option:selected', $popup).val()), - imageColor: $('.js-wpt-skype-color option:selected', $popup).val() - } - /** - * show tooltip - */ - if ( 'dropdown' == data.name ) { - $('small', $button).show(); - } else { - $('small', $button).hide(); - } - /** - * change parent background to see skype in white - */ - if ( 'white' == data.imageColor) { - $button.addClass('dark-background'); - - } else { - $button.removeClass('dark-background'); - } - Skype.ui(data); - } - } - } - return { - init: init, - preview: preview - }; -})(jQuery); - -jQuery(document).ready(wptSkype.init); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/taxonomy.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/taxonomy.js deleted file mode 100644 index 5599997..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/taxonomy.js +++ /dev/null @@ -1,8 +0,0 @@ -jQuery(document).ready(function () { - var wptoolset_taxonomy_settings_instances = wptoolset_taxonomy_settings['instances']; - for(var taxonomy_settings_instance_index in wptoolset_taxonomy_settings_instances){ - var currentTaxonomySettings = wptoolset_taxonomy_settings_instances[taxonomy_settings_instance_index]; - initTaxonomies(currentTaxonomySettings.values, currentTaxonomySettings.name, currentTaxonomySettings.form, currentTaxonomySettings.field); - } - jQuery('head').append(''); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/validation.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/validation.js deleted file mode 100644 index caf1505..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/js/validation.js +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Validation JS - * - * - Initializes validation on selector (forms) - * - Adds/removes rules on elements contained in var wptoolsetValidationData - * - Checks if elements are hidden by conditionals - * - * @see class WPToolset_Validation - * - * - */ -var wptValidationForms = []; -var wptValidationDebug = false; -//Contains IDs for CRED form that were already initialised, to prevent multiple initialisation -var initialisedCREDForms = []; - -var wptValidation = (function ($) { - function init() { - /** - * add extension to validator method - */ - $.validator.addMethod("extension", function (value, element, param) { - param = typeof param === "string" ? param.replace(/,/g, "|") : param; - if ($(element).attr('res') && $(element).attr('res') != "") { - return true; - } - return ( this.optional(element) || value.match( new RegExp(".(" + param + ")$", "i") ) ); - }); - - /** - * add hexadecimal to validator method - */ - $.validator.addMethod("hexadecimal", function (value, element, param) { - return ( value == "" || /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(value) ); - }); - - /** - * add equalto method - */ - $.validator.addMethod("equalto", function (value, element, param) { - if (param[1]) { - return ( value == $("input[name='" + param[1] + "']").val() ); - } - return false; - }); - - /** - * add skype to validator method - */ - $.validator.addMethod("skype", function (value, element, param) { - return ( value == "" || /^([a-z0-9\.\_\,\-\#]+)$/i.test(value) ); - }); - - /** - * add extension to validator method require - */ - $.validator.addMethod("required", function (value, element, param) { - var _name = $(element).attr('name'); - var _value = $(element).val(); - - // check if dependency is met - // Last commits includes "required" parameter so this condition is not necessary. - /* - if (!this.depend(param, element)) { - return "dependency-mismatch"; - } - */ - switch (element.nodeName.toLowerCase()) { - case 'select': - return _value && $.trim(_value).length > 0; - case 'input': - if (jQuery(element).hasClass("wpt-form-radio")) { - var val = jQuery('input[name="' + _name + '"]:checked').val(); - - if (wptValidationDebug) { - console.log("radio " + (typeof val != 'undefined' && val && $.trim(val).length > 0)); - } - - return ( typeof val != 'undefined' && val && $.trim(val).length > 0 ); - } - - var $element = jQuery(element).siblings('input[type="hidden"]').first(); - var elementFieldType = $element.attr('data-wpt-type'); - if ($element - && !$element.prop("disabled") - && ( elementFieldType == 'file' - || elementFieldType == 'video' - || elementFieldType == 'image' ) - ) { - var val = $element.val(); - if (wptValidationDebug) { - console.log("hidden " + (val && $.trim(val).length > 0)); - } - - return ( val && $.trim(val).length > 0 ); - } - - if (jQuery(element).attr('type') == "checkbox") { - if (wptValidationDebug) { - console.log("checkbox " + (element.checked)); - } - return element.checked; - } - - if (jQuery(element).hasClass("hasDatepicker")) { - if (wptValidationDebug) { - console.log("hasDatepicker"); - } - return false; - } - - if (this.checkable(element)) { - if (wptValidationDebug) { - console.log("checkable " + (this.getLength(value, element) > 0)); - } - return ( this.getLength(value, element) > 0 ); - } - - if (wptValidationDebug) { - console.log(_name + " default: " + value + " val: " + _value + " " + ($.trim(_value).length > 0)); - } - - return ( $.trim(_value).length > 0 ); - default: - return ( $.trim(value).length > 0 ); - } - }); - - /** - * Add validation method for datepicker adodb_xxx format for date fields - */ - $.validator.addMethod( - "dateADODB_STAMP", - function (a, b) { - return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a) && -12219292800 < a && a < 32535215940 - }, - "Please enter a valid date" - ); - - if (wptValidationDebug) { - console.log("INIT"); - console.log(wptValidationForms); - } - - _.each(wptValidationForms, function (formID) { - //Only apply to non CRED elements, CRED ones will be init on cred_form_ready - if(formID.indexOf('#cred') == -1){ - _initValidation(formID); - applyRules(formID); - } - }); - } - - function _initValidation(formID) { - if (wptValidationDebug) { - console.log("_initValidation " + formID); - } - var $form = $(formID); - $form.validate({ - // :hidden is kept because it's default value. - // All accepted by jQuery.not() can be added. - ignore: 'input[type="hidden"]:not(.js-wpt-date-auxiliar),:not(.js-wpt-validate)', - errorPlacement: function (error, element) { - error.insertBefore(element); - }, - highlight: function (element, errorClass, validClass) { - // Expand container - $(element).parents('.collapsible').slideDown(); - if (formID == '#post') { - var box = $(element).parents('.postbox'); - if (box.hasClass('closed')) { - $('.handlediv', box).trigger('click'); - } - } - $(element).parent('div').addClass('has-error'); - // $.validator.defaults.highlight(element, errorClass, validClass); // Do not add class to element - }, - unhighlight: function (element, errorClass, validClass) { - $("input#publish, input#save-post").removeClass("button-primary-disabled").removeClass("button-disabled"); - $(element).parent('div').removeClass('has-error'); - // $.validator.defaults.unhighlight(element, errorClass, validClass); - }, - invalidHandler: function (form, validator) { - if (formID == '#post') { - $('#publishing-action .spinner').css('visibility', 'hidden'); - $('#publish').bind('click', function () { - $('#publishing-action .spinner').css('visibility', 'visible'); - }); - $("input#publish").addClass("button-primary-disabled"); - $("input#save-post").addClass("button-disabled"); - $("#save-action .ajax-loading").css("visibility", "hidden"); - $("#publishing-action #ajax-loading").css("visibility", "hidden"); - } - }, - errorElement: 'small', - errorClass: 'wpt-form-error' - }); - - // On some pages the form may not be ready yet at this point (e.g. Edit Term page). - jQuery(document).ready(function () { - if (wptValidationDebug) { - console.log($form.selector); - } - - jQuery(document).off('submit', $form.selector, null); - jQuery(document).on('submit', $form.selector, function () { - if (wptValidationDebug) { - console.log("submit " + $form.selector); - } - - var currentFormId = formID.replace('#', ''); - currentFormId = currentFormId.replace('-', '_'); - if ( ! _.has( window, 'cred_settings_' + currentFormId ) ) { - return; - } - var cred_settings = window[ 'cred_settings_' + currentFormId ]; - - if (wptValidationDebug) { - console.log("validation..."); - } - - var isAjaxForm = (cred_settings.use_ajax && 1 == cred_settings.use_ajax); - var isValidForm = $form.valid(); - - if (isValidForm) { - - if (wptValidationDebug) { - console.log("form validated " + $form); - } - - $('.js-wpt-remove-on-submit', $(this)).remove(); - - /** - * toolset-form-onsubmit-validate-success - * - * Event triggered when a cred form on submit is validated - * - * @since 2.5.1 - */ - Toolset.hooks.doAction('toolset-form-onsubmit-validation-success', formID, isAjaxForm, cred_settings); - - } else { - - if (wptValidationDebug) { - console.log("form not valid!"); - } - - /** - * toolset-form-onsubmit-validate-error - * - * Event triggered when a cred form on submit is NOT validated - * - * @since 2.5.1 - */ - Toolset.hooks.doAction('toolset-form-onsubmit-validation-error', formID, isAjaxForm, cred_settings); - } - - //If form is an ajax form return false on submit - if (isAjaxForm) { - - /** - * toolset-ajax-submit - * - * Event submit of ajax form, it is triggered ONLY when onsubmit belogns to a form that is ajax and it is valid as well - * - * @since 2.5.1 - */ - Toolset.hooks.doAction('toolset-ajax-submit', formID, isValidForm, cred_settings); - return false; - } - }); - }); - } - - // @bug This event callback is defined in a limbo never executed, hence the callback will never be fired - // @bug The event lists used here should be space-separated, otherwise it will get fired at an event with a name - // "js_event_wpv_pagination_completed," (mind the last comma), which obviously does not exist - $(document).on('js_event_wpv_pagination_completed, js_event_wpv_parametric_search_results_updated', function (event, data) { - if (typeof wptValidation !== 'undefined') { - wptValidation.init(); - } - if (typeof wptCond !== 'undefined') { - wptCond.init(); - } - if (typeof wptRep !== 'undefined') { - wptRep.init(); - } - if (typeof wptCredfile !== 'undefined') { - wptCredfile.init('body'); - } - if (typeof toolsetForms !== 'undefined') { - toolsetForms.cred_tax = new toolsetForms.CRED_taxonomy(); - if (typeof initCurrentTaxonomy == 'function') { - initCurrentTaxonomy(); - } - } - - if (typeof wptDate !== 'undefined') { - wptDate.init('body'); - } - - if (typeof jQuery('.wpt-suggest-taxonomy-term') && jQuery('.wpt-suggest-taxonomy-term').length) { - jQuery('.wpt-suggest-taxonomy-term').hide(); - } - - if (typeof credFrontEndViewModel !== 'undefined') { - credFrontEndViewModel.reloadTinyMCE(); - } - }); - - function isIgnored($el) { - var ignore = $el.parents('.js-wpt-field').hasClass('js-wpt-validation-ignore') || // Individual fields - $el.parents('.js-wpt-remove-on-submit').hasClass('js-wpt-validation-ignore'); // Types group of fields - return ignore; - } - - function applyRules(container) { - $('[data-wpt-validate]', $(container)).each(function () { - _applyRules($(this).data('wpt-validate'), this, container); - }); - } - - function _applyRules(rules, selector, container) { - var element = $(selector, $(container)); - - if (element.length > 0) { - if (isIgnored(element)) { - element.rules('remove'); - element.removeClass('js-wpt-validate'); - } else if (!element.hasClass('js-wpt-validate')) { - _.each(rules, function (value, rule) { - var _rule = {messages: {}}; - _rule[rule] = value.args; - if (value.message !== 'undefined') { - _rule.messages[rule] = value.message; - } - element.rules('add', _rule); - element.addClass('js-wpt-validate'); - }); - } - } - } - - return { - init: init, - applyRules: applyRules, - isIgnored: isIgnored, - _initValidation: _initValidation - }; - -})(jQuery); - -jQuery(document).on('toolset_ajax_fields_loaded', function (evt, data) { - wptValidation._initValidation('#' + data.form_id); - wptValidation.applyRules('#' + data.form_id); -}); - -//cred_form_ready will fire when a CRED form is ready, so we init it's validation rules then -jQuery(document).on('cred_form_ready', function (evt, data) { - if (initialisedCREDForms.indexOf(data.form_id) == -1) { - wptValidation._initValidation('#' + data.form_id); - wptValidation.applyRules('#' + data.form_id); - initialisedCREDForms.push(data.form_id); - } -}); - -jQuery(document).ready(function () { - - //init ready CRED forms - if( typeof( credFrontEndViewModel ) != 'undefined' ) { - for(var credFormIDIndex in credFrontEndViewModel.readyCREDForms){ - var credFormID = credFrontEndViewModel.readyCREDForms[credFormIDIndex]; - if(initialisedCREDForms.indexOf(credFormID) == -1) { - wptValidation._initValidation('#' + credFormID); - wptValidation.applyRules('#' + credFormID); - initialisedCREDForms.push(credFormID); - } - } - } - - wptCallbacks.reset.add(function () { - wptValidation.init(); - }); - wptCallbacks.addRepetitive.add(function (container) { - wptValidation.applyRules(container); - }); - wptCallbacks.removeRepetitive.add(function (container) { - wptValidation.applyRules(container); - }); - wptCallbacks.conditionalCheck.add(function (container) { - wptValidation.applyRules(container); - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/CakePHP-Validation.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/CakePHP-Validation.php deleted file mode 100644 index 8ed32f8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/CakePHP-Validation.php +++ /dev/null @@ -1,1242 +0,0 @@ - '(?:[_\p{L}0-9][-_\p{L}0-9]*\.)*(?:[\p{L}0-9][-\p{L}0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,})', - 'hostname_without_tld' => '(?:[_\p{L}0-9][-_\p{L}0-9]*\.)*(?:[\p{L}0-9][-\p{L}0-9]{0,62})(?:\.(?:(?:[a-z]{2}\.)?[a-z]{2,}))?' - ); - - /** - * Some class methods use a country to determine proper validation. - * This can be passed to methods in the $country param - * - * @var string - * @access public - */ - var $country = null; - - /** - * Some class methods use a deeper validation when set to true - * - * @var string - * @access public - */ - var $deep = null; - - /** - * Some class methods use the $type param to determine which validation to perfom in the method - * - * @var string - * @access public - */ - var $type = null; - - /** - * Holds an array of errors messages set in this class. - * These are used for debugging purposes - * - * @var array - * @access public - */ - var $errors = array(); - - /** - * Gets a reference to the Validation object instance - * - * @return WPToolset_Cake_Validation Validation instance - */ - function &getInstance() { - static $instance = array(); - - if (!$instance) { - $instance[0] = new WPToolset_Cake_Validation(); - } - return $instance[0]; - } - - /** - * Checks that a string contains something other than whitespace - * - * Returns true if string contains something other than whitespace - * - * $check can be passed as an array: - * array('check' => 'valueToCheck'); - * - * @param mixed $check Value to check - * @return boolean Success - * @access public - */ - function notEmpty($check) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - - if (is_array($check)) { - $_this->_extract($check); - } - - if (empty($_this->check) && $_this->check != '0') { - return false; - } - $_this->regex = '/[^\s]+/m'; - return $_this->_check(); - } - - /** - * Checks if a value is valid hexadecimal. - * - * @param string $check Value to check - * @return boolean Succcess - * @access public - */ - function hexadecimal($check) { - return preg_match('/^#[a-f0-9]{6}$/i', $check); - } - - /** - * Checks that a string contains only integer or letters - * - * Returns true if string contains only integer or letters - * - * $check can be passed as an array: - * array('check' => 'valueToCheck'); - * - * @param mixed $check Value to check - * @return boolean Success - * @access public - */ - function alphaNumeric($check) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - - if (is_array($check)) { - $_this->_extract($check); - } - - if (empty($_this->check) && $_this->check != '0') { - return false; - } - $_this->regex = '/^[a-zA-Z0-9]*$/mu'; - $return = $_this->_check(); - - if (!$return) { - $_this->regex = '/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]+$/mu'; - $return = $_this->_check(); - } - - return $_this->_check(); - } - - function alphaNumericWhitespaces($check) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - - if (is_array($check)) { - $_this->_extract($check); - } - - if (empty($_this->check) && $_this->check != '0') { - return false; - } - $_this->regex = '/^[a-zA-Z0-9\s\-\_]*$/mu'; - $return = $_this->_check(); - - if (!$return) { - $_this->regex = '/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}\s\-\_]+$/mu'; - $return = $_this->_check(); - } - - return $return; - } - - /** - * Checks that a string length is within s specified range. - * Spaces are included in the character count. - * Returns true is string matches value min, max, or between min and max, - * - * @param string $check Value to check for length - * @param integer $min Minimum value in range (inclusive) - * @param integer $max Maximum value in range (inclusive) - * @return boolean Success - * @access public - */ - function between($check, $min, $max) { - $length = strlen($check); - return ($length >= $min && $length <= $max); - } - - /** - * Returns true if field is left blank -OR- only whitespace characters are present in it's value - * Whitespace characters include Space, Tab, Carriage Return, Newline - * - * $check can be passed as an array: - * array('check' => 'valueToCheck'); - * - * @param mixed $check Value to check - * @return boolean Success - * @access public - */ - function blank($check) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - - if (is_array($check)) { - $_this->_extract($check); - } - - $_this->regex = '/[^\\s]/'; - return !$_this->_check(); - } - - /** - * Validation of credit card numbers. - * Returns true if $check is in the proper credit card format. - * - * @param mixed $check credit card number to validate - * @param mixed $type 'all' may be passed as a sting, defaults to fast which checks format of most major credit cards - * if an array is used only the values of the array are checked. - * Example: array('amex', 'bankcard', 'maestro') - * @param boolean $deep set to true this will check the Luhn algorithm of the credit card. - * @param string $regex A custom regex can also be passed, this will be used instead of the defined regex values - * @return boolean Success - * @access public - * @see WPToolset_Cake_Validation::_luhn() - */ - function cc($check, $type = 'fast', $deep = false, $regex = null) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - $_this->type = $type; - $_this->deep = $deep; - $_this->regex = $regex; - - if (is_array($check)) { - $_this->_extract($check); - } - $_this->check = str_replace(array('-', ' '), '', $_this->check); - - if (strlen($_this->check) < 13) { - return false; - } - - if (!is_null($_this->regex)) { - if ($_this->_check()) { - return $_this->_luhn(); - } - } - $cards = array( - 'all' => array( - 'amex' => '/^3[4|7]\\d{13}$/', - 'bankcard' => '/^56(10\\d\\d|022[1-5])\\d{10}$/', - 'diners' => '/^(?:3(0[0-5]|[68]\\d)\\d{11})|(?:5[1-5]\\d{14})$/', - 'disc' => '/^(?:6011|650\\d)\\d{12}$/', - 'electron' => '/^(?:417500|4917\\d{2}|4913\\d{2})\\d{10}$/', - 'enroute' => '/^2(?:014|149)\\d{11}$/', - 'jcb' => '/^(3\\d{4}|2100|1800)\\d{11}$/', - 'maestro' => '/^(?:5020|6\\d{3})\\d{12}$/', - 'mc' => '/^5[1-5]\\d{14}$/', - 'solo' => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/', - 'switch' => '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/', - 'visa' => '/^4\\d{12}(\\d{3})?$/', - 'voyager' => '/^8699[0-9]{11}$/' - ), - 'fast' => '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/' - ); - - if (is_array($_this->type)) { - foreach ($_this->type as $value) { - $_this->regex = $cards['all'][strtolower($value)]; - - if ($_this->_check()) { - return $_this->_luhn(); - } - } - } elseif ($_this->type == 'all') { - foreach ($cards['all'] as $value) { - $_this->regex = $value; - - if ($_this->_check()) { - return $_this->_luhn(); - } - } - } else { - $_this->regex = $cards['fast']; - - if ($_this->_check()) { - return $_this->_luhn(); - } - } - } - - /** - * Used to compare 2 numeric values. - * - * @param mixed $check1 if string is passed for a string must also be passed for $check2 - * used as an array it must be passed as array('check1' => value, 'operator' => 'value', 'check2' -> value) - * @param string $operator Can be either a word or operand - * is greater >, is less <, greater or equal >= - * less or equal <=, is less <, equal to ==, not equal != - * @param integer $check2 only needed if $check1 is a string - * @return boolean Success - * @access public - */ - function comparison($check1, $operator = null, $check2 = null) { - if (is_array($check1)) { - extract($check1, EXTR_OVERWRITE); - } - $operator = str_replace(array(' ', "\t", "\n", "\r", "\0", "\x0B"), '', strtolower($operator)); - - switch ($operator) { - case 'isgreater': - case '>': - if ($check1 > $check2) { - return true; - } - break; - case 'isless': - case '<': - if ($check1 < $check2) { - return true; - } - break; - case 'greaterorequal': - case '>=': - if ($check1 >= $check2) { - return true; - } - break; - case 'lessorequal': - case '<=': - if ($check1 <= $check2) { - return true; - } - break; - case 'equalto': - case '==': - if ($check1 == $check2) { - return true; - } - break; - case 'notequal': - case '!=': - if ($check1 != $check2) { - return true; - } - break; - default: - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->errors[] = __('You must define the $operator parameter for WPToolset_Cake_Validation::comparison()', 'wpcf'); - break; - } - return false; - } - - /** - * Used when a custom regular expression is needed. - * - * @param mixed $check When used as a string, $regex must also be a valid regular expression. - * As and array: array('check' => value, 'regex' => 'valid regular expression') - * @param string $regex If $check is passed as a string, $regex must also be set to valid regular expression - * @return boolean Success - * @access public - */ - function custom($check, $regex = null) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - $_this->regex = $regex; - if (is_array($check)) { - $_this->_extract($check); - } - if ($_this->regex === null) { - $_this->errors[] = __('You must define a regular expression for WPToolset_Cake_Validation::custom()', 'wpcf'); - return false; - } - return $_this->_check(); - } - - /** - * Date validation, determines if the string passed is a valid date. - * keys that expect full month, day and year will validate leap years - * - * @param string $check a valid date string - * @param mixed $format Use a string or an array of the keys below. Arrays should be passed as array('dmy', 'mdy', etc) - * Keys: dmy 27-12-2006 or 27-12-06 separators can be a space, period, dash, forward slash - * mdy 12-27-2006 or 12-27-06 separators can be a space, period, dash, forward slash - * ymd 2006-12-27 or 06-12-27 separators can be a space, period, dash, forward slash - * dMy 27 December 2006 or 27 Dec 2006 - * Mdy December 27, 2006 or Dec 27, 2006 comma is optional - * My December 2006 or Dec 2006 - * my 12/2006 separators can be a space, period, dash, forward slash - * @param string $regex If a custom regular expression is used this is the only validation that will occur. - * @return boolean Success - * @access public - */ - function date($check, $format = 'ymd', $regex = null) { - - if (is_numeric($check)) { - return WPToolset_Field_Date_Scripts::_isTimestampInRange($check); - } - // TODO Change to use date strtotime - $valid = wptoolset_strtotime($check); - return $valid !== false; - - $cake_date_formats = array('F j, Y' => 'Mdy', - 'Y/m/d' => 'ymd', - 'm/d/Y' => 'mdy', - 'd/m/Y' => 'dmy' - ); - $format = isset($cake_date_formats[$format]) ? $cake_date_formats[$format] : $format; - - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - $_this->regex = $regex; - - if (!is_null($_this->regex)) { - return $_this->_check(); - } - - $regex['dmy'] = '%^(?:(?:31(\\/|-|\\.|\\x20)(?:0?[13578]|1[02]))\\1|(?:(?:29|30)(\\/|-|\\.|\\x20)(?:0?[1,3-9]|1[0-2])\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:29(\\/|-|\\.|\\x20)0?2\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\\d|2[0-8])(\\/|-|\\.|\\x20)(?:(?:0?[1-9])|(?:1[0-2]))\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%'; - $regex['mdy'] = '%^(?:(?:(?:0?[13578]|1[02])(\\/|-|\\.|\\x20)31)\\1|(?:(?:0?[13-9]|1[0-2])(\\/|-|\\.|\\x20)(?:29|30)\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:0?2(\\/|-|\\.|\\x20)29\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\\/|-|\\.|\\x20)(?:0?[1-9]|1\\d|2[0-8])\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%'; - $regex['ymd'] = '%^(?:(?:(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(\\/|-|\\.|\\x20)(?:0?2\\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\\d)?\\d{2})(\\/|-|\\.|\\x20)(?:(?:(?:0?[13578]|1[02])\\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\\2(?:0?[1-9]|1\\d|2[0-8]))))$%'; - $regex['dMy'] = '/^((31(?!\\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\\b|t)t?|Nov)(ember)?)))|((30|29)(?!\\ Feb(ruary)?))|(29(?=\\ Feb(ruary)?\\ (((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\\d|2[0-8])\\ (Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)\\ ((1[6-9]|[2-9]\\d)\\d{2})$/'; - $regex['Mdy'] = '/^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?|Dec(ember)?)\\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sept|Nov|Dec)(ember)?)\\ (0?[1-9]|([12]\\d)|30))|(Feb(ruary)?\\ (0?[1-9]|1\\d|2[0-8]|(29(?=,?\\ ((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))))\\,?\\ ((1[6-9]|[2-9]\\d)\\d{2}))$/'; - $regex['My'] = '%^(Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)[ /]((1[6-9]|[2-9]\\d)\\d{2})$%'; - $regex['my'] = '%^(((0[123456789]|10|11|12)([- /.])(([1][9][0-9][0-9])|([2][0-9][0-9][0-9]))))$%'; - - $format = (is_array($format)) ? array_values($format) : array($format); - foreach ($format as $key) { - $_this->regex = $regex[$key]; - - if ($_this->_check() === true) { - return true; - } - } - return false; - } - - /** - * Time validation, determines if the string passed is a valid time. - * Validates time as 24hr (HH:MM) or am/pm ([H]H:MM[a|p]m) - * Does not allow/validate seconds. - * - * @param string $check a valid time string - * @return boolean Success - * @access public - */ - function time($check) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - $_this->regex = '%^((0?[1-9]|1[012])(:[0-5]\d){0,2}([AP]M|[ap]m))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$%'; - return $_this->_check(); - } - - /** - * Boolean validation, determines if value passed is a boolean integer or true/false. - * - * @param string $check a valid boolean - * @return boolean Success - * @access public - */ - function boolean($check) { - $booleanList = array(0, 1, '0', '1', true, false); - return in_array($check, $booleanList, true); - } - - /** - * Checks that a value is a valid decimal. If $places is null, the $check is allowed to be a scientific float - * If no decimal point is found a false will be returned. Both the sign and exponent are optional. - * - * @param integer $check The value the test for decimal - * @param integer $places if set $check value must have exactly $places after the decimal point - * @param string $regex If a custom regular expression is used this is the only validation that will occur. - * @return boolean Success - * @access public - */ - function decimal($check, $places = null, $regex = null) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->regex = $regex; - $_this->check = $check; - - if (is_null($_this->regex)) { - if (is_null($places)) { - $_this->regex = '/^[-+]?[0-9]*\\.{1}[0-9]+(?:[eE][-+]?[0-9]+)?$/'; - } else { - $_this->regex = '/^[-+]?[0-9]*\\.{1}[0-9]{' . $places . '}$/'; - } - } - return $_this->_check(); - } - - /** - * Validates for an email address. - * - * @param string $check Value to check - * @param boolean $deep Perform a deeper validation (if true), by also checking availability of host - * @param string $regex Regex to use (if none it will use built in regex) - * @return boolean Success - * @access public - */ - function email($check, $deep = false, $regex = null) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->reset(); - $_this->check = $check; - $_this->regex = $regex; - $_this->deep = $deep; - - if (is_array($check)) { - $_this->_extract($check); - } - - if (is_null($_this->regex)) { - $_this->regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . $_this->__pattern['hostname'] . '$/i'; - } - $return = $_this->_check(); - - if ($_this->deep === false || $_this->deep === null) { - return $return; - } - - if ($return === true && preg_match('/@(' . $_this->__pattern['hostname'] . ')$/i', $_this->check, $regs)) { - if (function_exists('getmxrr') && getmxrr($regs[1], $mxhosts)) { - return true; - } - if (function_exists('checkdnsrr') && checkdnsrr($regs[1], 'MX')) { - return true; - } - return is_array(gethostbynamel($regs[1])); - } - return false; - } - - /** - * Check that value is exactly $comparedTo. - * - * @param mixed $check Value to check - * @param mixed $comparedTo Value to compare - * @return boolean Success - * @access public - */ - function equalTo($check, $comparedTo) { - return ($check === $comparedTo); - } - - /** - * Check that value has a valid file extension. - * - * @param mixed $check Value to check - * @param array $extensions file extenstions to allow - * @return boolean Success - * @access public - */ - function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { - //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/188215131/comments - if (!isset($check) || empty($check)) - return false; - //########################################################################################## - if (is_array($check)) { - return WPToolset_Cake_Validation::extension(array_shift($check), $extensions); - } - if (!is_array($extensions)) { - $extensions = explode('|', $extensions); - } - $check = strtolower($check); - $extension = pathinfo($check, PATHINFO_EXTENSION); - foreach ($extensions as $value) { - if ($extension == strtolower($value)) { - return true; - } - } - return false; - } - - /** - * Validation of an IP address. - * - * Valid IP version strings for type restriction are: - * - both: Check both IPv4 and IPv6, return true if the supplied address matches either version - * - IPv4: Version 4 (Eg: 127.0.0.1, 192.168.10.123, 203.211.24.8) - * - IPv6: Version 6 (Eg: ::1, 2001:0db8::1428:57ab) - * - * @param string $check The string to test. - * @param string $type The IP Version to test against - * @return boolean Success - * @access public - */ - function ip($check, $type = 'both') { - $_this = &WPToolset_Cake_Validation::getInstance(); - $success = false; - $type = strtolower($type); - if ($type === 'ipv4' || $type === 'both') { - $success |= $_this->_ipv4($check); - } - if ($type === 'ipv6' || $type === 'both') { - $success |= $_this->_ipv6($check); - } - return $success; - } - - /** - * Validation of IPv4 addresses. - * - * @param string $check IP Address to test - * @return boolean Success - * @access protected - */ - function _ipv4($check) { - if (function_exists('filter_var')) { - return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)) !== false; - } - $this->populateIp(); - $this->check = $check; - $this->regex = '/^' . $this->__pattern['IPv4'] . '$/'; - return $this->_check(); - } - - /** - * Validation of IPv6 addresses. - * - * @param string $check IP Address to test - * @return boolean Success - * @access protected - */ - function _ipv6($check) { - if (function_exists('filter_var')) { - return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV6)) !== false; - } - $this->populateIp(); - $this->check = $check; - $this->regex = '/^' . $this->__pattern['IPv6'] . '$/'; - return $this->_check(); - } - - /** - * Checks whether the length of a string is greater or equal to a minimal length. - * - * @param string $check The string to test - * @param integer $min The minimal string length - * @return boolean Success - * @access public - */ - function minLength($check, $min) { - $length = strlen($check); - return ($length >= $min); - } - - /** - * Checks whether the length of a string is smaller or equal to a maximal length.. - * - * @param string $check The string to test - * @param integer $max The maximal string length - * @return boolean Success - * @access public - */ - function maxLength($check, $max) { - $length = strlen($check); - return ($length <= $max); - } - - /** - * Checks that a value is a monetary amount. - * - * @param string $check Value to check - * @param string $symbolPosition Where symbol is located (left/right) - * @return boolean Success - * @access public - */ - function money($check, $symbolPosition = 'left') { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->check = $check; - - if ($symbolPosition == 'right') { - $_this->regex = '/^(?!0,?\d)(?:\d{1,3}(?:([, .])\d{3})?(?:\1\d{3})*|(?:\d+))((?!\1)[,.]\d{2})?(?regex = '/^(?!\x{00a2})\p{Sc}?(?!0,?\d)(?:\d{1,3}(?:([, .])\d{3})?(?:\1\d{3})*|(?:\d+))((?!\1)[,.]\d{2})?$/u'; - } - return $_this->_check(); - } - - /** - * Validate a multiple select. - * - * Valid Options - * - * - in => provide a list of choices that selections must be made from - * - max => maximun number of non-zero choices that can be made - * - min => minimum number of non-zero choices that can be made - * - * @param mixed $check Value to check - * @param mixed $options Options for the check. - * @return boolean Success - * @access public - */ - function multiple($check, $options = array()) { - $defaults = array('in' => null, 'max' => null, 'min' => null); - $options = array_merge($defaults, $options); - $check = array_filter((array) $check); - if (empty($check)) { - return false; - } - if ($options['max'] && count($check) > $options['max']) { - return false; - } - if ($options['min'] && count($check) < $options['min']) { - return false; - } - if ($options['in'] && is_array($options['in'])) { - foreach ($check as $val) { - if (!in_array($val, $options['in'])) { - return false; - } - } - } - return true; - } - - /** - * Checks if a value is numeric. - * - * @param string $check Value to check - * @return boolean Succcess - * @access public - */ - function numeric($check) { - return is_numeric($check); - } - - /** - * Checks if a value is integer. - * - * @param string $check Value to check - * @return boolean Succcess - * @access public - */ - function integer($check) { - return is_int(intval($check)); - } - - /** - * Check that a value is a valid phone number. - * - * @param mixed $check Value to check (string or array) - * @param string $regex Regular expression to use - * @param string $country Country code (defaults to 'all') - * @return boolean Success - * @access public - */ - function phone($check, $regex = null, $country = 'all') { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->check = $check; - $_this->regex = $regex; - $_this->country = $country; - if (is_array($check)) { - $_this->_extract($check); - } - - if (is_null($_this->regex)) { - switch ($_this->country) { - case 'us': - case 'all': - case 'can': - // includes all NANPA members. see http://en.wikipedia.org/wiki/North_American_Numbering_Plan#List_of_NANPA_countries_and_territories - $_this->regex = '/^(?:\+?1)?[-. ]?\\(?[2-9][0-8][0-9]\\)?[-. ]?[2-9][0-9]{2}[-. ]?[0-9]{4}$/'; - break; - } - } - if (empty($_this->regex)) { - return $_this->_pass('phone', $check, $country); - } - return $_this->_check(); - } - - /** - * Checks that a given value is a valid postal code. - * - * @param mixed $check Value to check - * @param string $regex Regular expression to use - * @param string $country Country to use for formatting - * @return boolean Success - * @access public - */ - function postal($check, $regex = null, $country = null) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->check = $check; - $_this->regex = $regex; - $_this->country = $country; - if (is_array($check)) { - $_this->_extract($check); - } - if (empty($country)) { - $_this->country = 'us'; - } - - if (is_null($_this->regex)) { - switch ($_this->country) { - case 'uk': - $_this->regex = '/\\A\\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\\b\\z/i'; - break; - case 'ca': - $_this->regex = '/\\A\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] ?[0-9][A-Z][0-9]\\b\\z/i'; - break; - case 'it': - case 'de': - $_this->regex = '/^[0-9]{5}$/i'; - break; - case 'be': - $_this->regex = '/^[1-9]{1}[0-9]{3}$/i'; - break; - case 'us': - $_this->regex = '/\\A\\b[0-9]{5}(?:-[0-9]{4})?\\b\\z/i'; - break; - } - } - if (empty($_this->regex)) { - return $_this->_pass('postal', $check, $country); - } - return $_this->_check(); - } - - /** - * Validate that a number is in specified range. - * if $lower and $upper are not set, will return true if - * $check is a legal finite on this platform - * - * @param string $check Value to check - * @param integer $lower Lower limit - * @param integer $upper Upper limit - * @return boolean Success - * @access public - */ - function range($check, $lower = null, $upper = null) { - if (!is_numeric($check)) { - return false; - } - if (isset($lower) && isset($upper)) { - return ($check > $lower && $check < $upper); - } - return is_finite($check); - } - - /** - * Checks that a value is a valid Social Security Number. - * - * @param mixed $check Value to check - * @param string $regex Regular expression to use - * @param string $country Country - * @return boolean Success - * @access public - */ - function ssn($check, $regex = null, $country = null) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->check = $check; - $_this->regex = $regex; - $_this->country = $country; - if (is_array($check)) { - $_this->_extract($check); - } - - if (is_null($_this->regex)) { - switch ($_this->country) { - case 'dk': - $_this->regex = '/\\A\\b[0-9]{6}-[0-9]{4}\\b\\z/i'; - break; - case 'nl': - $_this->regex = '/\\A\\b[0-9]{9}\\b\\z/i'; - break; - case 'us': - $_this->regex = '/\\A\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b\\z/i'; - break; - } - } - if (empty($_this->regex)) { - return $_this->_pass('ssn', $check, $country); - } - return $_this->_check(); - } - - /** - * Checks that a value is a valid uuid - http://tools.ietf.org/html/rfc4122 - * - * @param string $check Value to check - * @return boolean Success - * @access public - */ - function uuid($check) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->check = $check; - $_this->regex = '/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i'; - return $_this->_check(); - } - - /** - * Checks that a value is a valid URL according to http://www.w3.org/Addressing/URL/url-spec.txt - * - * The regex checks for the following component parts: - * - * - a valid, optional, scheme - * - a valid ip address OR - * a valid domain name as defined by section 2.3.1 of http://www.ietf.org/rfc/rfc1035.txt - * with an optional port number - * - an optional valid path - * - an optional query string (get parameters) - * - an optional fragment (anchor tag) - * - * @param string $check Value to check - * @param boolean $strict Require URL to be prefixed by a valid scheme (one of http(s)/ftp(s)/file/news/gopher) - * @param bool $require_tld Require the hostname to contain TLD. True by default. - * - * @return bool Success - */ - function url($check, $strict = false, $require_tld = true) { - $_this = &WPToolset_Cake_Validation::getInstance(); - $_this->populateIp(); - $_this->check = $check; - $validChars = '([' . preg_quote('!"$&\'()*+,-.@_:;=~[]') . '\/0-9\p{L}\p{N}]|(%[0-9a-f]{2}))'; - - $hostname_pattern = $_this->__pattern[ ( $require_tld ? 'hostname' : 'hostname_without_tld' ) ]; - - $_this->regex = '/^(?:(?:https?|ftps?|sftp|file|news|gopher):\/\/)' . (!empty($strict) ? '' : '?') . - '(?:' . $_this->__pattern['IPv4'] . '|\[' . $_this->__pattern['IPv6'] . '\]|' . $hostname_pattern . ')(?::[1-9][0-9]{0,4})?' . - '(?:\/?|\/' . $validChars . '*)?' . - '(?:\?' . $validChars . '*)?' . - '(?:#' . $validChars . '*)?$/iu'; - return $_this->_check(); - } - - - /** - * Alternative URL validation that (more or less) corresponds to the url2 validation method in jQuery UI. - * - * It is less strict than the standard 'url' because it doesn't require the TLD to be present in the hostname. - * Parameters are directly passed to self::url(). - * - * Since WordPress allows for non-latin characters to be part of files uploaded via Media Upload, - * we go especially easy on URLs resulting from that. If an URL is identified as one of an attachment, - * no further validation is done (but the goal is achieved, now we know that the user entered a value - * that is correct). - * - * This method isn't bulletproof, though, and if it doesn't work in some special scenario, - * it is possible to make use of the toolset_validate_file_url filter to override the validation result. - * - *@param string $value_to_check Value to check. - * @param bool $strict - * - * @return bool Validation result. - * @since 2.2.6 - */ - function url2( $value_to_check, $strict = false ) { - if( $this->is_attachment_url( $value_to_check ) ) { - $is_valid_url = true; - } else { - $is_valid_url = $this->url( $value_to_check, $strict, false );} - - /** - * toolset_validate_file_url - * - * Allow for overriding the url2 validation result used for file fields. - * - * @param bool $validation_result - * @param string $value_to_check - * @since 2.2.9 - */ - return (bool) apply_filters( 'toolset_validate_file_url', $is_valid_url, $value_to_check ); - } - - - /** - * Determine if a provided URL belongs to an attachment from the media library. - * - * @param string $url - * @return bool - * @since 2.2.9 - */ - private function is_attachment_url( $url ) { - - $url_parts = parse_url( $url ); - if( false === $url_parts ) { - // Seriously malformed URL here. - return false; - } - - $attachment_id = Toolset_Utils::get_attachment_id_by_url( $url ); - - return ( null != $attachment_id && 0 != $attachment_id ); - } - - - /** - * Checks if a value is in a given list. - * - * @param string $check Value to check - * @param array $list List to check against - * @return boolean Succcess - * @access public - */ - function inList($check, $list) { - return in_array($check, $list); - } - - /** - * Runs an user-defined validation. - * - * @param mixed $check value that will be validated in user-defined methods. - * @param object $object class that holds validation method - * @param string $method class method name for validation to run - * @param array $args arguments to send to method - * @return mixed user-defined class class method returns - * @access public - */ - function userDefined($check, $object, $method, $args = null) { - return call_user_func_array(array(&$object, $method), array($check, $args)); - } - - function noSpecialChars($check) { - return preg_match('#[^a-zA-Z0-9\s\_\-]#', $check) ? false : true; - } - - function rewriteSlug($check) { - return preg_match('#[^a-zA-Z0-9\s\_\-\%]#', $check) ? false : true; - } - - /** - * Attempts to pass unhandled Validation locales to a class starting with $classPrefix - * and ending with Validation. For example $classPrefix = 'nl', the class would be - * `NlValidation`. - * - * @param string $method The method to call on the other class. - * @param mixed $check The value to check or an array of parameters for the method to be called. - * @param string $classPrefix The prefix for the class to do the validation. - * @return mixed Return of Passed method, false on failure - * @access protected - * */ - function _pass($method, $check, $classPrefix) { - $className = ucwords($classPrefix) . 'Validation'; - if (!class_exists($className)) { - trigger_error(sprintf(__('Could not find %s class, unable to complete validation.', true), $className), E_USER_WARNING); - return false; - } - if (!is_callable(array($className, $method))) { - trigger_error(sprintf(__('Method %s does not exist on %s unable to complete validation.', true), $method, $className), E_USER_WARNING); - return false; - } - $check = (array) $check; - return call_user_func_array(array($className, $method), $check); - } - - /** - * Runs a regular expression match. - * - * @return boolean Success of match - * @access protected - */ - function _check() { - $_this = &WPToolset_Cake_Validation::getInstance(); - if (preg_match($_this->regex, $_this->check)) { - $_this->error[] = false; - return true; - } else { - $_this->error[] = true; - return false; - } - } - - /** - * Get the values to use when value sent to validation method is - * an array. - * - * @param array $params Parameters sent to validation method - * @return void - * @access protected - */ - function _extract($params) { - $_this = &WPToolset_Cake_Validation::getInstance(); - extract($params, EXTR_OVERWRITE); - - if (isset($check)) { - $_this->check = $check; - } - if (isset($regex)) { - $_this->regex = $regex; - } - if (isset($country)) { - $_this->country = strtolower($country); - } - if (isset($deep)) { - $_this->deep = $deep; - } - if (isset($type)) { - $_this->type = $type; - } - } - - /** - * Luhn algorithm - * - * @see http://en.wikipedia.org/wiki/Luhn_algorithm - * @return boolean Success - * @access protected - */ - function _luhn() { - $_this = &WPToolset_Cake_Validation::getInstance(); - if ($_this->deep !== true) { - return true; - } - if ($_this->check == 0) { - return false; - } - $sum = 0; - $length = strlen($_this->check); - - for ($position = 1 - ($length % 2); $position < $length; $position += 2) { - $sum += $_this->check[$position]; - } - - for ($position = ($length % 2); $position < $length; $position += 2) { - $number = $_this->check[$position] * 2; - $sum += ($number < 10) ? $number : $number - 9; - } - - return ($sum % 10 == 0); - } - - /* - * Lazily popualate the IP address patterns used for validations - * - * @return void - * @access private - */ - - function populateIp() { - if( method_exists( $this, '__populateIp' ) ) { - // support for subclasses overwritting the previous __populateIp function - return $this->__populateIp(); - } - - if (!isset($this->__pattern['IPv6'])) { - $pattern = '((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}'; - $pattern .= '(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})'; - $pattern .= '|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})'; - $pattern .= '(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)'; - $pattern .= '{4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2}))'; - $pattern .= '{3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}'; - $pattern .= '((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|'; - $pattern .= '((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}'; - $pattern .= '((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2}))'; - $pattern .= '{3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4})'; - $pattern .= '{0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)'; - $pattern .= '|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]'; - $pattern .= '\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4})'; - $pattern .= '{1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?'; - - $this->__pattern['IPv6'] = $pattern; - } - if (!isset($this->__pattern['IPv4'])) { - $pattern = '(?:(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|(?:(?:1[0-9])?|[1-9]?)[0-9])'; - $this->__pattern['IPv4'] = $pattern; - } - } - - /** - * Reset internal variables for another validation run. - * - * @return void - * @access private - */ - function reset() { - if( method_exists( $this, '__reset' ) ) { - // support for subclasses overwritting the previous __reset function - return $this->__reset(); - } - - $this->check = null; - $this->regex = null; - $this->country = null; - $this->deep = null; - $this->type = null; - $this->error = array(); - $this->errors = array(); - } - - public static function required($value) { - return !( is_null($value) || $value === false || $value === '' ); - } - - /** - * Backward compatibility - * For PHP 7 we renamed the method __reset() and __populateIp() to reset() and populateIp(). - * As both are public methods we apply this fallback for the case someone calls the old methods. - * - * @param $method - * @param $arguments - */ - public function __call( $method, $arguments ) { - switch( $method ) { - case '__reset': - $this->reset(); - break; - case '__populateIp': - $this->populateIp(); - break; - } - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/adodb-time.inc.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/adodb-time.inc.php deleted file mode 100644 index 2432db8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/adodb-time.inc.php +++ /dev/null @@ -1,1424 +0,0 @@ - 4 digit year conversion. The maximum is billions of years in the -future, but this is a theoretical limit as the computation of that year -would take too long with the current implementation of adodb_mktime(). - -This library replaces native functions as follows: - -
      	
      -	getdate()  with  adodb_getdate()
      -	date()     with  adodb_date() 
      -	gmdate()   with  adodb_gmdate()
      -	mktime()   with  adodb_mktime()
      -	gmmktime() with  adodb_gmmktime()
      -	strftime() with  adodb_strftime()
      -	strftime() with  adodb_gmstrftime()
      -
      - -The parameters are identical, except that adodb_date() accepts a subset -of date()'s field formats. Mktime() will convert from local time to GMT, -and date() will convert from GMT to local time, but daylight savings is -not handled currently. - -This library is independant of the rest of ADOdb, and can be used -as standalone code. - -PERFORMANCE - -For high speed, this library uses the native date functions where -possible, and only switches to PHP code when the dates fall outside -the 32-bit signed integer range. - -GREGORIAN CORRECTION - -Pope Gregory shortened October of A.D. 1582 by ten days. Thursday, -October 4, 1582 (Julian) was followed immediately by Friday, October 15, -1582 (Gregorian). - -Since 0.06, we handle this correctly, so: - -adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582) - == 24 * 3600 (1 day) - -============================================================================= - -COPYRIGHT - -(c) 2003-2005 John Lim and released under BSD-style license except for code by -jackbbs, which includes adodb_mktime, adodb_get_gmt_diff, adodb_is_leap_year -and originally found at http://www.php.net/manual/en/function.mktime.php - -============================================================================= - -BUG REPORTS - -These should be posted to the ADOdb forums at - - http://phplens.com/lens/lensforum/topics.php?id=4 - -============================================================================= - -FUNCTION DESCRIPTIONS - - -** FUNCTION adodb_getdate($date=false) - -Returns an array containing date information, as getdate(), but supports -dates greater than 1901 to 2038. The local date/time format is derived from a -heuristic the first time adodb_getdate is called. - - -** FUNCTION adodb_date($fmt, $timestamp = false) - -Convert a timestamp to a formatted local date. If $timestamp is not defined, the -current timestamp is used. Unlike the function date(), it supports dates -outside the 1901 to 2038 range. - -The format fields that adodb_date supports: - -
      -	a - "am" or "pm" 
      -	A - "AM" or "PM" 
      -	d - day of the month, 2 digits with leading zeros; i.e. "01" to "31" 
      -	D - day of the week, textual, 3 letters; e.g. "Fri" 
      -	F - month, textual, long; e.g. "January" 
      -	g - hour, 12-hour format without leading zeros; i.e. "1" to "12" 
      -	G - hour, 24-hour format without leading zeros; i.e. "0" to "23" 
      -	h - hour, 12-hour format; i.e. "01" to "12" 
      -	H - hour, 24-hour format; i.e. "00" to "23" 
      -	i - minutes; i.e. "00" to "59" 
      -	j - day of the month without leading zeros; i.e. "1" to "31" 
      -	l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"  
      -	L - boolean for whether it is a leap year; i.e. "0" or "1" 
      -	m - month; i.e. "01" to "12" 
      -	M - month, textual, 3 letters; e.g. "Jan" 
      -	n - month without leading zeros; i.e. "1" to "12" 
      -	O - Difference to Greenwich time in hours; e.g. "+0200" 
      -	Q - Quarter, as in 1, 2, 3, 4 
      -	r - RFC 2822 formatted date; e.g. "Thu, 21 Dec 2000 16:01:07 +0200" 
      -	s - seconds; i.e. "00" to "59" 
      -	S - English ordinal suffix for the day of the month, 2 characters; 
      -	   			i.e. "st", "nd", "rd" or "th" 
      -	t - number of days in the given month; i.e. "28" to "31"
      -	T - Timezone setting of this machine; e.g. "EST" or "MDT" 
      -	U - seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)  
      -	w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday) 
      -	Y - year, 4 digits; e.g. "1999" 
      -	y - year, 2 digits; e.g. "99" 
      -	z - day of the year; i.e. "0" to "365" 
      -	Z - timezone offset in seconds (i.e. "-43200" to "43200"). 
      -	   			The offset for timezones west of UTC is always negative, 
      -				and for those east of UTC is always positive. 
      -
      - -Unsupported: -
      -	B - Swatch Internet time 
      -	I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
      -	W - ISO-8601 week number of year, weeks starting on Monday 
      -
      -
      - - -** FUNCTION adodb_date2($fmt, $isoDateString = false) -Same as adodb_date, but 2nd parameter accepts iso date, eg. - - adodb_date2('d-M-Y H:i','2003-12-25 13:01:34'); - - -** FUNCTION adodb_gmdate($fmt, $timestamp = false) - -Convert a timestamp to a formatted GMT date. If $timestamp is not defined, the -current timestamp is used. Unlike the function date(), it supports dates -outside the 1901 to 2038 range. - - -** FUNCTION adodb_mktime($hr, $min, $sec[, $month, $day, $year]) - -Converts a local date to a unix timestamp. Unlike the function mktime(), it supports -dates outside the 1901 to 2038 range. All parameters are optional. - - -** FUNCTION adodb_gmmktime($hr, $min, $sec [, $month, $day, $year]) - -Converts a gmt date to a unix timestamp. Unlike the function gmmktime(), it supports -dates outside the 1901 to 2038 range. Differs from gmmktime() in that all parameters -are currently compulsory. - -** FUNCTION adodb_gmstrftime($fmt, $timestamp = false) -Convert a timestamp to a formatted GMT date. - -** FUNCTION adodb_strftime($fmt, $timestamp = false) - -Convert a timestamp to a formatted local date. Internally converts $fmt into -adodb_date format, then echo result. - -For best results, you can define the local date format yourself. Define a global -variable $ADODB_DATE_LOCALE which is an array, 1st element is date format using -adodb_date syntax, and 2nd element is the time format, also in adodb_date syntax. - - eg. $ADODB_DATE_LOCALE = array('d/m/Y','H:i:s'); - - Supported format codes: - -
      -	%a - abbreviated weekday name according to the current locale 
      -	%A - full weekday name according to the current locale 
      -	%b - abbreviated month name according to the current locale 
      -	%B - full month name according to the current locale 
      -	%c - preferred date and time representation for the current locale 
      -	%d - day of the month as a decimal number (range 01 to 31) 
      -	%D - same as %m/%d/%y 
      -	%e - day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31') 
      -	%h - same as %b
      -	%H - hour as a decimal number using a 24-hour clock (range 00 to 23) 
      -	%I - hour as a decimal number using a 12-hour clock (range 01 to 12) 
      -	%m - month as a decimal number (range 01 to 12) 
      -	%M - minute as a decimal number 
      -	%n - newline character 
      -	%p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale 
      -	%r - time in a.m. and p.m. notation 
      -	%R - time in 24 hour notation 
      -	%S - second as a decimal number 
      -	%t - tab character 
      -	%T - current time, equal to %H:%M:%S 
      -	%x - preferred date representation for the current locale without the time 
      -	%X - preferred time representation for the current locale without the date 
      -	%y - year as a decimal number without a century (range 00 to 99) 
      -	%Y - year as a decimal number including the century 
      -	%Z - time zone or name or abbreviation 
      -	%% - a literal `%' character 
      -
      - - Unsupported codes: -
      -	%C - century number (the year divided by 100 and truncated to an integer, range 00 to 99) 
      -	%g - like %G, but without the century. 
      -	%G - The 4-digit year corresponding to the ISO week number (see %V). 
      -	     This has the same format and value as %Y, except that if the ISO week number belongs 
      -		 to the previous or next year, that year is used instead. 
      -	%j - day of the year as a decimal number (range 001 to 366) 
      -	%u - weekday as a decimal number [1,7], with 1 representing Monday 
      -	%U - week number of the current year as a decimal number, starting 
      -	    with the first Sunday as the first day of the first week 
      -	%V - The ISO 8601:1988 week number of the current year as a decimal number, 
      -	     range 01 to 53, where week 1 is the first week that has at least 4 days in the 
      -		 current year, and with Monday as the first day of the week. (Use %G or %g for 
      -		 the year component that corresponds to the week number for the specified timestamp.) 
      -	%w - day of the week as a decimal, Sunday being 0 
      -	%W - week number of the current year as a decimal number, starting with the 
      -	     first Monday as the first day of the first week 
      -
      - -============================================================================= - -NOTES - -Useful url for generating test timestamps: - http://www.4webhelp.net/us/timestamp.php - -Possible future optimizations include - -a. Using an algorithm similar to Plauger's in "The Standard C Library" -(page 428, xttotm.c _Ttotm() function). Plauger's algorithm will not -work outside 32-bit signed range, so i decided not to implement it. - -b. Implement daylight savings, which looks awfully complicated, see - http://webexhibits.org/daylightsaving/ - - -CHANGELOG - -- 11 Feb 2008 0.33 -* Bug in 0.32 fix for hour handling. Fixed. - -- 1 Feb 2008 0.32 -* Now adodb_mktime(0,0,0,12+$m,20,2040) works properly. - -- 10 Jan 2008 0.31 -* Now adodb_mktime(0,0,0,24,1,2037) works correctly. - -- 15 July 2007 0.30 -Added PHP 5.2.0 compatability fixes. - * gmtime behaviour for 1970 has changed. We use the actual date if it is between 1970 to 2038 to get the - * timezone, otherwise we use the current year as the baseline to retrieve the timezone. - * Also the timezone's in php 5.2.* support historical data better, eg. if timezone today was +8, but - in 1970 it was +7:30, then php 5.2 return +7:30, while this library will use +8. - * - -- 19 March 2006 0.24 -Changed strftime() locale detection, because some locales prepend the day of week to the date when %c is used. - -- 10 Feb 2006 0.23 -PHP5 compat: when we detect PHP5, the RFC2822 format for gmt 0000hrs is changed from -0000 to +0000. - In PHP4, we will still use -0000 for 100% compat with PHP4. - -- 08 Sept 2005 0.22 -In adodb_date2(), $is_gmt not supported properly. Fixed. - -- 18 July 2005 0.21 -In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat. -Added support for negative months in adodb_mktime(). - -- 24 Feb 2005 0.20 -Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date(). - -- 21 Dec 2004 0.17 -In adodb_getdate(), the timestamp was accidentally converted to gmt when $is_gmt is false. -Also adodb_mktime(0,0,0) did not work properly. Both fixed thx Mauro. - -- 17 Nov 2004 0.16 -Removed intval typecast in adodb_mktime() for secs, allowing: - adodb_mktime(0,0,0 + 2236672153,1,1,1934); -Suggested by Ryan. - -- 18 July 2004 0.15 -All params in adodb_mktime were formerly compulsory. Now only the hour, min, secs is compulsory. -This brings it more in line with mktime (still not identical). - -- 23 June 2004 0.14 - -Allow you to define your own daylights savings function, adodb_daylight_sv. -If the function is defined (somewhere in an include), then you can correct for daylights savings. - -In this example, we apply daylights savings in June or July, adding one hour. This is extremely -unrealistic as it does not take into account time-zone, geographic location, current year. - -function adodb_daylight_sv(&$arr, $is_gmt) -{ - if ($is_gmt) return; - $m = $arr['mon']; - if ($m == 6 || $m == 7) $arr['hours'] += 1; -} - -This is only called by adodb_date() and not by adodb_mktime(). - -The format of $arr is -Array ( - [seconds] => 0 - [minutes] => 0 - [hours] => 0 - [mday] => 1 # day of month, eg 1st day of the month - [mon] => 2 # month (eg. Feb) - [year] => 2102 - [yday] => 31 # days in current year - [leap] => # true if leap year - [ndays] => 28 # no of days in current month - ) - - -- 28 Apr 2004 0.13 -Fixed adodb_date to properly support $is_gmt. Thx to Dimitar Angelov. - -- 20 Mar 2004 0.12 -Fixed month calculation error in adodb_date. 2102-June-01 appeared as 2102-May-32. - -- 26 Oct 2003 0.11 -Because of daylight savings problems (some systems apply daylight savings to -January!!!), changed adodb_get_gmt_diff() to ignore daylight savings. - -- 9 Aug 2003 0.10 -Fixed bug with dates after 2038. -See http://phplens.com/lens/lensforum/msgs.php?id=6980 - -- 1 July 2003 0.09 -Added support for Q (Quarter). -Added adodb_date2(), which accepts ISO date in 2nd param - -- 3 March 2003 0.08 -Added support for 'S' adodb_date() format char. Added constant ADODB_ALLOW_NEGATIVE_TS -if you want PHP to handle negative timestamps between 1901 to 1969. - -- 27 Feb 2003 0.07 -All negative numbers handled by adodb now because of RH 7.3+ problems. -See http://bugs.php.net/bug.php?id=20048&edit=2 - -- 4 Feb 2003 0.06 -Fixed a typo, 1852 changed to 1582! This means that pre-1852 dates -are now correctly handled. - -- 29 Jan 2003 0.05 - -Leap year checking differs under Julian calendar (pre 1582). Also -leap year code optimized by checking for most common case first. - -We also handle month overflow correctly in mktime (eg month set to 13). - -Day overflow for less than one month's days is supported. - -- 28 Jan 2003 0.04 - -Gregorian correction handled. In PHP5, we might throw an error if -mktime uses invalid dates around 5-14 Oct 1582. Released with ADOdb 3.10. -Added limbo 5-14 Oct 1582 check, when we set to 15 Oct 1582. - -- 27 Jan 2003 0.03 - -Fixed some more month problems due to gmt issues. Added constant ADODB_DATE_VERSION. -Fixed calculation of days since start of year for <1970. - -- 27 Jan 2003 0.02 - -Changed _adodb_getdate() to inline leap year checking for better performance. -Fixed problem with time-zones west of GMT +0000. - -- 24 Jan 2003 0.01 - -First implementation. -*/ - - -/* Initialization */ - -/* - Version Number -*/ -define('ADODB_DATE_VERSION',0.33); - -$ADODB_DATETIME_CLASS = (PHP_VERSION >= 5.2); - -/* - This code was originally for windows. But apparently this problem happens - also with Linux, RH 7.3 and later! - - glibc-2.2.5-34 and greater has been changed to return -1 for dates < - 1970. This used to work. The problem exists with RedHat 7.3 and 8.0 - echo (mktime(0, 0, 0, 1, 1, 1960)); // prints -1 - - References: - http://bugs.php.net/bug.php?id=20048&edit=2 - http://lists.debian.org/debian-glibc/2002/debian-glibc-200205/msg00010.html -*/ - -if (!defined('ADODB_ALLOW_NEGATIVE_TS')) define('ADODB_NO_NEGATIVE_TS',1); - -function adodb_date_test_date($y1,$m,$d=13) -{ - $h = round(rand()% 24); - $t = adodb_mktime($h,0,0,$m,$d,$y1); - $rez = adodb_date('Y-n-j H:i:s',$t); - if ($h == 0) $h = '00'; - else if ($h < 10) $h = '0'.$h; - if ("$y1-$m-$d $h:00:00" != $rez) { - print "$y1 error, expected=$y1-$m-$d $h:00:00, adodb=$rez
      "; - return false; - } - return true; -} - -function adodb_date_test_strftime($fmt) -{ - $s1 = strftime($fmt); - $s2 = adodb_strftime($fmt); - - if ($s1 == $s2) return true; - - echo "error for $fmt, strftime=$s1, adodb=$s2
      "; - return false; -} - -/** - Test Suite -*/ -function adodb_date_test() -{ - - for ($m=-24; $m<=24; $m++) - echo "$m :",adodb_date('d-m-Y',adodb_mktime(0,0,0,1+$m,20,2040)),"
      "; - - error_reporting(E_ALL); - print "

      Testing adodb_date and adodb_mktime. version=".ADODB_DATE_VERSION.' PHP='.PHP_VERSION."

      "; - @set_time_limit(0); - $fail = false; - - // This flag disables calling of PHP native functions, so we can properly test the code - if (!defined('ADODB_TEST_DATES')) define('ADODB_TEST_DATES',1); - - $t = time(); - - - $fmt = 'Y-m-d H:i:s'; - echo '
      ';
      -	echo 'adodb: ',adodb_date($fmt,$t),'
      '; - echo 'php : ',date($fmt,$t),'
      '; - echo '
      '; - - adodb_date_test_strftime('%Y %m %x %X'); - adodb_date_test_strftime("%A %d %B %Y"); - adodb_date_test_strftime("%H %M S"); - - $t = adodb_mktime(0,0,0); - if (!(adodb_date('Y-m-d') == date('Y-m-d'))) print 'Error in '.adodb_mktime(0,0,0).'
      '; - - $t = adodb_mktime(0,0,0,6,1,2102); - if (!(adodb_date('Y-m-d',$t) == '2102-06-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
      '; - - $t = adodb_mktime(0,0,0,2,1,2102); - if (!(adodb_date('Y-m-d',$t) == '2102-02-01')) print 'Error in '.adodb_date('Y-m-d',$t).'
      '; - - - print "

      Testing gregorian <=> julian conversion

      "; - $t = adodb_mktime(0,0,0,10,11,1492); - //http://www.holidayorigins.com/html/columbus_day.html - Friday check - if (!(adodb_date('D Y-m-d',$t) == 'Fri 1492-10-11')) print 'Error in Columbus landing
      '; - - $t = adodb_mktime(0,0,0,2,29,1500); - if (!(adodb_date('Y-m-d',$t) == '1500-02-29')) print 'Error in julian leap years
      '; - - $t = adodb_mktime(0,0,0,2,29,1700); - if (!(adodb_date('Y-m-d',$t) == '1700-03-01')) print 'Error in gregorian leap years
      '; - - print adodb_mktime(0,0,0,10,4,1582).' '; - print adodb_mktime(0,0,0,10,15,1582); - $diff = (adodb_mktime(0,0,0,10,15,1582) - adodb_mktime(0,0,0,10,4,1582)); - if ($diff != 3600*24) print " Error in gregorian correction = ".($diff/3600/24)." days
      "; - - print " 15 Oct 1582, Fri=".(adodb_dow(1582,10,15) == 5 ? 'Fri' : 'Error')."
      "; - print " 4 Oct 1582, Thu=".(adodb_dow(1582,10,4) == 4 ? 'Thu' : 'Error')."
      "; - - print "

      Testing overflow

      "; - - $t = adodb_mktime(0,0,0,3,33,1965); - if (!(adodb_date('Y-m-d',$t) == '1965-04-02')) print 'Error in day overflow 1
      '; - $t = adodb_mktime(0,0,0,4,33,1971); - if (!(adodb_date('Y-m-d',$t) == '1971-05-03')) print 'Error in day overflow 2
      '; - $t = adodb_mktime(0,0,0,1,60,1965); - if (!(adodb_date('Y-m-d',$t) == '1965-03-01')) print 'Error in day overflow 3 '.adodb_date('Y-m-d',$t).'
      '; - $t = adodb_mktime(0,0,0,12,32,1965); - if (!(adodb_date('Y-m-d',$t) == '1966-01-01')) print 'Error in day overflow 4 '.adodb_date('Y-m-d',$t).'
      '; - $t = adodb_mktime(0,0,0,12,63,1965); - if (!(adodb_date('Y-m-d',$t) == '1966-02-01')) print 'Error in day overflow 5 '.adodb_date('Y-m-d',$t).'
      '; - $t = adodb_mktime(0,0,0,13,3,1965); - if (!(adodb_date('Y-m-d',$t) == '1966-01-03')) print 'Error in mth overflow 1
      '; - - print "Testing 2-digit => 4-digit year conversion

      "; - if (adodb_year_digit_check(00) != 2000) print "Err 2-digit 2000
      "; - if (adodb_year_digit_check(10) != 2010) print "Err 2-digit 2010
      "; - if (adodb_year_digit_check(20) != 2020) print "Err 2-digit 2020
      "; - if (adodb_year_digit_check(30) != 2030) print "Err 2-digit 2030
      "; - if (adodb_year_digit_check(40) != 1940) print "Err 2-digit 1940
      "; - if (adodb_year_digit_check(50) != 1950) print "Err 2-digit 1950
      "; - if (adodb_year_digit_check(90) != 1990) print "Err 2-digit 1990
      "; - - // Test string formating - print "

      Testing date formating

      "; - - $fmt = '\d\a\t\e T Y-m-d H:i:s a A d D F g G h H i j l L m M n O \R\F\C2822 r s t U w y Y z Z 2003'; - $s1 = date($fmt,0); - $s2 = adodb_date($fmt,0); - if ($s1 != $s2) { - print " date() 0 failed
      $s1
      $s2
      "; - } - flush(); - for ($i=100; --$i > 0; ) { - - $ts = 3600.0*((rand()%60000)+(rand()%60000))+(rand()%60000); - $s1 = date($fmt,$ts); - $s2 = adodb_date($fmt,$ts); - //print "$s1
      $s2

      "; - $pos = strcmp($s1,$s2); - - if (($s1) != ($s2)) { - for ($j=0,$k=strlen($s1); $j < $k; $j++) { - if ($s1[$j] != $s2[$j]) { - print substr($s1,$j).' '; - break; - } - } - print "Error date(): $ts

       
      -  \"$s1\" (date len=".strlen($s1).")
      -  \"$s2\" (adodb_date len=".strlen($s2).")

      "; - $fail = true; - } - - $a1 = getdate($ts); - $a2 = adodb_getdate($ts); - $rez = array_diff($a1,$a2); - if (sizeof($rez)>0) { - print "Error getdate() $ts
      "; - print_r($a1); - print "
      "; - print_r($a2); - print "

      "; - $fail = true; - } - } - - // Test generation of dates outside 1901-2038 - print "

      Testing random dates between 100 and 4000

      "; - adodb_date_test_date(100,1); - for ($i=100; --$i >= 0;) { - $y1 = 100+rand(0,1970-100); - $m = rand(1,12); - adodb_date_test_date($y1,$m); - - $y1 = 3000-rand(0,3000-1970); - adodb_date_test_date($y1,$m); - } - print '

      '; - $start = 1960+rand(0,10); - $yrs = 12; - $i = 365.25*86400*($start-1970); - $offset = 36000+rand(10000,60000); - $max = 365*$yrs*86400; - $lastyear = 0; - - // we generate a timestamp, convert it to a date, and convert it back to a timestamp - // and check if the roundtrip broke the original timestamp value. - print "Testing $start to ".($start+$yrs).", or $max seconds, offset=$offset: "; - $cnt = 0; - for ($max += $i; $i < $max; $i += $offset) { - $ret = adodb_date('m,d,Y,H,i,s',$i); - $arr = explode(',',$ret); - if ($lastyear != $arr[2]) { - $lastyear = $arr[2]; - print " $lastyear "; - flush(); - } - $newi = adodb_mktime($arr[3],$arr[4],$arr[5],$arr[0],$arr[1],$arr[2]); - if ($i != $newi) { - print "Error at $i, adodb_mktime returned $newi ($ret)"; - $fail = true; - break; - } - $cnt += 1; - } - echo "Tested $cnt dates
      "; - if (!$fail) print "

      Passed !

      "; - else print "

      Failed :-(

      "; -} - -/** - Returns day of week, 0 = Sunday,... 6=Saturday. - Algorithm from PEAR::Date_Calc -*/ -function adodb_dow($year, $month, $day) -{ -/* -Pope Gregory removed 10 days - October 5 to October 14 - from the year 1582 and -proclaimed that from that time onwards 3 days would be dropped from the calendar -every 400 years. - -Thursday, October 4, 1582 (Julian) was followed immediately by Friday, October 15, 1582 (Gregorian). -*/ - if ($year <= 1582) { - if ($year < 1582 || - ($year == 1582 && ($month < 10 || ($month == 10 && $day < 15)))) $greg_correction = 3; - else - $greg_correction = 0; - } else - $greg_correction = 0; - - if($month > 2) - $month -= 2; - else { - $month += 10; - $year--; - } - - $day = floor((13 * $month - 1) / 5) + - $day + ($year % 100) + - floor(($year % 100) / 4) + - floor(($year / 100) / 4) - 2 * - floor($year / 100) + 77 + $greg_correction; - - return $day - 7 * floor($day / 7); -} - - -/** - Checks for leap year, returns true if it is. No 2-digit year check. Also - handles julian calendar correctly. -*/ -function _adodb_is_leap_year($year) -{ - if ($year % 4 != 0) return false; - - if ($year % 400 == 0) { - return true; - // if gregorian calendar (>1582), century not-divisible by 400 is not leap - } else if ($year > 1582 && $year % 100 == 0 ) { - return false; - } - - return true; -} - - -/** - checks for leap year, returns true if it is. Has 2-digit year check -*/ -function adodb_is_leap_year($year) -{ - return _adodb_is_leap_year(adodb_year_digit_check($year)); -} - -/** - Fix 2-digit years. Works for any century. - Assumes that if 2-digit is more than 30 years in future, then previous century. -*/ -function adodb_year_digit_check($y) -{ - if ($y < 100) { - - $yr = (integer) date("Y"); - $century = (integer) ($yr /100); - - if ($yr%100 > 50) { - $c1 = $century + 1; - $c0 = $century; - } else { - $c1 = $century; - $c0 = $century - 1; - } - $c1 *= 100; - // if 2-digit year is less than 30 years in future, set it to this century - // otherwise if more than 30 years in future, then we set 2-digit year to the prev century. - if (($y + $c1) < $yr+30) $y = $y + $c1; - else $y = $y + $c0*100; - } - return $y; -} - -function adodb_get_gmt_diff_ts($ts) -{ - if (0 <= $ts && $ts <= 0x7FFFFFFF) { // check if number in 32-bit signed range) { - $arr = getdate($ts); - $y = $arr['year']; - $m = $arr['mon']; - $d = $arr['mday']; - return adodb_get_gmt_diff($y,$m,$d); - } else { - return adodb_get_gmt_diff(false,false,false); - } - -} - -/** - get local time zone offset from GMT. Does not handle historical timezones before 1970. -*/ -function adodb_get_gmt_diff($y,$m,$d) -{ -static $TZ,$tzo; -global $ADODB_DATETIME_CLASS; - - if (!defined('ADODB_TEST_DATES')) $y = false; - else if ($y < 1970 || $y >= 2038) $y = false; - - if ($ADODB_DATETIME_CLASS && $y !== false) { - $dt = new DateTime(); - $dt->setISODate($y,$m,$d); - if (empty($tzo)) { - $tzo = new DateTimeZone(date_default_timezone_get()); - # $tzt = timezone_transitions_get( $tzo ); - } - return -$tzo->getOffset($dt); - } else { - if (isset($TZ)) return $TZ; - $y = date('Y'); - // TOOLSET MODIFIED -// $TZ = mktime(0,0,0,12,2,$y,0) - gmmktime(0,0,0,12,2,$y,0); - $TZ = mktime(0,0,0,12,2,$y) - gmmktime(0,0,0,12,2,$y); - } - - return $TZ; -} - -/** - Returns an array with date info. -*/ -function adodb_getdate($d=false,$fast=false) -{ - if ($d === false) return getdate(); - if (!defined('ADODB_TEST_DATES')) { - if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range - if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer - return @getdate($d); - } - } - return _adodb_getdate($d); -} - -/* -// generate $YRS table for _adodb_getdate() -function adodb_date_gentable($out=true) -{ - - for ($i=1970; $i >= 1600; $i-=10) { - $s = adodb_gmmktime(0,0,0,1,1,$i); - echo "$i => $s,
      "; - } -} -adodb_date_gentable(); - -for ($i=1970; $i > 1500; $i--) { - -echo "
      $i "; - adodb_date_test_date($i,1,1); -} - -*/ - - -$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31); -$_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31); - -function adodb_validdate($y,$m,$d) -{ -global $_month_table_normal,$_month_table_leaf; - - if (_adodb_is_leap_year($y)) $marr = $_month_table_leaf; - else $marr = $_month_table_normal; - - if ($m > 12 || $m < 1) return false; - - if ($d > 31 || $d < 1) return false; - - if ($marr[$m] < $d) return false; - - if ($y < 1000 && $y > 3000) return false; - - return true; -} - -/** - Low-level function that returns the getdate() array. We have a special - $fast flag, which if set to true, will return fewer array values, - and is much faster as it does not calculate dow, etc. -*/ -function _adodb_getdate($origd=false,$fast=false,$is_gmt=false) -{ -static $YRS; -global $_month_table_normal,$_month_table_leaf; - - $d = $origd - ($is_gmt ? 0 : adodb_get_gmt_diff_ts($origd)); - $_day_power = 86400; - $_hour_power = 3600; - $_min_power = 60; - - // TODO WPTOOLSET CORRECTION - if ($d < -12219321600) $d -= 86400*10; // if 15 Oct 1582 or earlier, gregorian correction - - $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31); - $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31); - - $d366 = $_day_power * 366; - $d365 = $_day_power * 365; - - if ($d < 0) { - - if (empty($YRS)) $YRS = array( - 1970 => 0, - 1960 => -315619200, - 1950 => -631152000, - 1940 => -946771200, - 1930 => -1262304000, - 1920 => -1577923200, - 1910 => -1893456000, - 1900 => -2208988800, - 1890 => -2524521600, - 1880 => -2840140800, - 1870 => -3155673600, - 1860 => -3471292800, - 1850 => -3786825600, - 1840 => -4102444800, - 1830 => -4417977600, - 1820 => -4733596800, - 1810 => -5049129600, - 1800 => -5364662400, - 1790 => -5680195200, - 1780 => -5995814400, - 1770 => -6311347200, - 1760 => -6626966400, - 1750 => -6942499200, - 1740 => -7258118400, - 1730 => -7573651200, - 1720 => -7889270400, - 1710 => -8204803200, - 1700 => -8520336000, - 1690 => -8835868800, - 1680 => -9151488000, - 1670 => -9467020800, - 1660 => -9782640000, - 1650 => -10098172800, - 1640 => -10413792000, - 1630 => -10729324800, - 1620 => -11044944000, - 1610 => -11360476800, - 1600 => -11676096000); - - if ($is_gmt) $origd = $d; - // The valid range of a 32bit signed timestamp is typically from - // Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT - // - - # old algorithm iterates through all years. new algorithm does it in - # 10 year blocks - - /* - # old algo - for ($a = 1970 ; --$a >= 0;) { - $lastd = $d; - - if ($leaf = _adodb_is_leap_year($a)) $d += $d366; - else $d += $d365; - - if ($d >= 0) { - $year = $a; - break; - } - } - */ - - $lastsecs = 0; - $lastyear = 1970; - foreach($YRS as $year => $secs) { - if ($d >= $secs) { - $a = $lastyear; - break; - } - $lastsecs = $secs; - $lastyear = $year; - } - - $d -= $lastsecs; - if (!isset($a)) $a = $lastyear; - - //echo ' yr=',$a,' ', $d,'.'; - - for (; --$a >= 0;) { - $lastd = $d; - - if ($leaf = _adodb_is_leap_year($a)) $d += $d366; - else $d += $d365; - - if ($d >= 0) { - $year = $a; - break; - } - } - /**/ - - $secsInYear = 86400 * ($leaf ? 366 : 365) + $lastd; - - $d = $lastd; - $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal; - for ($a = 13 ; --$a > 0;) { - $lastd = $d; - $d += $mtab[$a] * $_day_power; - if ($d >= 0) { - $month = $a; - $ndays = $mtab[$a]; - break; - } - } - - $d = $lastd; - $day = $ndays + ceil(($d+1) / ($_day_power)); - - $d += ($ndays - $day+1)* $_day_power; - $hour = floor($d/$_hour_power); - - } else { - for ($a = 1970 ;; $a++) { - $lastd = $d; - - if ($leaf = _adodb_is_leap_year($a)) $d -= $d366; - else $d -= $d365; - if ($d < 0) { - $year = $a; - break; - } - } - $secsInYear = $lastd; - $d = $lastd; - $mtab = ($leaf) ? $_month_table_leaf : $_month_table_normal; - for ($a = 1 ; $a <= 12; $a++) { - $lastd = $d; - $d -= $mtab[$a] * $_day_power; - if ($d < 0) { - $month = $a; - $ndays = $mtab[$a]; - break; - } - } - $d = $lastd; - $day = ceil(($d+1) / $_day_power); - $d = $d - ($day-1) * $_day_power; - $hour = floor($d /$_hour_power); - } - - $d -= $hour * $_hour_power; - $min = floor($d/$_min_power); - $secs = $d - $min * $_min_power; - if ($fast) { - return array( - 'seconds' => $secs, - 'minutes' => $min, - 'hours' => $hour, - 'mday' => $day, - 'mon' => $month, - 'year' => $year, - 'yday' => floor($secsInYear/$_day_power), - 'leap' => $leaf, - 'ndays' => $ndays - ); - } - - - $dow = adodb_dow($year,$month,$day); - - return array( - 'seconds' => $secs, - 'minutes' => $min, - 'hours' => $hour, - 'mday' => $day, - 'wday' => $dow, - 'mon' => $month, - 'year' => $year, - 'yday' => floor($secsInYear/$_day_power), - 'weekday' => gmdate('l',$_day_power*(3+$dow)), - 'month' => gmdate('F',mktime(0,0,0,$month,2,1971)), - 0 => $origd - ); -} - -function adodb_tz_offset($gmt,$isphp5) -{ - $zhrs = abs($gmt)/3600; - $hrs = floor($zhrs); - if ($isphp5) { - return sprintf('%s%02d%02d',($gmt<=0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60); - } else { - return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60); - } -} - - -function adodb_gmdate($fmt,$d=false) -{ - return adodb_date($fmt,$d,true); -} - -// accepts unix timestamp and iso date format in $d -function adodb_date2($fmt, $d=false, $is_gmt=false) -{ - if ($d !== false) { - if (!preg_match( - "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ -]?(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", - ($d), $rr)) return adodb_date($fmt,false,$is_gmt); - - if ($rr[1] <= 100 && $rr[2]<= 1) return adodb_date($fmt,false,$is_gmt); - - // h-m-s-MM-DD-YY - if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1],false,$is_gmt); - else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1],false,$is_gmt); - } - - return adodb_date($fmt,$d,$is_gmt); -} - - -/** - Return formatted date based on timestamp $d -*/ -function adodb_date($fmt,$d=false,$is_gmt=false) -{ -static $daylight; -global $ADODB_DATETIME_CLASS; - - if ($d === false) return ($is_gmt)? @gmdate($fmt): @date_i18n($fmt); - if (!defined('ADODB_TEST_DATES')) { - if ((abs($d) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range - if (!defined('ADODB_NO_NEGATIVE_TS') || $d >= 0) // if windows, must be +ve integer - return ($is_gmt)? @gmdate($fmt,$d): @date_i18n($fmt,$d); - - } - } - $_day_power = 86400; - - $arr = _adodb_getdate($d,true,$is_gmt); - - if (!isset($daylight)) $daylight = function_exists('adodb_daylight_sv'); - if ($daylight) adodb_daylight_sv($arr, $is_gmt); - - $year = $arr['year']; - $month = $arr['mon']; - $day = $arr['mday']; - $hour = $arr['hours']; - $min = $arr['minutes']; - $secs = $arr['seconds']; - - $max = strlen($fmt); - $dates = ''; - - $isphp5 = PHP_VERSION >= 5; - - /* - at this point, we have the following integer vars to manipulate: - $year, $month, $day, $hour, $min, $secs - */ - for ($i=0; $i < $max; $i++) { - switch($fmt[$i]) { - case 'T': - if ($ADODB_DATETIME_CLASS) { - $dt = new DateTime(); - $dt->SetDate($year,$month,$day); - $dates .= $dt->Format('T'); - } else - $dates .= date_i18n('T'); - break; - // YEAR - case 'L': $dates .= $arr['leap'] ? '1' : '0'; break; - case 'r': // Thu, 21 Dec 2000 16:01:07 +0200 - - // 4.3.11 uses '04 Jun 2004' - // 4.3.8 uses ' 4 Jun 2004' - $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))).', ' - . ($day<10?'0'.$day:$day) . ' '.date_i18n('M',mktime(0,0,0,$month,2,1971)).' '.$year.' '; - - if ($hour < 10) $dates .= '0'.$hour; else $dates .= $hour; - - if ($min < 10) $dates .= ':0'.$min; else $dates .= ':'.$min; - - if ($secs < 10) $dates .= ':0'.$secs; else $dates .= ':'.$secs; - - $gmt = adodb_get_gmt_diff($year,$month,$day); - - $dates .= ' '.adodb_tz_offset($gmt,$isphp5); - break; - - case 'Y': $dates .= $year; break; - case 'y': $dates .= substr($year,strlen($year)-2,2); break; - // MONTH - case 'm': if ($month<10) $dates .= '0'.$month; else $dates .= $month; break; - case 'Q': $dates .= ($month+3)>>2; break; - case 'n': $dates .= $month; break; - case 'M': $dates .= date_i18n('M',mktime(0,0,0,$month,2,1971)); break; - case 'F': $dates .= date_i18n('F',mktime(0,0,0,$month,2,1971)); break; - // DAY - case 't': $dates .= $arr['ndays']; break; - case 'z': $dates .= $arr['yday']; break; - case 'w': $dates .= adodb_dow($year,$month,$day); break; - case 'l': $dates .= gmdate('l',$_day_power*(3+adodb_dow($year,$month,$day))); break; - case 'D': $dates .= gmdate('D',$_day_power*(3+adodb_dow($year,$month,$day))); break; - case 'j': $dates .= $day; break; - case 'd': if ($day<10) $dates .= '0'.$day; else $dates .= $day; break; - case 'S': - $d10 = $day % 10; - if ($d10 == 1) $dates .= 'st'; - else if ($d10 == 2 && $day != 12) $dates .= 'nd'; - else if ($d10 == 3) $dates .= 'rd'; - else $dates .= 'th'; - break; - - // HOUR - case 'Z': - $dates .= ($is_gmt) ? 0 : -adodb_get_gmt_diff($year,$month,$day); break; - case 'O': - $gmt = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$month,$day); - - $dates .= adodb_tz_offset($gmt,$isphp5); - break; - - case 'H': - if ($hour < 10) $dates .= '0'.$hour; - else $dates .= $hour; - break; - case 'h': - if ($hour > 12) $hh = $hour - 12; - else { - if ($hour == 0) $hh = '12'; - else $hh = $hour; - } - - if ($hh < 10) $dates .= '0'.$hh; - else $dates .= $hh; - break; - - case 'G': - $dates .= $hour; - break; - - case 'g': - if ($hour > 12) $hh = $hour - 12; - else { - if ($hour == 0) $hh = '12'; - else $hh = $hour; - } - $dates .= $hh; - break; - // MINUTES - case 'i': if ($min < 10) $dates .= '0'.$min; else $dates .= $min; break; - // SECONDS - case 'U': $dates .= $d; break; - case 's': if ($secs < 10) $dates .= '0'.$secs; else $dates .= $secs; break; - // AM/PM - // Note 00:00 to 11:59 is AM, while 12:00 to 23:59 is PM - case 'a': - if ($hour>=12) $dates .= 'pm'; - else $dates .= 'am'; - break; - case 'A': - if ($hour>=12) $dates .= 'PM'; - else $dates .= 'AM'; - break; - default: - $dates .= $fmt[$i]; break; - // ESCAPE - case "\\": - $i++; - if ($i < $max) $dates .= $fmt[$i]; - break; - } - } - return $dates; -} - -/** - Returns a timestamp given a GMT/UTC time. - Note that $is_dst is not implemented and is ignored. -*/ -function adodb_gmmktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false) -{ - return adodb_mktime($hr,$min,$sec,$mon,$day,$year,$is_dst,true); -} - -/** - Return a timestamp given a local time. Originally by jackbbs. - Note that $is_dst is not implemented and is ignored. - - Not a very fast algorithm - O(n) operation. Could be optimized to O(1). -*/ -function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false,$is_gmt=false) -{ - if (!defined('ADODB_TEST_DATES')) { - - if ($mon === false) { - return $is_gmt? @gmmktime($hr,$min,$sec): @mktime($hr,$min,$sec); - } - - // for windows, we don't check 1970 because with timezone differences, - // 1 Jan 1970 could generate negative timestamp, which is illegal - $usephpfns = (1971 < $year && $year < 2038 - || !defined('ADODB_NO_NEGATIVE_TS') && (1901 < $year && $year < 2038) - ); - - - if ($usephpfns && ($year + $mon/12+$day/365.25+$hr/(24*365.25) >= 2038)) $usephpfns = false; - - if ($usephpfns) { - return $is_gmt ? - @gmmktime($hr,$min,$sec,$mon,$day,$year): - @mktime($hr,$min,$sec,$mon,$day,$year); - } - } - - $gmt_different = ($is_gmt) ? 0 : adodb_get_gmt_diff($year,$mon,$day); - - /* - # disabled because some people place large values in $sec. - # however we need it for $mon because we use an array... - $hr = intval($hr); - $min = intval($min); - $sec = intval($sec); - */ - $mon = intval($mon); - $day = intval($day); - $year = intval($year); - - - $year = adodb_year_digit_check($year); - - if ($mon > 12) { - $y = floor(($mon-1)/ 12); - $year += $y; - $mon -= $y*12; - } else if ($mon < 1) { - $y = ceil((1-$mon) / 12); - $year -= $y; - $mon += $y*12; - } - - $_day_power = 86400; - $_hour_power = 3600; - $_min_power = 60; - - $_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31); - $_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31); - - $_total_date = 0; - if ($year >= 1970) { - for ($a = 1970 ; $a <= $year; $a++) { - $leaf = _adodb_is_leap_year($a); - if ($leaf == true) { - $loop_table = $_month_table_leaf; - $_add_date = 366; - } else { - $loop_table = $_month_table_normal; - $_add_date = 365; - } - if ($a < $year) { - $_total_date += $_add_date; - } else { - for($b=1;$b<$mon;$b++) { - $_total_date += $loop_table[$b]; - } - } - } - $_total_date +=$day-1; - $ret = $_total_date * $_day_power + $hr * $_hour_power + $min * $_min_power + $sec + $gmt_different; - - } else { - for ($a = 1969 ; $a >= $year; $a--) { - $leaf = _adodb_is_leap_year($a); - if ($leaf == true) { - $loop_table = $_month_table_leaf; - $_add_date = 366; - } else { - $loop_table = $_month_table_normal; - $_add_date = 365; - } - if ($a > $year) { $_total_date += $_add_date; - } else { - for($b=12;$b>$mon;$b--) { - $_total_date += $loop_table[$b]; - } - } - } - $_total_date += $loop_table[$mon] - $day; - - $_day_time = $hr * $_hour_power + $min * $_min_power + $sec; - $_day_time = $_day_power - $_day_time; - $ret = -( $_total_date * $_day_power + $_day_time - $gmt_different); - if ($ret < -12220185600) $ret += 10*86400; // if earlier than 5 Oct 1582 - gregorian correction - else if ($ret < -12219321600) $ret = -12219321600; // if in limbo, reset to 15 Oct 1582. - } - //print " dmy=$day/$mon/$year $hr:$min:$sec => " .$ret; - return $ret; -} - -function adodb_gmstrftime($fmt, $ts=false) -{ - return adodb_strftime($fmt,$ts,true); -} - -// hack - convert to adodb_date -function adodb_strftime($fmt, $ts=false,$is_gmt=false) -{ -global $ADODB_DATE_LOCALE; - - if (!defined('ADODB_TEST_DATES')) { - if ((abs($ts) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range - if (!defined('ADODB_NO_NEGATIVE_TS') || $ts >= 0) // if windows, must be +ve integer - return ($is_gmt)? @gmstrftime($fmt,$ts): @strftime($fmt,$ts); - - } - } - - if (empty($ADODB_DATE_LOCALE)) { - /* - $tstr = strtoupper(gmstrftime('%c',31366800)); // 30 Dec 1970, 1 am - $sep = substr($tstr,2,1); - $hasAM = strrpos($tstr,'M') !== false; - */ - # see http://phplens.com/lens/lensforum/msgs.php?id=14865 for reasoning, and changelog for version 0.24 - $dstr = gmstrftime('%x',31366800); // 30 Dec 1970, 1 am - $sep = substr($dstr,2,1); - $tstr = strtoupper(gmstrftime('%X',31366800)); // 30 Dec 1970, 1 am - $hasAM = strrpos($tstr,'M') !== false; - - $ADODB_DATE_LOCALE = array(); - $ADODB_DATE_LOCALE[] = strncmp($tstr,'30',2) == 0 ? 'd'.$sep.'m'.$sep.'y' : 'm'.$sep.'d'.$sep.'y'; - $ADODB_DATE_LOCALE[] = ($hasAM) ? 'h:i:s a' : 'H:i:s'; - - } - $inpct = false; - $fmtdate = ''; - for ($i=0,$max = strlen($fmt); $i < $max; $i++) { - $ch = $fmt[$i]; - if ($ch == '%') { - if ($inpct) { - $fmtdate .= '%'; - $inpct = false; - } else - $inpct = true; - } else if ($inpct) { - - $inpct = false; - switch($ch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'E': - case 'O': - /* ignore format modifiers */ - $inpct = true; - break; - - case 'a': $fmtdate .= 'D'; break; - case 'A': $fmtdate .= 'l'; break; - case 'h': - case 'b': $fmtdate .= 'M'; break; - case 'B': $fmtdate .= 'F'; break; - case 'c': $fmtdate .= $ADODB_DATE_LOCALE[0].$ADODB_DATE_LOCALE[1]; break; - case 'C': $fmtdate .= '\C?'; break; // century - case 'd': $fmtdate .= 'd'; break; - case 'D': $fmtdate .= 'm/d/y'; break; - case 'e': $fmtdate .= 'j'; break; - case 'g': $fmtdate .= '\g?'; break; //? - case 'G': $fmtdate .= '\G?'; break; //? - case 'H': $fmtdate .= 'H'; break; - case 'I': $fmtdate .= 'h'; break; - case 'j': $fmtdate .= '?z'; $parsej = true; break; // wrong as j=1-based, z=0-basd - case 'm': $fmtdate .= 'm'; break; - case 'M': $fmtdate .= 'i'; break; - case 'n': $fmtdate .= "\n"; break; - case 'p': $fmtdate .= 'a'; break; - case 'r': $fmtdate .= 'h:i:s a'; break; - case 'R': $fmtdate .= 'H:i:s'; break; - case 'S': $fmtdate .= 's'; break; - case 't': $fmtdate .= "\t"; break; - case 'T': $fmtdate .= 'H:i:s'; break; - case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-based - case 'U': $fmtdate .= '?U'; $parseU = true; break;// wrong strftime=1-based, date=0-based - case 'x': $fmtdate .= $ADODB_DATE_LOCALE[0]; break; - case 'X': $fmtdate .= $ADODB_DATE_LOCALE[1]; break; - case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-based - case 'W': $fmtdate .= '?W'; $parseU = true; break;// wrong strftime=1-based, date=0-based - case 'y': $fmtdate .= 'y'; break; - case 'Y': $fmtdate .= 'Y'; break; - case 'Z': $fmtdate .= 'T'; break; - } - } else if (('A' <= ($ch) && ($ch) <= 'Z' ) || ('a' <= ($ch) && ($ch) <= 'z' )) - $fmtdate .= "\\".$ch; - else - $fmtdate .= $ch; - } - //echo "fmt=",$fmtdate,"
      "; - if ($ts === false) $ts = time(); - $ret = adodb_date($fmtdate, $ts, $is_gmt); - return $ret; -} - -?> \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/additional-methods.min.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/additional-methods.min.js deleted file mode 100644 index 248b984..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/additional-methods.min.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * jQuery Validation Plugin 1.8.1 - * - * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ - * http://docs.jquery.com/Plugins/Validation - * - * Copyright (c) 2006 - 2011 Jörn Zaefferer - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -(function(){function a(b){return b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,"")}jQuery.validator.addMethod("maxWords",function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length=d},jQuery.validator.format("Please enter at least {0} words."));jQuery.validator.addMethod("rangeWords", -function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length>=d[0]&&b.match(/bw+b/g).length9&&a.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number");jQuery.validator.addMethod("phoneUK",function(a,b){return this.optional(b)||a.length>9&&a.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/)},"Please specify a valid phone number"); -jQuery.validator.addMethod("mobileUK",function(a,b){return this.optional(b)||a.length>9&&a.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/)},"Please specify a valid mobile number");jQuery.validator.addMethod("strippedminlength",function(a,b,c){return jQuery(a).text().length>=c},jQuery.validator.format("Please enter at least {0} characters")); -jQuery.validator.addMethod("email2",function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)},jQuery.validator.messages.email); -jQuery.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}, -jQuery.validator.messages.url); -jQuery.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9-]+/.test(a))return false;a=a.replace(/\D/g,"");b=0;if(c.mastercard)b|=1;if(c.visa)b|=2;if(c.amex)b|=4;if(c.dinersclub)b|=8;if(c.enroute)b|=16;if(c.discover)b|=32;if(c.jcb)b|=64;if(c.unknown)b|=128;if(c.all)b=255;if(b&1&&/^(51|52|53|54|55)/.test(a))return a.length==16;if(b&2&&/^(4)/.test(a))return a.length==16;if(b&4&&/^(34|37)/.test(a))return a.length==15;if(b&8&&/^(300|301|302|303|304|305|36|38)/.test(a))return a.length==14;if(b& -16&&/^(2014|2149)/.test(a))return a.length==15;if(b&32&&/^(6011)/.test(a))return a.length==16;if(b&64&&/^(3)/.test(a))return a.length==16;if(b&64&&/^(2131|1800)/.test(a))return a.length==15;if(b&128)return true;return false},"Please enter a valid credit card number."); -jQuery.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(a)},"Please enter a valid IP v4 address."); -jQuery.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."); -jQuery.validator.addMethod("nospecialchars",function(a,b){return this.optional(b)||/^[a-zA-Z0-9\s\_\-]+$/i.test(a)},"No special characters please"); -jQuery.validator.addMethod("rewriteslug",function(a,b){return this.optional(b)||/^[a-zA-Z0-9\_\-\%\/]+$/i.test(a)},"No special characters please"); -jQuery.validator.addMethod("negativeTimestamp",function(a,b){ - var date = new Date(a).getTime(); - return date >= 1; -},"Please enter a date after 1 January 1970"); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/jquery.validate.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/jquery.validate.js deleted file mode 100644 index 132ccb2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/jquery.validate.js +++ /dev/null @@ -1,1161 +0,0 @@ -/** - * jQuery Validation Plugin 1.8.1 - * - * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ - * http://docs.jquery.com/Plugins/Validation - * - * Copyright (c) 2006 - 2011 Jörn Zaefferer - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -(function ($) { - - $.extend($.fn, { - // http://docs.jquery.com/Plugins/Validation/validate - validate: function (options) { - - // if nothing is selected, return nothing; can't chain anyway - if (!this.length) { - options && options.debug && window.console && console.warn("nothing selected, can't validate, returning nothing"); - return; - } - - // check if a validator for this form was already created - var validator = $.data(this[0], 'validator'); - if (validator) { - return validator; - } - - validator = new $.validator(options, this[0]); - $.data(this[0], 'validator', validator); - - if (validator.settings.onsubmit) { - - // allow suppresing validation by adding a cancel class to the submit button - this.find("input, button").filter(".cancel").click(function () { - validator.cancelSubmit = true; - }); - - // when a submitHandler is used, capture the submitting button - if (validator.settings.submitHandler) { - this.find("input, button").filter(":submit").click(function () { - validator.submitButton = this; - }); - } - - // validate the form on submit - this.submit(function (event) { - if (validator.settings.debug) - // prevent form submit to be able to see console output - event.preventDefault(); - - function handle() { - if (validator.settings.submitHandler) { - if (validator.submitButton) { - // insert a hidden input as a replacement for the missing submit button - var hidden = $("").attr("name", validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm); - } - validator.settings.submitHandler.call(validator, validator.currentForm); - if (validator.submitButton) { - // and clean up afterwards; thanks to no-block-scope, hidden can be referenced - hidden.remove(); - } - return false; - } - return true; - } - - // prevent submit for invalid forms or custom submit handlers - if (validator.cancelSubmit) { - validator.cancelSubmit = false; - return handle(); - } - if (validator.form()) { - if (validator.pendingRequest) { - validator.formSubmitted = true; - return false; - } - return handle(); - } else { - validator.focusInvalid(); - return false; - } - }); - } - - return validator; - }, - // http://docs.jquery.com/Plugins/Validation/valid - valid: function () { - if ($(this[0]).is('form')) { - return this.validate().form(); - } else { - var valid = true; - var validator = $(this[0].form).validate(); - this.each(function () { - valid &= validator.element(this); - }); - return valid; - } - }, - // attributes: space seperated list of attributes to retrieve and remove - removeAttrs: function (attributes) { - var result = {}, - $element = this; - $.each(attributes.split(/\s/), function (index, value) { - result[value] = $element.attr(value); - $element.removeAttr(value); - }); - return result; - }, - // http://docs.jquery.com/Plugins/Validation/rules - rules: function (command, argument) { - var element = this[0]; - - if (command) { - if( ! element.form || ! $.data(element.form, 'validator') ) { - // no validator for the form - return; - } - var settings = $.data(element.form, 'validator').settings; - var staticRules = settings.rules; - var existingRules = $.validator.staticRules(element); - switch (command) { - case "add": - $.extend(existingRules, $.validator.normalizeRule(argument)); - staticRules[element.name] = existingRules; - if (argument.messages) - settings.messages[element.name] = $.extend(settings.messages[element.name], argument.messages); - break; - case "remove": - if (!argument) { - delete staticRules[element.name]; - return existingRules; - } - var filtered = {}; - $.each(argument.split(/\s/), function (index, method) { - filtered[method] = existingRules[method]; - delete existingRules[method]; - }); - return filtered; - } - } - - var data = $.validator.normalizeRules( - $.extend( - {}, - $.validator.metadataRules(element), - $.validator.classRules(element), - $.validator.attributeRules(element), - $.validator.staticRules(element) - ), element); - - // make sure required is at front - if (data.required) { - var param = data.required; - delete data.required; - data = $.extend({required: param}, data); - } - - return data; - } - }); - -// Custom selectors - $.extend($.expr[":"], { - // http://docs.jquery.com/Plugins/Validation/blank - blank: function (a) { - return !$.trim("" + a.value); - }, - // http://docs.jquery.com/Plugins/Validation/filled - filled: function (a) { - return !!$.trim("" + a.value); - }, - // http://docs.jquery.com/Plugins/Validation/unchecked - unchecked: function (a) { - return !a.checked; - } - }); - var _form_submitted = false; - var total_errors = 0; - var error_list = ''; -// constructor for validator - $.validator = function (options, form) { - this.settings = $.extend(true, {}, $.validator.defaults, options); - this.currentForm = form; - this.init(); - }; - - $.validator.format = function (source, params) { - if (arguments.length == 1) - return function () { - var args = $.makeArray(arguments); - args.unshift(source); - return $.validator.format.apply(this, args); - }; - if (arguments.length > 2 && params.constructor != Array) { - params = $.makeArray(arguments).slice(1); - } - if (params.constructor != Array) { - params = [params]; - } - $.each(params, function (i, n) { - source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); - }); - return source; - }; - - $.extend($.validator, { - defaults: { - messages: {}, - groups: {}, - rules: {}, - errorClass: "error", - validClass: "valid", - errorElement: "label", - focusInvalid: true, - errorContainer: $([]), - errorLabelContainer: $([]), - onsubmit: true, - ignore: [], - ignoreTitle: false, - onfocusin: function (element) { - this.lastActive = element; - - // hide error label and remove error class on focus if enabled - if (this.settings.focusCleanup && !this.blockFocusCleanup) { - this.settings.unhighlight && this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass); - this.addWrapper(this.errorsFor(element)).hide(); - } - }, - onfocusout: function (element) { - if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) { - this.element(element); - } - }, - onkeyup: function (element) { - if (element.name in this.submitted || element == this.lastElement) { - this.element(element); - } - }, - onclick: function (element) { - // click on selects, radiobuttons and checkboxes - if (element.name in this.submitted) - this.element(element); - // or option elements, check parent select in that case - else if (element.parentNode.name in this.submitted) - this.element(element.parentNode); - }, - highlight: function (element, errorClass, validClass) { - if (element.type === 'radio') { - this.findByName(element.name).addClass(errorClass).removeClass(validClass); - } else { - $(element).addClass(errorClass).removeClass(validClass); - } - }, - unhighlight: function (element, errorClass, validClass) { - if (element.type === 'radio') { - this.findByName(element.name).removeClass(errorClass).addClass(validClass); - } else { - $(element).removeClass(errorClass).addClass(validClass); - } - } - }, - // http://docs.jquery.com/Plugins/Validation/Validator/setDefaults - setDefaults: function (settings) { - $.extend($.validator.defaults, settings); - }, - messages: { - required: "This field is required.", - remote: "Please fix this field.", - email: "Please enter a valid email address.", - url: "Please enter a valid URL.", - date: "Please enter a valid date.", - dateISO: "Please enter a valid date (ISO).", - number: "Please enter a valid number.", - digits: "Please enter only digits.", - creditcard: "Please enter a valid credit card number.", - equalTo: "Please enter the same value again.", - accept: "Please enter a value with a valid extension.", - maxlength: $.validator.format("Please enter no more than {0} characters."), - minlength: $.validator.format("Please enter at least {0} characters."), - rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."), - range: $.validator.format("Please enter a value between {0} and {1}."), - max: $.validator.format("Please enter a value less than or equal to {0}."), - min: $.validator.format("Please enter a value greater than or equal to {0}.") - }, - autoCreateRanges: false, - prototype: { - init: function () { - this.labelContainer = $(this.settings.errorLabelContainer); - this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm); - this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer); - this.submitted = {}; - this.valueCache = {}; - this.pendingRequest = 0; - this.pending = {}; - this.invalid = {}; - this.reset(); - - var groups = (this.groups = {}); - $.each(this.settings.groups, function (key, value) { - $.each(value.split(/\s/), function (index, name) { - groups[name] = key; - }); - }); - var rules = this.settings.rules; - $.each(rules, function (key, value) { - rules[key] = $.validator.normalizeRule(value); - }); - - function delegate(event) { - var validator = $.data(this[0].form, "validator"), - eventType = "on" + event.type.replace(/^validate/, ""); - validator.settings[eventType] && validator.settings[eventType].call(validator, this[0]); - } - $(this.currentForm) - .validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", delegate) - .validateDelegate(":radio, :checkbox, select, option", "click", delegate); - - if (this.settings.invalidHandler) - $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler); - - $(this.currentForm).submit(function () { - _form_submitted = true; - }); - }, - // http://docs.jquery.com/Plugins/Validation/Validator/form - form: function () { - this.checkForm(); - $.extend(this.submitted, this.errorMap); - this.invalid = $.extend({}, this.errorMap); - if (!this.valid()) - $(this.currentForm).triggerHandler("invalid-form", [this]); - this.showErrors(); - return this.valid(); - }, - checkForm: function () { - this.prepareForm(); - for (var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++) { - this.check(elements[i]); - } - return this.valid(); - }, - // http://docs.jquery.com/Plugins/Validation/Validator/element - element: function (element) { - element = this.clean(element); - this.lastElement = element; - this.prepareElement(element); - this.currentElements = $(element); - var result = this.check(element); - if (result) { - delete this.invalid[element.name]; - } else { - this.invalid[element.name] = true; - } - if (!this.numberOfInvalids()) { - // Hide error containers on last error - this.toHide = this.toHide.add(this.containers); - } - this.showErrors(); - return result; - }, - // http://docs.jquery.com/Plugins/Validation/Validator/showErrors - showErrors: function (errors) { - if (errors) { - // add items to error list and map - $.extend(this.errorMap, errors); - this.errorList = []; - for (var name in errors) { - this.errorList.push({ - message: errors[name], - element: this.findByName(name)[0] - }); - } - // remove items from success list - this.successList = $.grep(this.successList, function (element) { - return !(element.name in errors); - }); - } - this.settings.showErrors - ? this.settings.showErrors.call(this, this.errorMap, this.errorList) - : this.defaultShowErrors(); - - message = $('.wpt-form-error').data('message-single'); - - if (typeof message !== 'undefined') { - - $('.wpt-form-error').each(function () { - var $this = $(this); - formId = $this.closest("form").find('input[name=_cred_cred_prefix_form_id]').val(); - var $wpt_form_message = $('#wpt-form-message-' + formId); - - if ( $this.css('display') == 'block' - && $this.attr('id') !== 'wpt-form-message-' + formId - && $this.attr('id') !== 'lbl_generic' ) - { - total_errors += 1; - } - - var message = ""; - if (total_errors > 0) { - - if (total_errors > 1) { - message = $(this).closest("form").find('.wpt-form-error').data('message-plural'); - } else { - message = $(this).closest("form").find('.wpt-form-error').data('message-single'); - } - message = message.replace('%NN', total_errors); - - if (_form_submitted) { - $wpt_form_message.html(message); - $wpt_form_message.show(); - } - } else { - $this.hide(); - $wpt_form_message.html(''); - if (_form_submitted) { - $wpt_form_message.hide(); - } - } - }); - } - _form_submitted = false; - total_errors = 0; - error_list = ''; - }, - // http://docs.jquery.com/Plugins/Validation/Validator/resetForm - resetForm: function () { - if ($.fn.resetForm) - $(this.currentForm).resetForm(); - this.submitted = {}; - this.prepareForm(); - this.hideErrors(); - this.elements().removeClass(this.settings.errorClass); - _form_submitted = false; - }, - numberOfInvalids: function () { - return this.objectLength(this.invalid); - }, - objectLength: function (obj) { - var count = 0; - for (var i in obj) - count++; - return count; - }, - hideErrors: function () { - this.addWrapper(this.toHide).hide(); - }, - valid: function () { - return this.size() == 0; - }, - size: function () { - return this.errorList.length; - }, - focusInvalid: function () { - if (this.settings.focusInvalid) { - try { - $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []) - .filter(":visible") - .focus() - // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find - .trigger("focusin"); - } catch (e) { - // ignore IE throwing errors when focusing hidden elements - } - } - }, - findLastActive: function () { - var lastActive = this.lastActive; - return lastActive && $.grep(this.errorList, function (n) { - return n.element.name == lastActive.name; - }).length == 1 && lastActive; - }, - elements: function () { - var validator = this, - rulesCache = {}; - - // select all valid inputs inside the form (no submit or reset buttons) - return $(this.currentForm) - .find("input, select, textarea") - .not(":submit, :reset, :image, [disabled]") - .not(this.settings.ignore) - .filter(function () { - !this.name && validator.settings.debug && window.console && console.error("%o has no name assigned", this); - - // select only the first element for each name, and only those with rules specified - if (this.name in rulesCache || !validator.objectLength($(this).rules())) - return false; - - rulesCache[this.name] = true; - return true; - }); - }, - clean: function (selector) { - return $(selector)[0]; - }, - errors: function () { - return $(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext); - }, - reset: function () { - this.successList = []; - this.errorList = []; - this.errorMap = {}; - this.toShow = $([]); - this.toHide = $([]); - this.currentElements = $([]); - }, - prepareForm: function () { - this.reset(); - this.toHide = this.errors().add(this.containers); - }, - prepareElement: function (element) { - this.reset(); - this.toHide = this.errorsFor(element); - }, - check: function (element) { - element = this.clean(element); - - // if radio/checkbox, validate first element in group instead - if (this.checkable(element)) { - element = this.findByName(element.name).not(this.settings.ignore)[0]; - } - - var rules = $(element).rules(); - var dependencyMismatch = false; - for (var method in rules) { - var rule = {method: method, parameters: rules[method]}; - try { - var result = $.validator.methods[method].call(this, element.value.replace(/\r/g, ""), element, rule.parameters); - - // if a method indicates that the field is optional and therefore valid, - // don't mark it as valid when there are no other rules - if (result == "dependency-mismatch") { - dependencyMismatch = true; - continue; - } - dependencyMismatch = false; - - if (result == "pending") { - this.toHide = this.toHide.not(this.errorsFor(element)); - return; - } - - if (!result) { - this.formatAndAdd(element, rule); - return false; - } - } catch (e) { - this.settings.debug && window.console && console.log("exception occured when checking element " + element.id - + ", check the '" + rule.method + "' method", e); - throw e; - } - } - if (dependencyMismatch) - return; - if (this.objectLength(rules)) - this.successList.push(element); - return true; - }, - // return the custom message for the given element and validation method - // specified in the element's "messages" metadata - customMetaMessage: function (element, method) { - if (!$.metadata) - return; - - var meta = this.settings.meta - ? $(element).metadata()[this.settings.meta] - : $(element).metadata(); - - return meta && meta.messages && meta.messages[method]; - }, - // return the custom message for the given element name and validation method - customMessage: function (name, method) { - var m = this.settings.messages[name]; - return m && (m.constructor == String - ? m - : m[method]); - }, - // return the first defined argument, allowing empty strings - findDefined: function () { - for (var i = 0; i < arguments.length; i++) { - if (arguments[i] !== undefined) - return arguments[i]; - } - return undefined; - }, - defaultMessage: function (element, method) { - return this.findDefined( - this.customMessage(element.name, method), - this.customMetaMessage(element, method), - // title is never undefined, so handle empty string as undefined - !this.settings.ignoreTitle && element.title || undefined, - $.validator.messages[method], - "Warning: No message defined for " + element.name + "" - ); - }, - formatAndAdd: function (element, rule) { - var message = this.defaultMessage(element, rule.method), - theregex = /\$?\{(\d+)\}/g; - if (typeof message == "function") { - message = message.call(this, rule.parameters, element); - } else if (theregex.test(message)) { - message = jQuery.format(message.replace(theregex, '{$1}'), rule.parameters); - } - this.errorList.push({ - message: message, - element: element - }); - - this.errorMap[element.name] = message; - this.submitted[element.name] = message; - }, - addWrapper: function (toToggle) { - if (this.settings.wrapper) - toToggle = toToggle.add(toToggle.parent(this.settings.wrapper)); - return toToggle; - }, - defaultShowErrors: function () { - for (var i = 0; this.errorList[i]; i++) { - var error = this.errorList[i]; - this.settings.highlight && this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass); - this.showLabel(error.element, error.message); - } - if (this.errorList.length) { - this.toShow = this.toShow.add(this.containers); - } - if (this.settings.success) { - for (var i = 0; this.successList[i]; i++) { - this.showLabel(this.successList[i]); - } - } - if (this.settings.unhighlight) { - for (var i = 0, elements = this.validElements(); elements[i]; i++) { - this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass); - } - } - this.toHide = this.toHide.not(this.toShow); - this.hideErrors(); - this.addWrapper(this.toShow).show(); - }, - validElements: function () { - return this.currentElements.not(this.invalidElements()); - }, - invalidElements: function () { - return $(this.errorList).map(function () { - return this.element; - }); - }, - showLabel: function (element, message) { - var label = this.errorsFor(element); - if (label.length) { - // refresh error/success class - label.removeClass().addClass(this.settings.errorClass); - - // check if we have a generated label, replace the message then - label.attr("generated") && label.html(message); - } else { - // create label - label = $("<" + this.settings.errorElement + "/>") - .attr({"for": this.idOrName(element), generated: true}) - .addClass(this.settings.errorClass) - .html(message || ""); - if (this.settings.wrapper) { - // make sure the element is visible, even in IE - // actually showing the wrapped element is handled elsewhere - label = label.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); - } - if (!this.labelContainer.append(label).length) { - if ('date' == $(element).data('wpt-type')) { - element = $('input[type=text]', $(element).parent()); - } - this.settings.errorPlacement - ? this.settings.errorPlacement(label, $(element)) - : label.insertAfter(element); - } - } - if (!message && this.settings.success) { - label.text(""); - typeof this.settings.success == "string" - ? label.addClass(this.settings.success) - : this.settings.success(label); - } - this.toShow = this.toShow.add(label); - }, - errorsFor: function (element) { - var name = this.idOrName(element); - return this.errors().filter(function () { - return $(this).attr('for') == name; - }); - }, - idOrName: function (element) { - return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); - }, - checkable: function (element) { - return /radio|checkbox/i.test(element.type); - }, - findByName: function (name) { - // select by name and filter by form for performance over form.find("[name=...]") - var form = this.currentForm; - return $(document.getElementsByName(name)).map(function (index, element) { - return element.form == form && element.name == name && element || null; - }); - }, - getLength: function (value, element) { - switch (element.nodeName.toLowerCase()) { - case 'select': - return $("option:selected", element).length; - case 'input': - if (this.checkable(element)) - return this.findByName(element.name).filter(':checked').length; - } - return value.length; - }, - depend: function (param, element) { - return this.dependTypes[typeof param] - ? this.dependTypes[typeof param](param, element) - : true; - }, - dependTypes: { - "boolean": function (param, element) { - return param; - }, - "string": function (param, element) { - return !!$(param, element.form).length; - }, - "function": function (param, element) { - return param(element); - } - }, - optional: function (element) { - return !$.validator.methods.required.call(this, $.trim(element.value), element) && "dependency-mismatch"; - }, - startRequest: function (element) { - if (!this.pending[element.name]) { - this.pendingRequest++; - this.pending[element.name] = true; - } - }, - stopRequest: function (element, valid) { - this.pendingRequest--; - // sometimes synchronization fails, make sure pendingRequest is never < 0 - if (this.pendingRequest < 0) - this.pendingRequest = 0; - delete this.pending[element.name]; - if (valid && this.pendingRequest == 0 && this.formSubmitted && this.form()) { - $(this.currentForm).submit(); - this.formSubmitted = false; - } else if (!valid && this.pendingRequest == 0 && this.formSubmitted) { - $(this.currentForm).triggerHandler("invalid-form", [this]); - this.formSubmitted = false; - } - }, - previousValue: function (element) { - return $.data(element, "previousValue") || $.data(element, "previousValue", { - old: null, - valid: true, - message: this.defaultMessage(element, "remote") - }); - } - - }, - classRuleSettings: { - required: {required: true}, - email: {email: true}, - url: {url: true}, - date: {date: true}, - dateISO: {dateISO: true}, - dateDE: {dateDE: true}, - number: {number: true}, - numberDE: {numberDE: true}, - digits: {digits: true}, - creditcard: {creditcard: true} - }, - addClassRules: function (className, rules) { - className.constructor == String ? - this.classRuleSettings[className] = rules : - $.extend(this.classRuleSettings, className); - }, - classRules: function (element) { - var rules = {}; - var classes = $(element).attr('class'); - classes && $.each(classes.split(' '), function () { - if (this in $.validator.classRuleSettings) { - $.extend(rules, $.validator.classRuleSettings[this]); - } - }); - return rules; - }, - attributeRules: function (element) { - var rules = {}; - var $element = $(element); - - for (var method in $.validator.methods) { - var value = $element.attr(method); - if (value) { - rules[method] = value; - } - } - - // maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs - if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { - delete rules.maxlength; - } - - return rules; - }, - metadataRules: function (element) { - if (!$.metadata) - return {}; - - var meta = $.data(element.form, 'validator').settings.meta; - return meta ? - $(element).metadata()[meta] : - $(element).metadata(); - }, - staticRules: function (element) { - var rules = {}; - var validator = $.data(element.form, 'validator'); - if (validator.settings.rules) { - rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}; - } - return rules; - }, - normalizeRules: function (rules, element) { - // handle dependency check - $.each(rules, function (prop, val) { - // ignore rule when param is explicitly false, eg. required:false - if (val === false) { - delete rules[prop]; - return; - } - if (val.param || val.depends) { - var keepRule = true; - switch (typeof val.depends) { - case "string": - keepRule = !!$(val.depends, element.form).length; - break; - case "function": - keepRule = val.depends.call(element, element); - break; - } - if (keepRule) { - rules[prop] = val.param !== undefined ? val.param : true; - } else { - delete rules[prop]; - } - } - }); - - // evaluate parameters - $.each(rules, function (rule, parameter) { - rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter; - }); - - // clean number parameters - $.each(['minlength', 'maxlength', 'min', 'max'], function () { - if (rules[this]) { - rules[this] = Number(rules[this]); - } - }); - $.each(['rangelength', 'range'], function () { - if (rules[this]) { - rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; - } - }); - - if ($.validator.autoCreateRanges) { - // auto-create ranges - if (rules.min && rules.max) { - rules.range = [rules.min, rules.max]; - delete rules.min; - delete rules.max; - } - if (rules.minlength && rules.maxlength) { - rules.rangelength = [rules.minlength, rules.maxlength]; - delete rules.minlength; - delete rules.maxlength; - } - } - - // To support custom messages in metadata ignore rule methods titled "messages" - if (rules.messages) { - delete rules.messages; - } - - return rules; - }, - // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} - normalizeRule: function (data) { - if (typeof data == "string") { - var transformed = {}; - $.each(data.split(/\s/), function () { - transformed[this] = true; - }); - data = transformed; - } - return data; - }, - // http://docs.jquery.com/Plugins/Validation/Validator/addMethod - addMethod: function (name, method, message) { - $.validator.methods[name] = method; - $.validator.messages[name] = message != undefined ? message : $.validator.messages[name]; - if (method.length < 3) { - $.validator.addClassRules(name, $.validator.normalizeRule(name)); - } - }, - methods: { - // http://docs.jquery.com/Plugins/Validation/Methods/required - required: function (value, element, param) { - // check if dependency is met - if (!this.depend(param, element)) - return "dependency-mismatch"; - switch (element.nodeName.toLowerCase()) { - case 'select': - // could be an array for select-multiple or a string, both are fine this way - var val = $(element).val(); - return val && val.length > 0; - case 'input': - if (this.checkable(element)) - return this.getLength(value, element) > 0; - default: - return $.trim(value).length > 0; - } - }, - // http://docs.jquery.com/Plugins/Validation/Methods/remote - remote: function (value, element, param) { - if (this.optional(element)) - return "dependency-mismatch"; - - var previous = this.previousValue(element); - if (!this.settings.messages[element.name]) - this.settings.messages[element.name] = {}; - previous.originalMessage = this.settings.messages[element.name].remote; - this.settings.messages[element.name].remote = previous.message; - - param = typeof param == "string" && {url: param} || param; - - if (this.pending[element.name]) { - return "pending"; - } - if (previous.old === value) { - return previous.valid; - } - - previous.old = value; - var validator = this; - this.startRequest(element); - var data = {}; - data[element.name] = value; - $.ajax($.extend(true, { - url: param, - mode: "abort", - port: "validate" + element.name, - dataType: "json", - data: data, - success: function (response) { - validator.settings.messages[element.name].remote = previous.originalMessage; - var valid = response === true; - if (valid) { - var submitted = validator.formSubmitted; - validator.prepareElement(element); - validator.formSubmitted = submitted; - validator.successList.push(element); - validator.showErrors(); - } else { - var errors = {}; - var message = response || validator.defaultMessage(element, "remote"); - errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message; - validator.showErrors(errors); - } - previous.valid = valid; - validator.stopRequest(element, valid); - } - }, param)); - return "pending"; - }, - // http://docs.jquery.com/Plugins/Validation/Methods/minlength - minlength: function (value, element, param) { - return this.optional(element) || this.getLength($.trim(value), element) >= param; - }, - // http://docs.jquery.com/Plugins/Validation/Methods/maxlength - maxlength: function (value, element, param) { - return this.optional(element) || this.getLength($.trim(value), element) <= param; - }, - // http://docs.jquery.com/Plugins/Validation/Methods/rangelength - rangelength: function (value, element, param) { - var length = this.getLength($.trim(value), element); - return this.optional(element) || (length >= param[0] && length <= param[1]); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/min - min: function (value, element, param) { - return this.optional(element) || value >= param; - }, - // http://docs.jquery.com/Plugins/Validation/Methods/max - max: function (value, element, param) { - return this.optional(element) || value <= param; - }, - // http://docs.jquery.com/Plugins/Validation/Methods/range - range: function (value, element, param) { - return this.optional(element) || (value >= param[0] && value <= param[1]); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/email - email: function (value, element) { - // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ - return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/url - url: function (value, element) { - // contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/ - return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/date - date: function (value, element) { - return this.optional(element) || !/Invalid|NaN/.test(new Date(value)); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/dateISO - dateISO: function (value, element) { - return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/number - number: function (value, element) { - return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/digits - digits: function (value, element) { - return this.optional(element) || /^\d+$/.test(value); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/creditcard - // based on http://en.wikipedia.org/wiki/Luhn - creditcard: function (value, element) { - if (this.optional(element)) - return "dependency-mismatch"; - // accept only digits and dashes - if (/[^0-9-]+/.test(value)) - return false; - var nCheck = 0, - nDigit = 0, - bEven = false; - - value = value.replace(/\D/g, ""); - - for (var n = value.length - 1; n >= 0; n--) { - var cDigit = value.charAt(n); - var nDigit = parseInt(cDigit, 10); - if (bEven) { - if ((nDigit *= 2) > 9) - nDigit -= 9; - } - nCheck += nDigit; - bEven = !bEven; - } - - return (nCheck % 10) == 0; - }, - // http://docs.jquery.com/Plugins/Validation/Methods/accept - accept: function (value, element, param) { - param = typeof param == "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif"; - return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i")); - }, - // http://docs.jquery.com/Plugins/Validation/Methods/equalTo - equalTo: function (value, element, param) { - // bind to the blur event of the target in order to revalidate whenever the target field is updated - // TODO find a way to bind the event just once, avoiding the unbind-rebind overhead - var target = $(param).unbind(".validate-equalTo").bind("blur.validate-equalTo", function () { - $(element).valid(); - }); - return value == target.val(); - } - - } - - }); - -// deprecated, use $.validator.format instead - $.format = $.validator.format; - -})(jQuery); - -// ajax mode: abort -// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); -// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() -; -(function ($) { - var pendingRequests = {}; - // Use a prefilter if available (1.5+) - if ($.ajaxPrefilter) { - $.ajaxPrefilter(function (settings, _, xhr) { - var port = settings.port; - if (settings.mode == "abort") { - if (pendingRequests[port]) { - pendingRequests[port].abort(); - } - pendingRequests[port] = xhr; - } - }); - } else { - // Proxy ajax - var ajax = $.ajax; - $.ajax = function (settings) { - var mode = ("mode" in settings ? settings : $.ajaxSettings).mode, - port = ("port" in settings ? settings : $.ajaxSettings).port; - if (mode == "abort") { - if (pendingRequests[port]) { - pendingRequests[port].abort(); - } - return (pendingRequests[port] = ajax.apply(this, arguments)); - } - return ajax.apply(this, arguments); - }; - } -})(jQuery); - -// provides cross-browser focusin and focusout events -// IE has native support, in other browsers, use event caputuring (neither bubbles) - -// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation -// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target -; -(function ($) { - // only implement if not provided by jQuery core (since 1.4) - // TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs - if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) { - $.each({ - focus: 'focusin', - blur: 'focusout' - }, function (original, fix) { - $.event.special[fix] = { - setup: function () { - this.addEventListener(original, handler, true); - }, - teardown: function () { - this.removeEventListener(original, handler, true); - }, - handler: function (e) { - arguments[0] = $.event.fix(e); - arguments[0].type = fix; - return $.event.handle.apply(this, arguments); - } - }; - function handler(e) { - e = $.event.fix(e); - e.type = fix; - return $.event.handle.call(this, e); - } - }); - } - ; - $.extend($.fn, { - validateDelegate: function (delegate, type, handler) { - return this.bind(type, function (event) { - var target = $(event.target); - if (target.is(delegate)) { - return handler.apply(target, arguments); - } - }); - } - }); -})(jQuery); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/jquery.validate.min.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/jquery.validate.min.js deleted file mode 100644 index 882c699..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/jquery.validate.min.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * jQuery Validation Plugin 1.8.1 - * - * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ - * http://docs.jquery.com/Plugins/Validation - * - * Copyright (c) 2006 - 2011 Jörn Zaefferer - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -(function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("").attr("name", -b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form(); -else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name]; -return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a, -b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error", -validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)}, -onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).addClass(b).removeClass(d):c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).removeClass(b).addClass(d):c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults, -a)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."), -minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator");e="on"+e.type.replace(/^validate/, -"");f.settings[e]&&f.settings[e].call(f,this[0])}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d=this.settings.rules; -c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",a).validateDelegate(":radio, :checkbox, select, option","click",a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form", -[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(a){this.lastElement=a=this.clean(a);this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap, -a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)}, -objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name== -a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass, -this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.clean(a);if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g= -c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d= -this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;aWarning: No message defined for "+ -a.name+"")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]=d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a]; -this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow); -this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass().addClass(this.settings.errorClass);d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b|| -"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow=this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})}, -idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d,e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length}, -depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this,c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest< -0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true}, -email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings,a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b= -{};a=c(a);for(var d in c.validator.methods){var e=a.attr(d);if(e)b[d]=e}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e=== -false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined?e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&& -a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))}, -methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote= -e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d,mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]= -e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)|| -a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)}, -url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}, -date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>= -0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery); -(function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery); -(function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a, -b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ar.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ar.js deleted file mode 100644 index 71e97a8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ar.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin into arabic. - * Locale: AR - */ -jQuery.extend(jQuery.validator.messages, { - required: "هذا الحقل إلزامي", - remote: "يرجى تصحيح هذا الحقل للمتابعة", - email: "رجاء إدخال عنوان بريد إلكتروني صحيح", - url: "رجاء إدخال عنوان موقع إلكتروني صحيح", - date: "رجاء إدخال تاريخ صحيح", - dateISO: "رجاء إدخال تاريخ صحيح (ISO)", - number: "رجاء إدخال عدد بطريقة صحيحة", - digits: "رجاء إدخال أرقام فقط", - creditcard: "رجاء إدخال رقم بطاقة ائتمان صحيح", - equalTo: "رجاء إدخال نفس القيمة", - accept: "رجاء إدخال ملف بامتداد موافق عليه", - maxlength: jQuery.validator.format("الحد الأقصى لعدد الحروف هو {0}"), - minlength: jQuery.validator.format("الحد الأدنى لعدد الحروف هو {0}"), - rangelength: jQuery.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"), - range: jQuery.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"), - max: jQuery.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"), - min: jQuery.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}") -}); - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_bg.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_bg.js deleted file mode 100644 index 9232f72..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_bg.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: BG - */ -jQuery.extend(jQuery.validator.messages, { - required: "Полето е задължително.", - remote: "Моля, въведете правилната стойност.", - email: "Моля, въведете валиден email.", - url: "Моля, въведете валидно URL.", - date: "Моля, въведете валидна дата.", - dateISO: "Моля, въведете валидна дата (ISO).", - number: "Моля, въведете валиден номер.", - digits: "Моля, въведете само цифри", - creditcard: "Моля, въведете валиден номер на кредитна карта.", - equalTo: "Моля, въведете същата стойност отново.", - accept: "Моля, въведете стойност с валидно разширение.", - maxlength: $.validator.format("Моля, въведете повече от {0} символа."), - minlength: $.validator.format("Моля, въведете поне {0} символа."), - rangelength: $.validator.format("Моля, въведете стойност с дължина между {0} и {1} символа."), - range: $.validator.format("Моля, въведете стойност между {0} и {1}."), - max: $.validator.format("Моля, въведете стойност по-малка или равна на {0}."), - min: $.validator.format("Моля, въведете стойност по-голяма или равна на {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ca.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ca.js deleted file mode 100644 index f823534..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ca.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: CA - */ -jQuery.extend(jQuery.validator.messages, { - required: "Aquest camp és obligatori.", - remote: "Si us plau, omple aquest camp.", - email: "Si us plau, escriu una adreça de correu-e vàlida", - url: "Si us plau, escriu una URL vàlida.", - date: "Si us plau, escriu una data vàlida.", - dateISO: "Si us plau, escriu una data (ISO) vàlida.", - number: "Si us plau, escriu un número enter vàlid.", - digits: "Si us plau, escriu només dígits.", - creditcard: "Si us plau, escriu un número de tarjeta vàlid.", - equalTo: "Si us plau, escriu el maateix valor de nou.", - accept: "Si us plau, escriu un valor amb una extensió acceptada.", - maxlength: jQuery.validator.format("Si us plau, no escriguis més de {0} caracters."), - minlength: jQuery.validator.format("Si us plau, no escriguis menys de {0} caracters."), - rangelength: jQuery.validator.format("Si us plau, escriu un valor entre {0} i {1} caracters."), - range: jQuery.validator.format("Si us plau, escriu un valor entre {0} i {1}."), - max: jQuery.validator.format("Si us plau, escriu un valor menor o igual a {0}."), - min: jQuery.validator.format("Si us plau, escriu un valor major o igual a {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_cn.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_cn.js deleted file mode 100644 index 8415f4a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_cn.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: CN - */ -jQuery.extend(jQuery.validator.messages, { - required: "必选字段", - remote: "请修正该字段", - email: "请输入正确格式的电子邮件", - url: "请输入合法的网址", - date: "请输入合法的日期", - dateISO: "请输入合法的日期 (ISO).", - number: "请输入合法的数字", - digits: "只能输入整数", - creditcard: "请输入合法的信用卡号", - equalTo: "请再次输入相同的值", - accept: "请输入拥有合法后缀名的字符串", - maxlength: jQuery.validator.format("请输入一个长度最多是 {0} 的字符串"), - minlength: jQuery.validator.format("请输入一个长度最少是 {0} 的字符串"), - rangelength: jQuery.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"), - range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), - max: jQuery.validator.format("请输入一个最大为 {0} 的值"), - min: jQuery.validator.format("请输入一个最小为 {0} 的值") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_cs.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_cs.js deleted file mode 100644 index ab99819..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_cs.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: CS - */ -jQuery.extend(jQuery.validator.messages, { - required: "Tento údaj je povinný.", - remote: "Prosím, opravte tento údaj.", - email: "Prosím, zadejte platný e-mail.", - url: "Prosím, zadejte platné URL.", - date: "Prosím, zadejte platné datum.", - dateISO: "Prosím, zadejte platné datum (ISO).", - number: "Prosím, zadejte číslo.", - digits: "Prosím, zadávejte pouze číslice.", - creditcard: "Prosím, zadejte číslo kreditní karty.", - equalTo: "Prosím, zadejte znovu stejnou hodnotu.", - accept: "Prosím, zadejte soubor se správnou příponou.", - maxlength: jQuery.validator.format("Prosím, zadejte nejvíce {0} znaků."), - minlength: jQuery.validator.format("Prosím, zadejte nejméně {0} znaků."), - rangelength: jQuery.validator.format("Prosím, zadejte od {0} do {1} znaků."), - range: jQuery.validator.format("Prosím, zadejte hodnotu od {0} do {1}."), - max: jQuery.validator.format("Prosím, zadejte hodnotu menší nebo rovnu {0}."), - min: jQuery.validator.format("Prosím, zadejte hodnotu větší nebo rovnu {0}.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_da.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_da.js deleted file mode 100644 index 1f729e0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_da.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: DA - */ -jQuery.extend(jQuery.validator.messages, { - required: "Dette felt er påkrævet.", - maxlength: jQuery.validator.format("Indtast højst {0} tegn."), - minlength: jQuery.validator.format("Indtast mindst {0} tegn."), - rangelength: jQuery.validator.format("Indtast mindst {0} og højst {1} tegn."), - email: "Indtast en gyldig email-adresse.", - url: "Indtast en gyldig URL.", - date: "Indtast en gyldig dato.", - number: "Indtast et tal.", - digits: "Indtast kun cifre.", - equalTo: "Indtast den samme værdi igen.", - range: jQuery.validator.format("Angiv en værdi mellem {0} og {1}."), - max: jQuery.validator.format("Angiv en værdi der højst er {0}."), - min: jQuery.validator.format("Angiv en værdi der mindst er {0}."), - creditcard: "Indtast et gyldigt kreditkortnummer." -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_de.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_de.js deleted file mode 100644 index 0c03e30..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_de.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: DE - */ -jQuery.extend(jQuery.validator.messages, { - required: "Dieses Feld ist ein Pflichtfeld.", - maxlength: jQuery.validator.format("Geben Sie bitte maximal {0} Zeichen ein."), - minlength: jQuery.validator.format("Geben Sie bitte mindestens {0} Zeichen ein."), - rangelength: jQuery.validator.format("Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein."), - email: "Geben Sie bitte eine gültige E-Mail Adresse ein.", - url: "Geben Sie bitte eine gültige URL ein.", - date: "Bitte geben Sie ein gültiges Datum ein.", - number: "Geben Sie bitte eine Nummer ein.", - digits: "Geben Sie bitte nur Ziffern ein.", - equalTo: "Bitte denselben Wert wiederholen.", - range: jQuery.validator.format("Geben Sie bitten einen Wert zwischen {0} und {1}."), - max: jQuery.validator.format("Geben Sie bitte einen Wert kleiner oder gleich {0} ein."), - min: jQuery.validator.format("Geben Sie bitte einen Wert größer oder gleich {0} ein."), - creditcard: "Geben Sie bitte ein gültige Kreditkarten-Nummer ein." -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_el.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_el.js deleted file mode 100644 index 52607a5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_el.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: EL - */ -jQuery.extend(jQuery.validator.messages, { - required: "Αυτό το πεδίο είναι υποχρεωτικό.", - remote: "Παρακαλώ διορθώστε αυτό το πεδίο.", - email: "Παρακαλώ εισάγετε μια έγκυρη διεύθυνση email.", - url: "Παρακαλώ εισάγετε ένα έγκυρο URL.", - date: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία.", - dateISO: "Παρακαλώ εισάγετε μια έγκυρη ημερομηνία (ISO).", - number: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό.", - digits: "Παρακαλώ εισάγετε μόνο αριθμητικά ψηφία.", - creditcard: "Παρακαλώ εισάγετε έναν έγκυρο αριθμό πιστωτικής κάρτας.", - equalTo: "Παρακαλώ εισάγετε την ίδια τιμή ξανά.", - accept: "Παρακαλώ εισάγετε μια τιμή με έγκυρη επέκταση αρχείου.", - maxlength: $.validator.format("Παρακαλώ εισάγετε μέχρι και {0} χαρακτήρες."), - minlength: $.validator.format("Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες."), - rangelength: $.validator.format("Παρακαλώ εισάγετε μια τιμή με μήκος μεταξύ {0} και {1} χαρακτήρων."), - range: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεταξύ {0} και {1}."), - max: $.validator.format("Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση του {0}."), - min: $.validator.format("Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση του {0}.") -}); - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_es.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_es.js deleted file mode 100644 index b9a2414..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_es.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: ES - */ -jQuery.extend(jQuery.validator.messages, { - required: "Este campo es obligatorio.", - remote: "Por favor, rellena este campo.", - email: "Por favor, escribe una dirección de correo válida", - url: "Por favor, escribe una URL válida.", - date: "Por favor, escribe una fecha válida.", - dateISO: "Por favor, escribe una fecha (ISO) válida.", - number: "Por favor, escribe un número entero válido.", - digits: "Por favor, escribe sólo dígitos.", - creditcard: "Por favor, escribe un número de tarjeta válido.", - equalTo: "Por favor, escribe el mismo valor de nuevo.", - accept: "Por favor, escribe un valor con una extensión aceptada.", - maxlength: jQuery.validator.format("Por favor, no escribas más de {0} caracteres."), - minlength: jQuery.validator.format("Por favor, no escribas menos de {0} caracteres."), - rangelength: jQuery.validator.format("Por favor, escribe un valor entre {0} y {1} caracteres."), - range: jQuery.validator.format("Por favor, escribe un valor entre {0} y {1}."), - max: jQuery.validator.format("Por favor, escribe un valor menor o igual a {0}."), - min: jQuery.validator.format("Por favor, escribe un valor mayor o igual a {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fa.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fa.js deleted file mode 100644 index 1ea531e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fa.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: FA - */ -jQuery.extend(jQuery.validator.messages, { - required: "تکمیل این فیلد اجباری است.", - remote: "لطفا این فیلد را تصحیح کنید.", - email: ".لطفا یک ایمیل صحیح وارد کنید", - url: "لطفا آدرس صحیح وارد کنید.", - date: "لطفا یک تاریخ صحیح وارد کنید", - dateISO: "لطفا تاریخ صحیح وارد کنید (ISO).", - number: "لطفا عدد صحیح وارد کنید.", - digits: "لطفا تنها رقم وارد کنید", - creditcard: "لطفا کریدیت کارت صحیح وارد کنید.", - equalTo: "لطفا مقدار برابری وارد کنید", - accept: "لطفا مقداری وارد کنید که ", - maxlength: jQuery.validator.format("لطفا بیشتر از {0} حرف وارد نکنید."), - minlength: jQuery.validator.format("لطفا کمتر از {0} حرف وارد نکنید."), - rangelength: jQuery.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), - range: jQuery.validator.format("لطفا مقداری بین {0} تا {1} حرف وارد کنید."), - max: jQuery.validator.format("لطفا مقداری کمتر از {0} حرف وارد کنید."), - min: jQuery.validator.format("لطفا مقداری بیشتر از {0} حرف وارد کنید.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fi.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fi.js deleted file mode 100644 index eb47369..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fi.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: FI - */ -jQuery.extend(jQuery.validator.messages, { - required: "Tämä kenttä on pakollinen.", - maxlength: jQuery.validator.format("Voit syöttää enintään {0} merkkiä."), - minlength: jQuery.validator.format("Vähintään {0} merkkiä."), - rangelength: jQuery.validator.format("Syötä vähintään {0} ja enintään {1} merkkiä."), - email: "Syö:tä oikea sähköpostiosoite.", - url: "Syötä oikea URL osoite.", - date: "Syötä oike päivämäärä.", - dateISO: "Syötä oike päivämäärä (VVVV-MM-DD).", - number: "Syötä numero.", - digits: "Syötä pelkästään numeroita.", - equalTo: "Syötä sama arvo uudestaan.", - range: jQuery.validator.format("Syötä arvo {0} ja {1} väliltä."), - max: jQuery.validator.format("Syötä arvo joka on yhtä suuri tai suurempi kuin {0}."), - min: jQuery.validator.format("Syötä arvo joka on pienempi tai yhtä suuri kuin {0}."), - creditcard: "Syötä voimassa oleva luottokorttinumero." -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fr.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fr.js deleted file mode 100644 index f9e1340..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_fr.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: FR - */ -jQuery.extend(jQuery.validator.messages, { - required: "Ce champ est requis.", - remote: "Veuillez remplir ce champ pour continuer.", - email: "Veuillez entrer une adresse email valide.", - url: "Veuillez entrer une URL valide.", - date: "Veuillez entrer une date valide.", - dateISO: "Veuillez entrer une date valide (ISO).", - number: "Veuillez entrer un nombre valide.", - digits: "Veuillez entrer (seulement) une valeur numérique.", - creditcard: "Veuillez entrer un numéro de carte de crédit valide.", - equalTo: "Veuillez entrer une nouvelle fois la même valeur.", - accept: "Veuillez entrer une valeur avec une extension valide.", - maxlength: jQuery.validator.format("Veuillez ne pas entrer plus de {0} caractères."), - minlength: jQuery.validator.format("Veuillez entrer au moins {0} caractères."), - rangelength: jQuery.validator.format("Veuillez entrer entre {0} et {1} caractères."), - range: jQuery.validator.format("Veuillez entrer une valeur entre {0} et {1}."), - max: jQuery.validator.format("Veuillez entrer une valeur inférieure ou égale à {0}."), - min: jQuery.validator.format("Veuillez entrer une valeur supérieure ou égale à {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ge.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ge.js deleted file mode 100644 index 5c3ee68..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ge.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: GE - */ -jQuery.extend(jQuery.validator.messages, { - required: "ამ ველის შევსება აუცილებელია.", - remote: "გთხოვთ მიუთითოთ სწორი მნიშვნელობა.", - email: "გთხოვთ მიუთითოთ ელ-ფოსტის კორექტული მისამართი.", - url: "გთხოვთ მიუთითოთ კორექტული URL.", - date: "გთხოვთ მიუთითოთ კორექტული თარიღი.", - dateISO: "გთხოვთ მიუთითოთ კორექტული თარიღი ISO ფორმატში.", - number: "გთხოვთ მიუთითოთ ციფრი.", - digits: "გთხოვთ მიუთითოთ მხოლოდ ციფრები.", - creditcard: "გთხოვთ მიუთითოთ საკრედიტო ბარათის კორექტული ნომერი.", - equalTo: "გთხოვთ მიუთითოთ ასეთივე მნიშვნელობა კიდევ ერთხელ.", - accept: "გთხოვთ აირჩიოთ ფაილი კორექტული გაფართოებით.", - maxlength: jQuery.validator.format("დასაშვებია არაუმეტეს {0} სიმბოლო."), - minlength: jQuery.validator.format("აუცილებელია შეიყვანოთ მინიმუმ {0} სიმბოლო."), - rangelength: jQuery.validator.format("ტექსტში სიმბოლოების რაოდენობა უნდა იყოს {0}-დან {1}-მდე."), - range: jQuery.validator.format("გთხოვთ შეიყვანოთ ციფრი {0}-დან {1}-მდე."), - max: jQuery.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც ნაკლებია ან უდრის {0}-ს."), - min: jQuery.validator.format("გთხოვთ შეიყვანოთ ციფრი რომელიც მეტია ან უდრის {0}-ს.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_he.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_he.js deleted file mode 100644 index c89eafe..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_he.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: HE - */ -jQuery.extend(jQuery.validator.messages, { - required: ".השדה הזה הינו שדה חובה", - remote: "נא לתקן שדה זה.", - email: "נא למלא כתובת דוא\"ל חוקית", - url: "נא למלא כתובת אינטרנט חוקית.", - date: "נא למלא תאריך חוקי", - dateISO: "נא למלא תאריך חוקי (ISO).", - number: "נא למלא מספר.", - digits: ".נא למלא רק מספרים", - creditcard: "נא למלא מספר כרטיס אשראי חוקי.", - equalTo: "נא למלא את אותו ערך שוב.", - accept: "נא למלא ערך עם סיומת חוקית.", - maxlength: jQuery.validator.format(".נא לא למלא יותר מ- {0} תווים"), - minlength: jQuery.validator.format("נא למלא לפחות {0} תווים."), - rangelength: jQuery.validator.format("נא למלא ערך בין {0} ל- {1} תווים."), - range: jQuery.validator.format("נא למלא ערך בין {0} ל- {1}."), - max: jQuery.validator.format("נא למלא ערך קטן או שווה ל- {0}."), - min: jQuery.validator.format("נא למלא ערך גדול או שווה ל- {0}.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_hu.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_hu.js deleted file mode 100644 index 086222a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_hu.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: HU - */ -jQuery.extend(jQuery.validator.messages, { - required: "Kötelező megadni.", - maxlength: jQuery.validator.format("Legfeljebb {0} karakter hosszú legyen."), - minlength: jQuery.validator.format("Legalább {0} karakter hosszú legyen."), - rangelength: jQuery.validator.format("Legalább {0} és legfeljebb {1} karakter hosszú legyen."), - email: "Érvényes e-mail címnek kell lennie.", - url: "Érvényes URL-nek kell lennie.", - date: "Dátumnak kell lennie.", - number: "Számnak kell lennie.", - digits: "Csak számjegyek lehetnek.", - equalTo: "Meg kell egyeznie a két értéknek.", - range: jQuery.validator.format("{0} és {1} közé kell esnie."), - max: jQuery.validator.format("Nem lehet nagyobb, mint {0}."), - min: jQuery.validator.format("Nem lehet kisebb, mint {0}."), - creditcard: "Érvényes hitelkártyaszámnak kell lennie." -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_it.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_it.js deleted file mode 100644 index ec44bca..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_it.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: IT - */ -jQuery.extend(jQuery.validator.messages, { - required: "Campo obbligatorio.", - remote: "Controlla questo campo.", - email: "Inserisci un indirizzo email valido.", - url: "Inserisci un indirizzo web valido.", - date: "Inserisci una data valida.", - dateISO: "Inserisci una data valida (ISO).", - number: "Inserisci un numero valido.", - digits: "Inserisci solo numeri.", - creditcard: "Inserisci un numero di carta di credito valido.", - equalTo: "Il valore non corrisponde.", - accept: "Inserisci un valore con un'estensione valida.", - maxlength: jQuery.validator.format("Non inserire più di {0} caratteri."), - minlength: jQuery.validator.format("Inserisci almeno {0} caratteri."), - rangelength: jQuery.validator.format("Inserisci un valore compreso tra {0} e {1} caratteri."), - range: jQuery.validator.format("Inserisci un valore compreso tra {0} e {1}."), - max: jQuery.validator.format("Inserisci un valore minore o uguale a {0}."), - min: jQuery.validator.format("Inserisci un valore maggiore o uguale a {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ja.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ja.js deleted file mode 100644 index 62fc567..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ja.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: JA (Japanese) - */ -jQuery.extend(jQuery.validator.messages, { - required: "このフィールドは必須です。", - remote: "このフィールドを修正してください。", - email: "有効なEメールアドレスを入力してください。", - url: "有効なURLを入力してください。", - date: "有効な日付を入力してください。", - dateISO: "有効な日付(ISO)を入力してください。", - number: "有効な数字を入力してください。", - digits: "数字のみを入力してください。", - creditcard: "有効なクレジットカード番号を入力してください。", - equalTo: "同じ値をもう一度入力してください。", - accept: "有効な拡張子を含む値を入力してください。", - maxlength: jQuery.format("{0} 文字以内で入力してください。"), - minlength: jQuery.format("{0} 文字以上で入力してください。"), - rangelength: jQuery.format("{0} 文字から {1} 文字までの値を入力してください。"), - range: jQuery.format("{0} から {1} までの値を入力してください。"), - max: jQuery.format("{0} 以下の値を入力してください。"), - min: jQuery.format("{1} 以上の値を入力してください。") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_kk.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_kk.js deleted file mode 100644 index b377894..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_kk.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: KK - */ -jQuery.extend(jQuery.validator.messages, { - required: "Бұл өрісті міндетті түрде толтырыңыз.", - remote: "Дұрыс мағына енгізуіңізді сұраймыз.", - email: "Нақты электронды поштаңызды енгізуіңізді сұраймыз.", - url: "Нақты URL-ды енгізуіңізді сұраймыз.", - date: "Нақты URL-ды енгізуіңізді сұраймыз.", - dateISO: "Нақты ISO форматымен сәйкес датасын енгізуіңізді сұраймыз.", - number: "Күнді енгізуіңізді сұраймыз.", - digits: "Тек қана сандарды енгізуіңізді сұраймыз.", - creditcard: "Несие картасының нөмірін дұрыс енгізуіңізді сұраймыз.", - equalTo: "Осы мәнді қайта енгізуіңізді сұраймыз.", - accept: "Файлдың кеңейтуін дұрыс таңдаңыз.", - maxlength: jQuery.format("Ұзындығы {0} символдан көр болмасын."), - minlength: jQuery.format("Ұзындығы {0} символдан аз болмасын."), - rangelength: jQuery.format("Ұзындығы {0}-{1} дейін мән енгізуіңізді сұраймыз."), - range: jQuery.format("Пожалуйста, введите число от {0} до {1}. - {0} - {1} санын енгізуіңізді сұраймыз."), - max: jQuery.format("{0} аз немесе тең санын енгізуіңіді сұраймыз."), - min: jQuery.format("{0} көп немесе тең санын енгізуіңізді сұраймыз.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_lt.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_lt.js deleted file mode 100644 index a890dbe..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_lt.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin in lithuanian. - * Locale: LT - */ -jQuery.extend(jQuery.validator.messages, { - required: "Šis laukas yra privalomas.", - remote: "Prašau pataisyti šį lauką.", - email: "Prašau įvesti teisingą elektroninio pašto adresą.", - url: "Prašau įvesti teisingą URL.", - date: "Prašau įvesti teisingą datą.", - dateISO: "Prašau įvesti teisingą datą (ISO).", - number: "Prašau įvesti teisingą skaičių.", - digits: "Prašau naudoti tik skaitmenis.", - creditcard: "Prašau įvesti teisingą kreditinės kortelės numerį.", - equalTo: "Prašau įvestį tą pačią reikšmę dar kartą.", - accept: "Prašau įvesti reikšmę su teisingu plėtiniu.", - maxlength: $.format("Prašau įvesti ne daugiau kaip {0} simbolių."), - minlength: $.format("Prašau įvesti bent {0} simbolius."), - rangelength: $.format("Prašau įvesti reikšmes, kurių ilgis nuo {0} iki {1} simbolių."), - range: $.format("Prašau įvesti reikšmę intervale nuo {0} iki {1}."), - max: $.format("Prašau įvesti reikšmę mažesnę arba lygią {0}."), - min: $.format("Prašau įvesti reikšmę didesnę arba lygią {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_lv.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_lv.js deleted file mode 100644 index 944e918..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_lv.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: LV - */ -jQuery.extend(jQuery.validator.messages, { - required: "Šis lauks ir obligāts.", - remote: "Lūdzu, pārbaudiet šo lauku.", - email: "Lūdzu, ievadiet derīgu e-pasta adresi.", - url: "Lūdzu, ievadiet derīgu URL adresi.", - date: "Lūdzu, ievadiet derīgu datumu.", - dateISO: "Lūdzu, ievadiet derīgu datumu (ISO).", - number: "Lūdzu, ievadiet derīgu numuru.", - digits: "Lūdzu, ievadiet tikai ciparus.", - creditcard: "Lūdzu, ievadiet derīgu kredītkartes numuru.", - equalTo: "Lūdzu, ievadiet to pašu vēlreiz.", - accept: "Lūdzu, ievadiet vērtību ar derīgu paplašinājumu.", - maxlength: jQuery.validator.format("Lūdzu, ievadiet ne vairāk kā {0} rakstzīmes."), - minlength: jQuery.validator.format("Lūdzu, ievadiet vismaz {0} rakstzīmes."), - rangelength: jQuery.validator.format("Lūdzu ievadiet {0} līdz {1} rakstzīmes."), - range: jQuery.validator.format("Lūdzu, ievadiet skaitli no {0} līdz {1}."), - max: jQuery.validator.format("Lūdzu, ievadiet skaitli, kurš ir mazāks vai vienāds ar {0}."), - min: jQuery.validator.format("Lūdzu, ievadiet skaitli, kurš ir lielāks vai vienāds ar {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_nl.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_nl.js deleted file mode 100644 index e266158..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_nl.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: NL - */ -jQuery.extend(jQuery.validator.messages, { - required: "Dit is een verplicht veld.", - remote: "Controleer dit veld.", - email: "Vul hier een geldig e-mailadres in.", - url: "Vul hier een geldige URL in.", - date: "Vul hier een geldige datum in.", - dateISO: "Vul hier een geldige datum in (ISO-formaat).", - number: "Vul hier een geldig getal in.", - digits: "Vul hier alleen getallen in.", - creditcard: "Vul hier een geldig creditcardnummer in.", - equalTo: "Vul hier dezelfde waarde in.", - accept: "Vul hier een waarde in met een geldige extensie.", - maxlength: jQuery.validator.format("Vul hier maximaal {0} tekens in."), - minlength: jQuery.validator.format("Vul hier minimaal {0} tekens in."), - rangelength: jQuery.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1} tekens."), - range: jQuery.validator.format("Vul hier een waarde in van minimaal {0} en maximaal {1}."), - max: jQuery.validator.format("Vul hier een waarde in kleiner dan of gelijk aan {0}."), - min: jQuery.validator.format("Vul hier een waarde in groter dan of gelijk aan {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_no.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_no.js deleted file mode 100644 index 89706fc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_no.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: NO (Norwegian) - */ -jQuery.extend(jQuery.validator.messages, { - required: "Dette feltet er obligatorisk.", - maxlength: jQuery.validator.format("Maksimalt {0} tegn."), - minlength: jQuery.validator.format("Minimum {0} tegn."), - rangelength: jQuery.validator.format("Angi minimum {0} og maksimum {1} tegn."), - email: "Oppgi en gyldig epostadresse.", - url: "Angi en gyldig URL.", - date: "Angi en gyldig dato.", - dateISO: "Angi en gyldig dato (&ARING;&ARING;&ARING;&ARING;-MM-DD).", - dateSE: "Angi en gyldig dato.", - number: "Angi et gyldig nummer.", - numberSE: "Angi et gyldig nummer.", - digits: "Skriv kun tall.", - equalTo: "Skriv samme verdi igjen.", - range: jQuery.validator.format("Angi en verdi mellom {0} og {1}."), - max: jQuery.validator.format("Angi en verdi som er større eller lik {0}."), - min: jQuery.validator.format("Angi en verdi som er mindre eller lik {0}."), - creditcard: "Angi et gyldig kredittkortnummer." -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_pl.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_pl.js deleted file mode 100644 index 27190d8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_pl.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: PL - */ -jQuery.extend(jQuery.validator.messages, { - required: "To pole jest wymagane.", - remote: "Proszę o wypełnienie tego pola.", - email: "Proszę o podanie prawidłowego adresu email.", - url: "Proszę o podanie prawidłowego URL.", - date: "Proszę o podanie prawidłowej daty.", - dateISO: "Proszę o podanie prawidłowej daty (ISO).", - number: "Proszę o podanie prawidłowej liczby.", - digits: "Proszę o podanie samych cyfr.", - creditcard: "Proszę o podanie prawidłowej karty kredytowej.", - equalTo: "Proszę o podanie tej samej wartości ponownie.", - accept: "Proszę o podanie wartości z prawidłowym rozszerzeniem.", - maxlength: jQuery.validator.format("Proszę o podanie nie więcej niż {0} znaków."), - minlength: jQuery.validator.format("Proszę o podanie przynajmniej {0} znaków."), - rangelength: jQuery.validator.format("Proszę o podanie wartości o długości od {0} do {1} znaków."), - range: jQuery.validator.format("Proszę o podanie wartości z przedziału od {0} do {1}."), - max: jQuery.validator.format("Proszę o podanie wartości mniejszej bądź równej {0}."), - min: jQuery.validator.format("Proszę o podanie wartości większej bądź równej {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ptbr.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ptbr.js deleted file mode 100644 index 0711857..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ptbr.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: PT_BR - */ -jQuery.extend(jQuery.validator.messages, { - required: "Este campo é requerido.", - remote: "Por favor, corrija este campo.", - email: "Por favor, forneça um endereço eletrônico válido.", - url: "Por favor, forneça uma URL válida.", - date: "Por favor, forneça uma data válida.", - dateISO: "Por favor, forneça uma data válida (ISO).", - number: "Por favor, forneça um número válida.", - digits: "Por favor, forneça somente dígitos.", - creditcard: "Por favor, forneça um cartão de crédito válido.", - equalTo: "Por favor, forneça o mesmo valor novamente.", - accept: "Por favor, forneça um valor com uma extensão válida.", - maxlength: jQuery.validator.format("Por favor, forneça não mais que {0} caracteres."), - minlength: jQuery.validator.format("Por favor, forneça ao menos {0} caracteres."), - rangelength: jQuery.validator.format("Por favor, forneça um valor entre {0} e {1} caracteres de comprimento."), - range: jQuery.validator.format("Por favor, forneça um valor entre {0} e {1}."), - max: jQuery.validator.format("Por favor, forneça um valor menor ou igual a {0}."), - min: jQuery.validator.format("Por favor, forneça um valor maior ou igual a {0}.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ptpt.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ptpt.js deleted file mode 100644 index 1e3fea2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ptpt.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Translated default messages for the jQuery validation plugin. - * Locale: PT_PT - */ -jQuery.extend(jQuery.validator.messages, { - required: "Campo de preenchimento obrigatório.", - remote: "Por favor, corrija este campo.", - email: "Por favor, introduza um endereço eletrónico válido.", - url: "Por favor, introduza um URL válido.", - date: "Por favor, introduza uma data válida.", - dateISO: "Por favor, introduza uma data válida (ISO).", - number: "Por favor, introduza um número válido.", - digits: "Por favor, introduza apenas dígitos.", - creditcard: "Por favor, introduza um número de cartão de crédito válido.", - equalTo: "Por favor, introduza de novo o mesmo valor.", - accept: "Por favor, introduza um ficheiro com uma extensão válida.", - maxlength: jQuery.validator.format("Por favor, não introduza mais do que {0} caracteres."), - minlength: jQuery.validator.format("Por favor, introduza pelo menos {0} caracteres."), - rangelength: jQuery.validator.format("Por favor, introduza entre {0} e {1} caracteres."), - range: jQuery.validator.format("Por favor, introduza um valor entre {0} e {1}."), - max: jQuery.validator.format("Por favor, introduza um valor menor ou igual a {0}."), - min: jQuery.validator.format("Por favor, introduza um valor maior ou igual a {0}.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ro.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ro.js deleted file mode 100644 index ae9a67c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ro.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: RO - */ -jQuery.extend(jQuery.validator.messages, { - required: "Acest câmp este obligatoriu.", - remote: "Te rugăm să completezi acest câmp.", - email: "Te rugăm să introduci o adresă de email validă", - url: "Te rugăm sa introduci o adresă URL validă.", - date: "Te rugăm să introduci o dată corectă.", - dateISO: "Te rugăm să introduci o dată (ISO) corectă.", - number: "Te rugăm să introduci un număr întreg valid.", - digits: "Te rugăm să introduci doar cifre.", - creditcard: "Te rugăm să introduci un numar de carte de credit valid.", - equalTo: "Te rugăm să reintroduci valoarea.", - accept: "Te rugăm să introduci o valoare cu o extensie validă.", - maxlength: jQuery.validator.format("Te rugăm să nu introduci mai mult de {0} caractere."), - minlength: jQuery.validator.format("Te rugăm să introduci cel puțin {0} caractere."), - rangelength: jQuery.validator.format("Te rugăm să introduci o valoare între {0} și {1} caractere."), - range: jQuery.validator.format("Te rugăm să introduci o valoare între {0} și {1}."), - max: jQuery.validator.format("Te rugăm să introduci o valoare egal sau mai mică decât {0}."), - min: jQuery.validator.format("Te rugăm să introduci o valoare egal sau mai mare decât {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ru.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ru.js deleted file mode 100644 index 419ac24..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ru.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: RU - */ -jQuery.extend(jQuery.validator.messages, { - required: "Это поле необходимо заполнить.", - remote: "Пожалуйста, введите правильное значение.", - email: "Пожалуйста, введите корретный адрес электронной почты.", - url: "Пожалуйста, введите корректный URL.", - date: "Пожалуйста, введите корректную дату.", - dateISO: "Пожалуйста, введите корректную дату в формате ISO.", - number: "Пожалуйста, введите число.", - digits: "Пожалуйста, вводите только цифры.", - creditcard: "Пожалуйста, введите правильный номер кредитной карты.", - equalTo: "Пожалуйста, введите такое же значение ещё раз.", - accept: "Пожалуйста, выберите файл с правильным расширением.", - maxlength: jQuery.validator.format("Пожалуйста, введите не больше {0} символов."), - minlength: jQuery.validator.format("Пожалуйста, введите не меньше {0} символов."), - rangelength: jQuery.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."), - range: jQuery.validator.format("Пожалуйста, введите число от {0} до {1}."), - max: jQuery.validator.format("Пожалуйста, введите число, меньшее или равное {0}."), - min: jQuery.validator.format("Пожалуйста, введите число, большее или равное {0}.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_se.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_se.js deleted file mode 100644 index 3dee369..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_se.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SE - */ -jQuery.extend(jQuery.validator.messages, { - required: "Detta fält är obligatoriskt.", - maxlength: jQuery.validator.format("Du får ange högst {0} tecken."), - minlength: jQuery.validator.format("Du måste ange minst {0} tecken."), - rangelength: jQuery.validator.format("Ange minst {0} och max {1} tecken."), - email: "Ange en korrekt e-postadress.", - url: "Ange en korrekt URL.", - date: "Ange ett korrekt datum.", - dateISO: "Ange ett korrekt datum (&ARING;&ARING;&ARING;&ARING;-MM-DD).", - number: "Ange ett korrekt nummer.", - digits: "Ange endast siffror.", - equalTo: "Ange samma värde igen.", - range: jQuery.validator.format("Ange ett värde mellan {0} och {1}."), - max: jQuery.validator.format("Ange ett värde som är större eller lika med {0}."), - min: jQuery.validator.format("Ange ett värde som är mindre eller lika med {0}."), - creditcard: "Ange ett korrekt kreditkortsnummer." -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_si.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_si.js deleted file mode 100644 index b8d8d7d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_si.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SI (Slovenian) - */ -jQuery.extend(jQuery.validator.messages, { - required: "To polje je obvezno.", - remote: "Vpis v tem polju ni v pravi obliki.", - email: "Prosimo, vnesite pravi email naslov.", - url: "Prosimo, vnesite pravi URL.", - date: "Prosimo, vnesite pravi datum.", - dateISO: "Prosimo, vnesite pravi datum (ISO).", - number: "Prosimo, vnesite pravo številko.", - digits: "Prosimo, vnesite samo številke.", - creditcard: "Prosimo, vnesite pravo številko kreditne kartice.", - equalTo: "Prosimo, ponovno vnesite enako vsebino.", - accept: "Prosimo, vnesite vsebino z pravo končnico.", - maxlength: $.validator.format("Prosimo, da ne vnašate več kot {0} znakov."), - minlength: $.validator.format("Prosimo, vnesite vsaj {0} znakov."), - rangelength: $.validator.format("Prosimo, vnesite od {0} do {1} znakov."), - range: $.validator.format("Prosimo, vnesite vrednost med {0} in {1}."), - max: $.validator.format("Prosimo, vnesite vrednost manjšo ali enako {0}."), - min: $.validator.format("Prosimo, vnesite vrednost večjo ali enako {0}.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_sk.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_sk.js deleted file mode 100644 index 442d31d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_sk.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SK - */ -jQuery.extend(jQuery.validator.messages, { - required: "Povinné zadať.", - maxlength: jQuery.validator.format("Maximálne {0} znakov."), - minlength: jQuery.validator.format("Minimálne {0} znakov."), - rangelength: jQuery.validator.format("Minimálne {0} a Maximálne {0} znakov."), - email: "E-mailová adresa musí byť platná.", - url: "URL musí byť platný.", - date: "Musí byť dátum.", - number: "Musí byť číslo.", - digits: "Môže obsahovať iba číslice.", - equalTo: "Dva hodnoty sa musia rovnať.", - range: jQuery.validator.format("Musí byť medzi {0} a {1}."), - max: jQuery.validator.format("Nemôže byť viac ako{0}."), - min: jQuery.validator.format("Nemôže byť menej ako{0}."), - creditcard: "Číslo platobnej karty musí byť platné." -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_sr.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_sr.js deleted file mode 100644 index 1a89174..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_sr.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: SR - */ -jQuery.extend(jQuery.validator.messages, { - required: "Поље је обавезно.", - remote: "Средите ово поље.", - email: "Унесите исправну и-мејл адресу", - url: "Унесите исправан URL.", - date: "Унесите исправан датум.", - dateISO: "Унесите исправан датум (ISO).", - number: "Унесите исправан број.", - digits: "Унесите само цифе.", - creditcard: "Унесите исправан број кредитне картице.", - equalTo: "Унесите исту вредност поново.", - accept: "Унесите вредност са одговарајућом екстензијом.", - maxlength: $.validator.format("Унесите мање од {0}карактера."), - minlength: $.validator.format("Унесите барем {0} карактера."), - rangelength: $.validator.format("Унесите вредност дугачку између {0} и {1} карактера."), - range: $.validator.format("Унесите вредност између {0} и {1}."), - max: $.validator.format("Унесите вредност мању или једнаку {0}."), - min: $.validator.format("Унесите вредност већу или једнаку {0}.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_th.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_th.js deleted file mode 100644 index e40fb67..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_th.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: TH (Thai) - */ -jQuery.extend(jQuery.validator.messages, { - required: "โปรดระบุ", - remote: "โปรดแก้ไขให้ถูกต้อง", - email: "โปรดระบุที่อยู่อีเมล์ที่ถูกต้อง", - url: "โปรดระบุ URL ที่ถูกต้อง", - date: "โปรดระบุวันที่ ที่ถูกต้อง", - dateISO: "โปรดระบุวันที่ ที่ถูกต้อง (ระบบ ISO).", - number: "โปรดระบุทศนิยมที่ถูกต้อง", - digits: "โปรดระบุจำนวนเต็มที่ถูกต้อง", - creditcard: "โปรดระบุรหัสบัตรเครดิตที่ถูกต้อง", - equalTo: "โปรดระบุค่าเดิมอีกครั้ง", - accept: "โปรดระบุค่าที่มีส่วนขยายที่ถูกต้อง", - maxlength: jQuery.validator.format("โปรดอย่าระบุค่าที่ยาวกว่า {0} อักขระ"), - minlength: jQuery.validator.format("โปรดอย่าระบุค่าที่สั้นกว่า {0} อักขระ"), - rangelength: jQuery.validator.format("โปรดอย่าระบุค่าความยาวระหว่าง {0} ถึง {1} อักขระ"), - range: jQuery.validator.format("โปรดระบุค่าระหว่าง {0} และ {1}"), - max: jQuery.validator.format("โปรดระบุค่าน้อยกว่าหรือเท่ากับ {0}"), - min: jQuery.validator.format("โปรดระบุค่ามากกว่าหรือเท่ากับ {0}") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_tr.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_tr.js deleted file mode 100644 index 9df81e4..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_tr.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: TR - */ -jQuery.extend(jQuery.validator.messages, { - required: "Bu alanın doldurulması zorunludur.", - remote: "Lütfen bu alanı düzeltin.", - email: "Lütfen geçerli bir e-posta adresi giriniz.", - url: "Lütfen geçerli bir web adresi (URL) giriniz.", - date: "Lütfen geçerli bir tarih giriniz.", - dateISO: "Lütfen geçerli bir tarih giriniz(ISO formatında)", - number: "Lütfen geçerli bir sayı giriniz.", - digits: "Lütfen sadece sayısal karakterler giriniz.", - creditcard: "Lütfen geçerli bir kredi kartı giriniz.", - equalTo: "Lütfen aynı değeri tekrar giriniz.", - accept: "Lütfen geçerli uzantıya sahip bir değer giriniz.", - maxlength: jQuery.validator.format("Lütfen en fazla {0} karakter uzunluğunda bir değer giriniz."), - minlength: jQuery.validator.format("Lütfen en az {0} karakter uzunluğunda bir değer giriniz."), - rangelength: jQuery.validator.format("Lütfen en az {0} ve en fazla {1} uzunluğunda bir değer giriniz."), - range: jQuery.validator.format("Lütfen {0} ile {1} arasında bir değer giriniz."), - max: jQuery.validator.format("Lütfen {0} değerine eşit ya da daha küçük bir değer giriniz."), - min: jQuery.validator.format("Lütfen {0} değerine eşit ya da daha büyük bir değer giriniz.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_tw.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_tw.js deleted file mode 100644 index 2481535..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_tw.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: TW (Taiwan - Traditional Chinese) - */ -jQuery.extend(jQuery.validator.messages, { - required: "必填", - remote: "請修正此欄位", - email: "請輸入正確的電子信箱", - url: "請輸入合法的URL", - date: "請輸入合法的日期", - dateISO: "請輸入合法的日期 (ISO).", - number: "請輸入數字", - digits: "請輸入整數", - creditcard: "請輸入合法的信用卡號碼", - equalTo: "請重複輸入一次", - accept: "請輸入有效的後缀字串", - maxlength: jQuery.validator.format("請輸入長度不大於{0} 的字串"), - minlength: jQuery.validator.format("請輸入長度不小於 {0} 的字串"), - rangelength: jQuery.validator.format("請輸入長度介於 {0} 和 {1} 之間的字串"), - range: jQuery.validator.format("請輸入介於 {0} 和 {1} 之間的數值"), - max: jQuery.validator.format("請輸入不大於 {0} 的數值"), - min: jQuery.validator.format("請輸入不小於 {0} 的數值") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ua.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ua.js deleted file mode 100644 index 25434a6..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_ua.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: UA (Ukrainian) - */ -jQuery.extend(jQuery.validator.messages, { - required: "Це поле необхідно заповнити.", - remote: "Будь ласка, введіть правильне значення.", - email: "Будь ласка, введіть коректну адресу електронної пошти.", - url: "Будь ласка, введіть коректний URL.", - date: "Будь ласка, введіть коректну дату.", - dateISO: "Будь ласка, введіть коректну дату у форматі ISO.", - number: "Будь ласка, введіть число.", - digits: "Вводите потрібно лише цифри.", - creditcard: "Будь ласка, введіть правильний номер кредитної карти.", - equalTo: "Будь ласка, введіть таке ж значення ще раз.", - accept: "Будь ласка, виберіть файл з правильним розширенням.", - maxlength: jQuery.validator.format("Будь ласка, введіть не більше {0} символів."), - minlength: jQuery.validator.format("Будь ласка, введіть не менше {0} символів."), - rangelength: jQuery.validator.format("Будь ласка, введіть значення довжиною від {0} до {1} символів."), - range: jQuery.validator.format("Будь ласка, введіть число від {0} до {1}."), - max: jQuery.validator.format("Будь ласка, введіть число, менше або рівно {0}."), - min: jQuery.validator.format("Будь ласка, введіть число, більше або рівно {0}.") -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_vi.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_vi.js deleted file mode 100644 index 9170547..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/messages_vi.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Translated default messages for the jQuery validation plugin. - * Locale: VI (Vietnamese) - */ -jQuery.extend(jQuery.validator.messages, { - required: "Hãy nhập.", - remote: "Hãy sửa cho đúng.", - email: "Hãy nhập email.", - url: "Hãy nhập URL.", - date: "Hãy nhập ngày.", - dateISO: "Hãy nhập ngày (ISO).", - number: "Hãy nhập số.", - digits: "Hãy nhập chữ số.", - creditcard: "Hãy nhập số thẻ tín dụng.", - equalTo: "Hãy nhập thêm lần nữa.", - accept: "Phần mở rộng không đúng.", - maxlength: jQuery.format("Hãy nhập từ {0} kí tự trở xuống."), - minlength: jQuery.format("Hãy nhập từ {0} kí tự trở lên."), - rangelength: jQuery.format("Hãy nhập từ {0} đến {1} kí tự."), - range: jQuery.format("Hãy nhập từ {0} đến {1}."), - max: jQuery.format("Hãy nhập từ {0} trở xuống."), - min: jQuery.format("Hãy nhập từ {1} trở lên.") -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_de.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_de.js deleted file mode 100644 index 3e8ac84..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_de.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Localized default methods for the jQuery validation plugin. - * Locale: DE - */ -jQuery.extend(jQuery.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value); - }, - number: function(value, element) { - return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value); - } -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_nl.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_nl.js deleted file mode 100644 index 152e94d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_nl.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Localized default methods for the jQuery validation plugin. - * Locale: NL - */ -jQuery.extend(jQuery.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value); - } -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_pt.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_pt.js deleted file mode 100644 index 21879d3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/lib/js/jquery-form-validation/localization/methods_pt.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Localized default methods for the jQuery validation plugin. - * Locale: PT_BR - */ -jQuery.extend(jQuery.validator.methods, { - date: function(value, element) { - return this.optional(element) || /^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(value); - } -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/plugin.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/plugin.php deleted file mode 100644 index aff2afd..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/plugin.php +++ /dev/null @@ -1,15 +0,0 @@ - -
      - - -
      -
       
      - -
      - -
      - '; - echo '
      '; - echo ''; - $str = sprintf( __( '%s repetition', 'wpv-views' ), $cfg['title'] ); - echo ''; - echo '
      '; - echo '
      '; - } - echo $out; - if ( $cfg['repetitive'] ) { - echo '
      '; - echo '
      '; - } - } else { - if ( $cfg['repetitive'] ) { - $toolset_repdrag_image = apply_filters( 'wptoolset_filter_wptoolset_repdrag_image', $toolset_repdrag_image ); - echo '
      '; - echo ''; - } - echo $out; - if ( $cfg['repetitive'] ) { - if ( ! $has_output_bootstrap && array_key_exists( 'use_bootstrap', $cfg ) && $cfg['use_bootstrap'] ) { - $button_extra_classnames = ' btn btn-default btn-sm'; - } - $str = sprintf( __( '%s repetition', 'wpv-views' ), $cfg['title'] ); - echo ''; - echo '
      '; - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/templates/metaform.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/templates/metaform.php deleted file mode 100644 index 6e058c0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/toolset-forms/templates/metaform.php +++ /dev/null @@ -1,87 +0,0 @@ -
      -
      - - - - -
      -
      - '; - } - foreach ( $html as $out ) { - include 'metaform-item.php'; - } - if ( $cfg['repetitive'] ) { - if ( $has_output_bootstrap ) { - echo '' . apply_filters( 'toolset_button_add_repetition_text', esc_attr( __( 'Add new', 'wpv-views' ) ), $cfg ) . ''; - } else { - echo ''; - } - } - if ( $needs_wrapper ) { - echo '
      '; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/beta.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/beta.php deleted file mode 100644 index debed2b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/beta.php +++ /dev/null @@ -1,64 +0,0 @@ -add_screen( 'backend', new Toolset_User_Editors_Medium_Screen_Content_Template_Backend() ); -$medium->add_screen( 'frontend', new Toolset_User_Editors_Medium_Screen_Content_Template_Frontend() ); -$medium->add_screen( 'frontend-editor', new Toolset_User_Editors_Medium_Screen_Content_Template_Frontend_Editor() ); - -$editor_setup = new Toolset_User_Editors_Manager( $medium ); - -$available_editors = array( - 'Toolset_User_Editors_Editor_Basic' => array( - 'backend' => 'Toolset_User_Editors_Editor_Screen_Basic_Backend', - ), - 'Toolset_User_Editors_Editor_Visual_Composer' => array( - 'backend' => 'Toolset_User_Editors_Editor_Screen_Visual_Composer_Backend', - 'frontend' => 'Toolset_User_Editors_Editor_Screen_Visual_Composer_Frontend', - ), - 'Toolset_User_Editors_Editor_Beaver' => array( - 'backend' => 'Toolset_User_Editors_Editor_Screen_Beaver_Backend', - 'frontend' => 'Toolset_User_Editors_Editor_Screen_Beaver_Frontend', - 'frontend-editor' => 'Toolset_User_Editors_Editor_Screen_Beaver_Frontend_Editor', - ), - 'Toolset_User_Editors_Editor_Native' => array( - 'backend' => 'Toolset_User_Editors_Editor_Screen_Native_Backend', - ), - 'Toolset_User_Editors_Editor_Avada' => array( - 'backend' => 'Toolset_User_Editors_Editor_Screen_Avada_Backend', - ), - 'Toolset_User_Editors_Editor_Divi' => array( - 'backend' => 'Toolset_User_Editors_Editor_Screen_Divi_Backend', - 'frontend' => 'Toolset_User_Editors_Editor_Screen_Divi_Frontend', - ), -); - -if ( version_compare( WPV_VERSION, '2.6-b1', '>' ) ) { - $available_editors['Toolset_User_Editors_Editor_Gutenberg'] = array( - 'backend' => 'Toolset_User_Editors_Editor_Screen_Gutenberg_Backend', - ); -} - -foreach ( $available_editors as $editor_main_class => $editor_screen_classes ) { - $editor = new $editor_main_class( $medium ); - if ( method_exists( $editor,'initialize' ) ) { - $editor->initialize(); - } - - if ( $editor_setup->add_editor( $editor ) ) { - foreach ( $editor_screen_classes as $key => $editor_screen_class ) { - $new_editor_screen_class = new $editor_screen_class(); - $new_editor_screen_class->initialize(); - $editor->add_screen( $key, $new_editor_screen_class ); - - } - } -} - -/** -* The editor setup is run early on init because it depends on the user capabilities -*/ -add_action( 'init', array( $editor_setup, 'run' ), -1000 ); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/abstract.php deleted file mode 100644 index 6fb19eb..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/abstract.php +++ /dev/null @@ -1,88 +0,0 @@ -medium = $medium; - } - - public function get_id() { - return $this->id; - } - - public function get_name() { - return $this->name; - } - - public function get_logo_class() { - return $this->logo_class; - } - - public function get_logo_image_svg() { - return $this->logo_image_svg; - } - - public function set_name( $name ) { - return $this->name = $name; - } - - public function get_option_name() { - return $this->option_name; - } - - public function required_plugin_active() { - return false; - } - - public function add_screen( $id, Toolset_User_Editors_Editor_Screen_Interface $screen ) { - $screen->add_editor( $this ); - $screen->add_medium( $this->medium ); - $this->screens[$id] = $screen; - } - - /** - * @param $id - * - * @return false|Toolset_User_Editors_Editor_Screen_Interface - */ - public function get_screen_by_id( $id ) { - if( $this->screens === null ) - return false; - - if( array_key_exists( $id, $this->screens ) ) - return $this->screens[$id]; - - return false; - } -} - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/avada.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/avada.php deleted file mode 100644 index c432f95..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/avada.php +++ /dev/null @@ -1,95 +0,0 @@ -medium ) - && $this->medium->get_id() - ) { - $this->update_fusion_builder_post_meta( $this->medium->get_id(), 'ct_editor_choice' ); - } - } - - public function update_fusion_builder_post_meta( $post_id, $key ) { - if ( array_key_exists( $key, $_REQUEST ) ) { - if ( $this->get_id() == sanitize_text_field( $_REQUEST[ $key ] ) ) { - update_post_meta( $post_id, self::FUSION_BUILDER_OPTION_NAME, sanitize_text_field( self::FUSION_BUILDER_OPTION_VALUE ) ); - } else { - delete_post_meta( $post_id, self::FUSION_BUILDER_OPTION_NAME ); - } - } - } - - public function required_plugin_active() { - if ( ! apply_filters( 'toolset_is_views_available', false ) ) { - return false; - } - - if ( defined( 'FUSION_BUILDER_VERSION' ) ) { - $this->name = __( 'Fusion Builder', 'fusion-builder' ); - return true; - } - - return false; - } - - public function run() {} - - public function register_assets_for_backend_editor() { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-avada-script' ) ); - } - - public function register_assets_for_avada_compatibility() { - // The enqueueing of the style for Fusion Builder was moved outside the "CT editing" condition to also support - // compatibility to the native post/page editor when Fusion Builder is used there too. - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-avada-editor-style' ) ); - } - - /** - * We need to register the slug of our Medium in Fusion Builder. - * - * @wp-filter fusion_builder_default_post_types - * @param $allowed_types - * @return array - */ - public function support_medium( $allowed_types ) { - - if ( ! in_array( 'view-template', $allowed_types ) ) { - $allowed_types[] = 'view-template'; - } - - return $allowed_types; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/basic.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/basic.php deleted file mode 100644 index 715e6ef..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/basic.php +++ /dev/null @@ -1,69 +0,0 @@ -post_type - && in_array( - get_post_meta( - $content_template->ID, - '_toolset_user_editors_editor_choice', true - ), - array( - self::DIVI_SCREEN_ID, - self::AVADA_SCREEN_ID, - self::VC_SCREEN_ID, - self::NATIVE_SCREEN_ID, - self::BEAVER_SCREEN_ID, - ) - ) - ) { - $shortcode = str_replace( '[', '{!{', $shortcode ); - $shortcode = str_replace( ']', '}!}', $shortcode ); - } - return $shortcode; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/beaver.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/beaver.php deleted file mode 100644 index f55ecd5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/beaver.php +++ /dev/null @@ -1,64 +0,0 @@ -set_name( defined( 'FL_BUILDER_VERSION' ) ? FLBuilderModel::get_branding() : $this->get_name() ); - } - - public function required_plugin_active() { - - if ( ! apply_filters( 'toolset_is_views_available', false ) ) { - return false; - } - - if ( defined( 'FL_BUILDER_VERSION' ) ) { - return true; - } - - return false; - } - - public function run() { - // register medium slug - add_filter( 'fl_builder_post_types', array( $this, 'support_medium' ) ); - } - - /** - * We need to register the slug of our Medium in Beaver - * - * @wp-filter fl_builder_post_types - * @param $allowed_types - * @return array - */ - public function support_medium( $allowed_types ) { - if( ! is_array( $allowed_types ) ) - return array( $this->medium->get_slug() ); - - $allowed_types[] = $this->medium->get_slug(); - return $allowed_types; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/divi.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/divi.php deleted file mode 100644 index a0ab945..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/divi.php +++ /dev/null @@ -1,117 +0,0 @@ -medium ) - && $this->medium->get_id() - ) { - $this->update_divi_builder_post_meta( $this->medium->get_id(), 'ct_editor_choice' ); - } - } - - public function add_filter_for_divi_modules_for_cts() { - add_filter( 'et_builder_module_post_types', array( $this, 'support_medium' ) ); - } - - public function update_divi_builder_post_meta( $post_id, $key ) { - if ( array_key_exists( $key, $_REQUEST ) ) { - if ( $this->get_id() == sanitize_text_field( $_REQUEST[ $key ] ) ) { - update_post_meta( $post_id, self::DIVI_BUILDER_OPTION_NAME, sanitize_text_field( self::DIVI_BUILDER_OPTION_VALUE ) ); - } else { - delete_post_meta( $post_id, self::DIVI_BUILDER_OPTION_NAME ); - } - } - } - - public function required_plugin_active() { - if ( ! apply_filters( 'toolset_is_views_available', false ) ) { - return false; - } - - if ( - defined( 'ET_BUILDER_THEME' ) - || defined( 'ET_BUILDER_PLUGIN_VERSION' ) - ) { - $this->name = __( 'Divi Builder', 'wpv-views' ); - return true; - } - - return false; - } - - public function run() {} - - public function register_assets_for_backend_editor() { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-divi-script' ) ); - } - - /** - * We need to register the slug of our Medium in Divi Builder. - * - * @wp-filter et_builder_post_types - * @param $allowed_types - * @return array - */ - public function support_medium( $allowed_types ) { - if ( ! in_array( 'view-template', $allowed_types ) ) { - $allowed_types[] = 'view-template'; - } - - return $allowed_types; - } - - /** - * Hijack the "get_post_meta( $post_id, '_et_pb_use_builder', true )" call that checks if the post with ID equals to - * $post_id is built with Divi builder. The hijacking relates to checking on posts/pages that use content templates - * built with Divi. In this case, the post will be identified as one that uses Divi builder. - * - * @param string $meta_value The value of the meta. - * @param int $post_id The current post ID. - * @param string $meta_key The key of the meta. - * @param bool $single Whether to return a single value. - * @return mixed - */ - public function maybe_post_uses_divi_built_ct( $meta_value, $post_id, $meta_key, $single ) { - if ( $meta_key === self::DIVI_BUILDER_OPTION_NAME ) { - $ct_id = get_post_meta( $post_id, '_views_template', true ); - if ( $ct_id ) { - $meta_value = get_post_meta( $ct_id, self::DIVI_BUILDER_OPTION_NAME, true ); - } - } - - return $meta_value; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/gutenberg.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/gutenberg.php deleted file mode 100644 index 39e4f05..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/gutenberg.php +++ /dev/null @@ -1,60 +0,0 @@ -name = __( 'Gutenberg', 'wpv-views' ); - return true; - } - - return false; - } - - public function run() {} - - public function add_support_for_ct_edit_by_gutenberg_editor() { - add_filter( 'register_post_type_args', array( $this, 'make_ct_editable_by_gutenberg_editor' ), 10, 2 ); - } - - /** - * For the "view-template" custom post type to be editable by the native post editor, we need to temporarily set - * the "show_ui" argument that is used during the custom post type registration to true. - * - * @param array $args The arguments of the custom post type for its registration. - * @param string $name The name of the custom post type to be registered. - * - * @return mixed The filtered arguments. - * - * @since 2.5.0 - */ - public function make_ct_editable_by_gutenberg_editor( $args, $name ) { - if ( 'view-template' === $name ) { - $args['show_in_rest'] = true; - } - return $args; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/interface.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/interface.php deleted file mode 100644 index 3710e2f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/interface.php +++ /dev/null @@ -1,24 +0,0 @@ -is_native_editor_for_cts() ) { - add_action( 'init', array( $this, 'add_support_for_ct_edit_by_native_editor' ), 9 ); - - add_action( 'current_screen', array( $this, 'show_notice_to_get_back_to_toolset_ct_editor' ) ); - - add_action( 'add_meta_boxes_view-template', array( $this, 'remove_native_editor_meta_boxes' ) ); - - add_action( 'init', array( $this, 'register_assets_for_backend_editor' ), 51 ); - - add_filter( 'wpv_filter_is_native_editor_for_cts', array( $this, 'is_native_editor_for_cts' ) ); - - add_filter( 'toolset_filter_force_shortcode_generator_display', array( $this, 'force_shortcode_generator_display' ) ); - - add_filter( 'post_updated_messages', array( $this, 'adjust_post_updated_messages' ) ); - } - } - - public function required_plugin_active() { - - if ( ! apply_filters( 'toolset_is_views_available', false ) ) { - return false; - } - - return true; - } - - public function run() {} - - public function register_assets_for_backend_editor() { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-native-script' ) ); - } - - - /** - * Verify that the current page and URL parameters qualify for the editing of Content Templates using the - * native post editor. - * - * @param null|int $post_id The current post ("view-template" post) ID. - * - * @return bool - * - * @since 2.5.0 - */ - public function is_native_editor_for_cts() { - global $pagenow; - - $action = wpv_getget( 'action', null ); - $action = null === $action ? wpv_getpost( 'action', null ) : $action; - - $post_id = (int) wpv_getget( 'post', 0 ); - $post_id = ( 0 === $post_id ? (int) wpv_getpost( 'post_ID', 0 ) : $post_id ); - - $post = get_post( $post_id ); - if ( - 'post.php' === $pagenow - && ( 'edit' === $action || 'editpost' == $action ) - && null !== $post - && 'view-template' === $post->post_type - ) { - return true; - } - - return false; - } - - public function add_support_for_ct_edit_by_native_editor() { - add_filter( 'register_post_type_args', array( $this, 'make_ct_editable_by_native_editor' ), 10, 2 ); - } - - /** - * For the "view-template" custom post type to be editable by the native post editor, we need to temporarily set - * the "show_ui" argument that is used during the custom post type registration to true. - * - * @param array $args The arguments of the custom post type for its registration. - * @param string $name The name of the custom post type to be registered. - * - * @return mixed The filtered arguments. - * - * @since 2.5.0 - */ - public function make_ct_editable_by_native_editor( $args, $name ) { - if ( 'view-template' === $name ) { - $args['show_ui'] = true; - } - return $args; - } - - /** - * The "view-template" custom post type supports "author" and "slug" by design. In the native post editor, - * when editing a Content Template, we need to hide the meta-boxes. - * - * @since 2.5.0 - */ - public function remove_native_editor_meta_boxes() { - remove_meta_box( 'authordiv', 'view-template', 'normal' ); - remove_meta_box( 'slugdiv', 'view-template', 'normal' ); - } - - /** - * Show a notice on the top of the native post editor with a link to return back to the Toolset Content Template editor. - * - * @since 2.5.0 - */ - public function show_notice_to_get_back_to_toolset_ct_editor() { - $ct_id = (int) wpv_getget( 'post', 0 ); - - $notice = new Toolset_Admin_Notice_Success( 'return-to-toolset-ct-editor-page-notice' ); - - $notice_content = sprintf( - __( 'Done editing here? Return to the %1$sToolset Content Template editor%2$s.', 'wpv-views' ), - '', - '' - ); - - Toolset_Admin_Notices_Manager::add_notice( $notice, $notice_content ); - } - - public function force_shortcode_generator_display( $register_section ) { - return true; - } - - public function adjust_post_updated_messages( $messages ) { - $messages['post'][1] = __( 'Content Template updated.', 'wpv-views' ); - return $messages; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/abstract.php deleted file mode 100644 index e451828..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/abstract.php +++ /dev/null @@ -1,53 +0,0 @@ -id, - array( - $views_edit_page_screen_id, - $wpa_edit_page_screen_id, - ) - ); - } - - - public function add_medium( Toolset_User_Editors_Medium_Interface $medium ) { - $this->medium = $medium; - } - - public function add_editor( Toolset_User_Editors_Editor_Interface $editor ) { - $this->editor = $editor; - } - - public function is_active() { - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.css deleted file mode 100644 index 0eb1223..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.css +++ /dev/null @@ -1,5 +0,0 @@ -.toolset-user-editors-avada-backend { - background: #fff; - padding: 20px 20px 40px; - text-align: center; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.php deleted file mode 100644 index 12f164b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.php +++ /dev/null @@ -1,211 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - $this->constants->define( 'AVADA_SCREEN_ID', 'avada' ); - } - - public function initialize() { - add_action( 'init', array( $this, 'register_assets' ), 50 ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ), 50 ); - - add_filter( 'toolset_filter_toolset_registered_user_editors', array( $this, 'register_user_editor' ) ); - add_filter( 'wpv_filter_wpv_layout_template_extra_attributes', array( $this, 'layout_template_attribute' ), 10, 3 ); - - add_action( 'wpv_action_wpv_ct_inline_user_editor_buttons', array( $this, 'register_inline_editor_action_buttons' ) ); - - add_action( 'toolset_set_layout_template_user_editor_avada', array( $this, 'update_fusion_builder_post_meta' ) ); - add_action( 'toolset_set_layout_template_user_editor_basic', array( $this, 'update_fusion_builder_post_meta' ) ); - } - - public function is_active() { - if ( ! $this->set_medium_as_post() ) { - return false; - } - - $this->action(); - - return true; - } - - private function action() { - add_action( 'admin_enqueue_scripts', array( $this, 'action_enqueue_assets' ) ); - $this->medium->set_html_editor_backend( array( $this, 'html_output' ) ); - $this->medium->page_reload_after_backend_save(); - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - // Content Template own edit screen assets - - $toolset_assets_manager->register_style( - 'toolset-user-editors-avada-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/avada/backend.css', - array(), - TOOLSET_COMMON_VERSION - ); - - // Native post editor screen assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-avada-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/avada/backend_editor.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - $toolset_assets_manager->register_style( - 'toolset-user-editors-avada-editor-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/avada/backend_editor.css', - array(), - TOOLSET_COMMON_VERSION - ); - - // Content Template as inline object assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-avada-layout-template-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/avada/backend_layout_template.js', - array( 'jquery', 'views-layout-template-js', 'underscore' ), - TOOLSET_COMMON_VERSION, - true - ); - - $avada_layout_template_i18n = array( - 'template_editor_url' => admin_url( 'admin.php?page=ct-editor' ), - 'template_overlay' => array( - 'title' => sprintf( __( 'You created this template using Avada’s %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'button' => sprintf( __( 'Edit with %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'discard' => sprintf( __( 'Stop using %1$s for this Content Template', 'wpv-views' ), $this->editor->get_name() ), - ), - ); - - $toolset_assets_manager->localize_script( - 'toolset-user-editors-avada-layout-template-script', - 'toolset_user_editors_avada_layout_template_i18n', - $avada_layout_template_i18n - ); - } - - public function admin_enqueue_assets() { - if ( $this->is_views_or_wpa_edit_page() ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-avada-layout-template-script' ) ); - } - } - - public function action_enqueue_assets() { - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-avada-style' ) ); - } - - private function set_medium_as_post() { - $medium_id = $this->medium->get_id(); - - if ( ! $medium_id ) { - return false; - } - - $medium_post_object = get_post( $medium_id ); - if ( null === $medium_post_object ) { - return false; - } - - $this->post = $medium_post_object; - - return true; - } - - public function register_user_editor( $editors ) { - $editors[ $this->editor->get_id() ] = $this->editor->get_name(); - return $editors; - } - - /** - * Content Template editor output. - * - * Displays the Native Editor message and button to fire it up. - * - * @since 2.5.0 - */ - - public function html_output() { - - if ( ! isset( $_GET['ct_id'] ) ) { - return 'No valid content template id'; - } - - ob_start(); - include_once( dirname( __FILE__ ) . '/backend.phtml' ); - $output = ob_get_contents(); - ob_end_clean(); - - $admin_url = admin_url( 'admin.php?page=ct-editor&ct_id=' . esc_attr( $_GET['ct_id'] ) ); - $output .= '

      ' - . sprintf( - __( '%1$sStop using %2$s for this Content Template%3$s', 'wpv-views' ), - '', - $this->editor->get_name(), - '' - ) - . '

      '; - - return $output; - } - - public function register_inline_editor_action_buttons( $content_template ) { - $content_template_has_avada = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'AVADA_SCREEN_ID' ) ); - ?> - - ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'AVADA_SCREEN_ID' ) ); - if ( $content_template_has_avada ) { - $attributes['builder'] = $this->editor->get_id(); - } - return $attributes; - } - - public function update_fusion_builder_post_meta() { - if ( - isset( $_POST['ct_id'] ) - && $_POST['ct_id'] - ) { - do_action( 'toolset_update_fusion_builder_post_meta', $_POST['ct_id'], 'editor' ); - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.phtml b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.phtml deleted file mode 100644 index a61b34b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend.phtml +++ /dev/null @@ -1,41 +0,0 @@ -medium->get_frontend_templates(); -?> - -
      -

      editor->get_name() ); ?>

      - -

      - ' . $template['form-option-label'] . '' - ); - ?> -

      - -

      - -

      - -
      - - - -
      -
      \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_editor.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_editor.css deleted file mode 100644 index 02ad4be..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_editor.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * We are pushing the Fusion Builder modals ("normal" and "nested columns" ones) - * one z-index level lower in order to have the "Toolset Shortcodes" admin bar button - * modal appear above them. - */ -.fusion-builder-modal-settings-container, -.fusion_builder_row_inner .fusion-builder-row-content { - z-index: 99998 !important; -} - -.post-new-php #colorbox, -.post-new-php #cboxOverlay, -.post-new-php #cboxWrapper, -.post-php #colorbox, -.post-php #cboxOverlay, -.post-php #cboxWrapper, -.post-type-view-template #colorbox, -.post-type-view-template #cboxOverlay, -.post-type-view-template #cboxWrapper { - z-index: 99999 !important -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_editor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_editor.js deleted file mode 100644 index 0540944..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_editor.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Backend script for the native post editor when editing Content Templates using Fusion Builder (Avada). - * - * @summary Content Template editor manager for Fusion Builder (Avada) using the native editor compatibility. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_native */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.AvadaEditor = function( $ ) { - - var self = this; - - self.init = function() { - $( '#fusion_toggle_builder' ).remove(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.AvadaEditorInstance = new ToolsetCommon.UserEditor.AvadaEditor( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_layout_template.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_layout_template.js deleted file mode 100644 index f5f637d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/avada/backend_layout_template.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Backend script for the Content Template editor for Fusion Builder (Avada) using the native editor, - * as loop elements in Views and WordPress Archives Loop output sections. - * This initializes the Fusion Builder (Avada) using the native editor overlay and handles the change in user editor to Fusion Builder (Avada) using the native editor. - * - * @summary Inline Content Template editor manager for Fusion Builder (Avada) using the native editor compatibility,. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_avada_layout_template_i18n */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.AvadaEditorBackendLayoutTemplate = function( $ ) { - - var self = this; - - self.selector = '.js-wpv-ct-listing'; - self.template_selector = '#js-wpv-layout-template-overlay-template'; - self.overlayContainer = _.template( jQuery( self.template_selector ).html() ); - self.i18n_data = { - title: toolset_user_editors_avada_layout_template_i18n.template_overlay.title, - url: toolset_user_editors_avada_layout_template_i18n.template_editor_url, - button: toolset_user_editors_avada_layout_template_i18n.template_overlay.button, - discard: toolset_user_editors_avada_layout_template_i18n.template_overlay.discard, - }; - - self.initAvadaEditors = function() { - $( self.selector ).each( function() { - self.initAvadaEditor( $( this ) ); - }); - return self; - }; - - self.initAvadaEditor = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - // This has been inited before, or it is rendered closed - return self; - } - var attributes = item.data( 'attributes' ); - _.defaults( attributes, { builder: 'basic' } ); - if ( attributes.builder == 'avada' ) { - item.addClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.find( '.js-wpv-ct-apply-user-editor:not(.js-wpv-ct-apply-user-editor-avada)' ).prop( 'disabled', false ); - item.prepend( self.overlayContainer( self.i18n_data ) ); - item.find( '.CodeMirror' ).css( { 'height' : '0px'} ); - self.updateAvadaCTEditorLinkTarget( item ); - } - return self; - }; - - self.reloadAvadaEditorsLinkTarget = function() { - $( self.selector ).each( function() { - self.updateAvadaCTEditorLinkTarget( $( this ) ); - }); - return self; - }; - - self.updateAvadaCTEditorLinkTarget = function( item ) { - var ctEditorLink = item.find( '.js-wpv-layout-template-overlay-info-link' ), - ctEditorLinkTarget = toolset_user_editors_avada_layout_template_i18n.template_editor_url + '&ct_id=' + item.data( 'id' ), - queryMode = Toolset.hooks.applyFilters( 'wpv-filter-wpv-edit-screen-get-query-mode', 'normal' ); - switch ( queryMode ) { - case 'normal': - var queryType = $( '.js-wpv-query-type:checked' ).val(); - switch ( queryType ) { - case 'posts': - $('.js-wpv-query-post-type:checked').map( function() { - ctEditorLinkTarget += '&preview_post_type[]=' + $( this ).val(); - }); - break; - case 'taxonomy': - $('.js-wpv-query-taxonomy-type:checked').map( function() { - ctEditorLinkTarget += '&preview_taxonomy[]=' + $( this ).val(); - }); - break; - case 'users': - $('.js-wpv-query-users-type:checked').map( function() { - ctEditorLinkTarget += '&preview_user[]=' + $( this ).val(); - }); - break; - } - break; - case 'archive': - $( '.js-wpv-settings-archive-loop input:checked' ).map( function() { - switch ( $( this ).data( 'type' ) ) { - case 'native': - - break; - case 'post_type' : - ctEditorLinkTarget += '&preview_post_type_archive[]=' + $( this ).data( 'name' ); - break; - case 'taxonomy': - ctEditorLinkTarget += '&preview_taxonomy_archive[]=' + $( this ).data( 'name' ); - break; - } - }); - break; - } - ctEditorLink.attr( 'href', ctEditorLinkTarget ); - return self; - }; - - $( document ).on( 'js_event_wpv_query_type_options_saved', '.js-wpv-query-type-update', function( event, queryType ) { - self.reloadAvadaEditorsLinkTarget(); - }); - - self.setInlineContentTemplateEvents = function( templateId ) { - self.initAvadaEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }; - - $( document ).on( 'js_event_wpv_ct_inline_editor_inited', function( event, templateId ) { - self.initAvadaEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }); - - self.setUserEditorToAvada = function( ctId ) { - var item = $( '.js-wpv-ct-listing-' + ctId, '.js-wpv-inline-content-template-listing' ), - attributes = item.data( 'attributes' ); - - attributes.builder = 'avada'; - item.data( 'attributes', attributes ); - - if ( item.find( '.CodeMirror' ).length == 0 ) { - item.find( '.js-wpv-content-template-open' ).trigger( 'click' ); - } else { - self.initAvadaEditor( item ); - } - }; - - self.initHooks = function() { - Toolset.hooks.addAction( 'wpv-action-wpv-set-inline-content-template-events', self.setInlineContentTemplateEvents ); - Toolset.hooks.addAction( 'toolset-action-toolset-set-user-editor-to-avada', self.setUserEditorToAvada ); - return self; - }; - - self.init = function() { - self.initAvadaEditors() - .initHooks(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.AvadaEditorBackendLayoutTemplateInstance = new ToolsetCommon.UserEditor.AvadaEditorBackendLayoutTemplate( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.css deleted file mode 100644 index 39fa75c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.css +++ /dev/null @@ -1,11 +0,0 @@ -.toolset-ct-button-logo img { - height: 15px; -} -.toolset-ct-button-logo:before { - font-size: 15px !important; -} - -.toolset-divi-logo-for-ct-button:before { - font-family: 'ETmodules'; - content: '\e626'; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.js deleted file mode 100644 index 7befa58..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Backend script for the Content Template basic editor, which happens to be a Codemirror editor, - * in Content Templates edit pages. - * This initializes the third-party user editor buttons and moves them to the main Codemirror editor toolbar, - * as first class buttons. - * - * @summary Content Template basic editor manager for third party editors compatibility. - * - * @since 2.3.0 - * @requires jquery.js - * @requires underscore.js - */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.BasicBackend = function( $ ) { - - var self = this; - - self.initUserEditorButtons = function() { - var userEditorButtons = $( '.js-wpv-content-template-user-editor-buttons .js-wpv-ct-apply-user-editor' ); - if ( userEditorButtons.length != 0 ) { - var toolbar = ( '.js-wpv-content-section .js-code-editor-toolbar ul' ), - toolbarItem = $( '
    • ' ).appendTo( toolbar ); - _.each( userEditorButtons, function( element, index, list ) { - toolbarItem.append( $( element ) ); - }); - } - return self; - }; - - self.init = function() { - self.initUserEditorButtons(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.BasicBackendInstance = new ToolsetCommon.UserEditor.BasicBackend( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.php deleted file mode 100644 index fcc8bde..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.php +++ /dev/null @@ -1,187 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - $this->constants->define( 'BASIC_SCREEN_ID', 'basic' ); - } - - public function initialize() { - add_action( 'init', array( $this, 'register_assets' ), 50 ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ), 50 ); - - add_filter( 'toolset_filter_toolset_registered_user_editors', array( $this, 'register_user_editor' ) ); - add_filter( 'wpv_filter_wpv_layout_template_extra_attributes', array( $this, 'layout_template_attribute' ), 10, 3 ); - - add_action( 'wp_ajax_toolset_set_layout_template_user_editor', array( $this, 'set_layout_template_user_editor' ) ); - - add_action( 'admin_footer', array( $this, 'load_template' ) ); - } - - public function is_active() { - $this->action(); - return true; - } - - private function action() { - add_action( 'admin_enqueue_scripts', array( $this, 'action_assets' ) ); - $this->medium->set_html_editor_backend( array( $this, 'html_output' ) ); - } - - public function html_output() { - - if( ! isset( $_GET['ct_id'] ) ) - return 'No valid content template id'; - - ob_start(); - include_once( dirname( __FILE__ ) . '/backend.phtml' ); - // Render HTML template for the Insert/Edit link native WP dialog. - if ( ! class_exists( '_WP_Editors' ) ) { - require( ABSPATH . WPINC . '/class-wp-editor.php' ); - } - _WP_Editors::wp_link_dialog(); - $content = ob_get_contents(); - ob_end_clean(); - - return $content; - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - $toolset_assets_manager->register_style( - 'toolset-user-editors-basic-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/basic/backend.css', - array(), - TOOLSET_COMMON_VERSION - ); - - $toolset_assets_manager->register_script( - 'toolset-user-editors-basic-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/basic/backend.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - $toolset_assets_manager->register_script( - 'toolset-user-editors-basic-layout-template-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/basic/backend_layout_template.js', - array( 'jquery', 'views-layout-template-js', 'underscore' ), - TOOLSET_COMMON_VERSION, - true - ); - - $basic_layout_template_i18n = array( - 'template_editor_url' => admin_url( 'admin.php?page=ct-editor' ), - 'template_overlay' => array( - 'title' => __( 'Saving...', 'wpv-views' ) - ), - 'user_editors' => apply_filters( 'toolset_filter_toolset_registered_user_editors', array() ), - 'wpnonce' => wp_create_nonce( 'toolset_layout_template_user_editor_nonce' ) - ); - $toolset_assets_manager->localize_script( - 'toolset-user-editors-basic-layout-template-script', - 'toolset_user_editors_basic_layout_template_i18n', - $basic_layout_template_i18n - ); - - } - - public function admin_enqueue_assets() { - if ( $this->is_views_or_wpa_edit_page() ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-basic-layout-template-script' ) ); - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-basic-style' ) ); - } - } - - public function action_assets() { - - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-basic-script' ) ); - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-basic-style' ) ); - - } - - public function register_user_editor( $editors ) { - $editors[ $this->editor->get_id() ] = $this->editor->get_name(); - return $editors; - } - - /** - * Set the builder used by a Content Template, if any. - * - * On a Content Template used inside a View or WPA loop output, we set which builder it is using - * so we can link to the CT edit page with the right builder instantiated. - * - * @since 2.3.0 - */ - - public function layout_template_attribute( $attributes, $content_template, $view_id ) { - $content_template_has_basic = ( in_array( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ), array( '', $this->constants->constant( 'BASIC_SCREEN_ID' ) ) ) ); - if ( $content_template_has_basic ) { - $attributes['builder'] = $this->editor->get_id(); - } - return $attributes; - } - - public function set_layout_template_user_editor() { - - if ( ! current_user_can( 'manage_options' ) ) { - $data = array( - 'type' => 'capability', - 'message' => __( 'You do not have permissions for that.', 'wpv-views' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST['wpnonce'] ) - || ! wp_verify_nonce( $_POST['wpnonce'], 'toolset_layout_template_user_editor_nonce' ) - ) { - $data = array( - 'type' => 'nonce', - 'message' => __( 'Your security credentials have expired. Please reload the page to get new ones.', 'wpv-views' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST['ct_id'] ) - || ! is_numeric( $_POST['ct_id'] ) - || intval( $_POST['ct_id'] ) < 1 - ) { - $data = array( - 'type' => 'id', - 'message' => __( 'Wrong or missing ID.', 'wpv-views' ) - ); - wp_send_json_error( $data ); - } - - $ct_id = (int) $_POST['ct_id']; - $editor = isset( $_POST['editor'] ) ? sanitize_text_field( $_POST['editor'] ) : $this->constants->constant( 'BASIC_SCREEN_ID' ); - update_post_meta( $ct_id, '_toolset_user_editors_editor_choice', $editor ); - - do_action( 'toolset_set_layout_template_user_editor_' . $editor ); - - wp_send_json_success(); - } - - public function load_template() { - require_once $this->constants->constant( 'TOOLSET_COMMON_PATH' ) . '/user-editors/editor/templates/inline-ct-overlay.tpl.php'; - require_once $this->constants->constant( 'TOOLSET_COMMON_PATH' ) . '/user-editors/editor/templates/inline-ct-saving-overlay.tpl.php'; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.phtml b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.phtml deleted file mode 100644 index 62b6145..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend.phtml +++ /dev/null @@ -1,72 +0,0 @@ -
      -
      -
        - medium->get_id(), 'wpv_content' ); - ?> -
      -
      - - - - - -
      - - -
      - - - -
      - - -
      - - -
      - -

      - - - - - -

      \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend_layout_template.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend_layout_template.js deleted file mode 100644 index 5542962..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/basic/backend_layout_template.js +++ /dev/null @@ -1,187 +0,0 @@ -/** - * Backend script for the Content Template basic editor, which happens to be a Codemirror editor, - * as loop elements in Views and WordPress Archives Loop output sections. - * This initializes the third-party user editor buttons and moves them to the main Codemirror editor toolbar, - * as first class buttons. - * - * @summary Inline Content Template basic editor manager for third party editors compatibility,. - * - * @since 2.3.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global wpv_inline_templates_i18n, toolset_user_editors_basic_layout_template_i18n */ - -var WPViews = WPViews || {}; - -if( typeof _ !== 'undefined' && _.templateSettings ) -{ - _.templateSettings = { - escape: /\{\{([^\}]+?)\}\}(?!\})/g, - evaluate: /<#([\s\S]+?)#>/g, - interpolate: /\{\{\{([\s\S]+?)\}\}\}/g - }; -} - -WPViews.ViewEditScreenUserEditorBasic = function( $ ) { - - var self = this; - - self.selector = '.js-wpv-ct-listing'; - self.template_selector = '#js-wpv-layout-template-saving-overlay-template'; - self.overlayContainer = _.template( jQuery( self.template_selector ).html() ); - self.i18n_data = { - title: toolset_user_editors_basic_layout_template_i18n.template_overlay.title, - }; - - self.initBasicEditors = function() { - $( self.selector ).each( function() { - self - .initBasicEditor( $( this ) ) - .initUserEditorButtons( $( this ) ); - }); - return self; - }; - - self.initBasicEditor = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - // This has been inited before, or it is rendered closed - return self; - } - var attributes = item.data( 'attributes' ); - _.defaults( attributes, { builder: 'basic' } ); - if ( attributes.builder == 'basic' ) { - item.addClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.find( '.js-wpv-ct-apply-user-editor:not(.js-wpv-ct-apply-user-editor-basic)' ).prop( 'disabled', false ); - // Autoresize setting - if ( - wpv_inline_templates_i18n.settings.codemirror_autoresize == 'true' - || wpv_inline_templates_i18n.settings.codemirror_autoresize == '1' - ) { - item.find( '.CodeMirror' ).css( 'height', 'auto' ); - item.find( '.CodeMirror-scroll' ).css( {'overflow-y':'hidden', 'overflow-x':'auto', 'min-height':'15em'} ); - } else { - item.find( '.CodeMirror' ).css( 'height', '300px' ); - item.find( '.CodeMirror-scroll' ).css( {'overflow':'scroll !important', 'min-height':'none'} ); - } - } - return self; - }; - - self.initUserEditorButtons = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-buttons-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - return self; - } - var itemUserEditorButtons = item.find( '.js-wpv-inline-content-template-user-editor-buttons .js-wpv-ct-apply-user-editor' ); - if ( itemUserEditorButtons.length != 0 ) { - var toolbar = item.find( '.js-code-editor-toolbar ul' ), - toolbarItem = $( '
    • ' ).appendTo( toolbar ); - _.each( itemUserEditorButtons, function( element, index, list ) { - toolbarItem.append( $( element ) ); - }); - } - item.addClass( 'js-wpv-ct-listing-user-editor-buttons-inited' ) - return self; - }; - - self.applyLoadingOverlay = function( item ) { - item.find( '.js-wpv-ct-apply-user-editor' ).prop( 'disabled', true ); - item.removeClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.prepend( self.overlayContainer( self.i18n_data ) ); - item.find( '.CodeMirror' ).css( { 'height' : '0px'} ); - }; - - self.setInlineContentTemplateEvents = function( templateId ) { - self - .initBasicEditor( $( '.js-wpv-ct-listing-' + templateId ) ) - .initUserEditorButtons( $( '.js-wpv-ct-listing-' + templateId ) ); - }; - - // @note This is firing only when adding a new inline CT for a loop. - // Do not expect this to happen on pageload when a loop already has one CT which renders open - // Because this is fired earlier in the document.ready chain, and we never get here. - // That is why we init on init too. - $( document ).on( 'js_event_wpv_ct_inline_editor_inited', function( event, templateId ) { - self - .initBasicEditor( $( '.js-wpv-ct-listing-' + templateId ) ) - .initUserEditorButtons( $( '.js-wpv-ct-listing-' + templateId ) ); - }); - - self.setUserEditorToBasic = function( ctId ) { - var item = $( '.js-wpv-ct-listing-' + ctId, '.js-wpv-inline-content-template-listing' ), - attributes = item.data( 'attributes' ); - - attributes.builder = 'basic'; - item.data( 'attributes', attributes ); - - if ( item.find( '.CodeMirror' ).length == 0 ) { - item.find( '.js-wpv-content-template-open' ).trigger( 'click' ); - } else { - self.initBasicEditor( item ); - } - }; - - $( document ).on( 'click', '.js-wpv-ct-apply-user-editor', function( e ) { - e.preventDefault(); - - var thiz = $( this ), - editor = thiz.data( 'editor' ), - item = thiz.closest( self.selector ), - ctId = item.data( 'id' ), - data = { - action: 'toolset_set_layout_template_user_editor', - ct_id: ctId, - editor: editor, - wpnonce: toolset_user_editors_basic_layout_template_i18n.wpnonce - }; - - self.applyLoadingOverlay( item ); - - $.ajax({ - type: "POST", - dataType: "json", - url: ajaxurl, - data: data, - success: function( response ) { - if ( response.success ) { - Toolset.hooks.doAction( 'toolset-action-toolset-set-user-editor-to-' + editor, ctId ); - } - }, - error: function ( ajaxContext ) { - //console.log( "Error: ", ajaxContext.responseText ); - }, - complete: function() { - - } - }); - - }); - - self.initHooks = function() { - Toolset.hooks.addAction( 'wpv-action-wpv-set-inline-content-template-events', self.setInlineContentTemplateEvents ); - Toolset.hooks.addAction( 'toolset-action-toolset-set-user-editor-to-basic', self.setUserEditorToBasic ); - return self; - }; - - self.init = function() { - self.initBasicEditors() - .initHooks(); - - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - WPViews.ViewEditScreenUserEditorBasicInstance = new WPViews.ViewEditScreenUserEditorBasic( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.css deleted file mode 100644 index d3cd97c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.css +++ /dev/null @@ -1,10 +0,0 @@ -.toolset-user-editors-beaver-backend .fl-builder-admin-tabs, -.toolset-user-editors-beaver-backend .fl-builder-admin-ui h3 { - display:none; -} - -.toolset-user-editors-beaver-backend { - background: #fff; - padding: 20px 20px 40px; - text-align: center; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.js deleted file mode 100644 index b0b26bf..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Backend script for the Content Template editor or Beaver Builder, in Content Templates edit pages. - * This initializs the Beaver Buildr fronten editor launcher with the right theme PHP template based - * on the kind of preview selected depending on the CT usage. - * - * @summary Content Template editor manager for Beaver Builder compatibility. - * - * @since 2.3.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_beaver */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.BeaverBuilderBackend = function( $ ) { - - var self = this; - - self.builderLaunchButton = $( '.js-toolset-user-editors-beaver-backend .fl-launch-builder' ); - - $( '#toolset-user-editors-beaver-template-file' ).on( 'change', function() { - self.builderLaunchButton - .addClass( 'button-secondary button-disabled' ) - .removeClass( 'button-primary' ) - .prop( 'disabled', true ); - $.ajax( { - type: 'post', - dataType: 'json', - url: ajaxurl, - data: { - action: 'toolset_user_editors_beaver', - post_id: toolset_user_editors_beaver.mediumId, - template_path: this.value, - preview_domain: $( '#toolset-user-editors-beaver-template-file option:selected' ).data( 'preview-domain' ), - preview_slug: $( '#toolset-user-editors-beaver-template-file option:selected' ).data( 'preview-slug' ), - nonce: toolset_user_editors_beaver.nonce - }, - complete: function() { - self.builderLaunchButton - .removeClass( 'button-secondary button-disabled' ) - .addClass( 'button-primary' ) - .prop( 'disabled', false ); - } - } ); - }); - - self.init = function() { - - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.BeaverBuilderBackendInstance = new ToolsetCommon.UserEditor.BeaverBuilderBackend( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.php deleted file mode 100644 index 72bd3cd..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend.php +++ /dev/null @@ -1,307 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - $this->constants->define( 'BEAVER_SCREEN_ID', 'beaver' ); - } - - public function initialize() { - - add_action( 'init', array( $this, 'register_assets' ), 50 ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ), 50 ); - - add_filter( 'toolset_filter_toolset_registered_user_editors', array( $this, 'register_user_editor' ) ); - add_filter( 'wpv_filter_wpv_layout_template_extra_attributes', array( $this, 'layout_template_attribute' ), 10, 3 ); - add_action( 'wpv_action_wpv_ct_inline_user_editor_buttons', array( $this, 'register_inline_editor_action_buttons' ) ); - - // Post edit page integration - add_action( 'edit_form_after_title', array( $this, 'prevent_nested' ) ); - - add_action( 'wp_ajax_toolset_user_editors_beaver', array( $this, 'ajax' ) ); - } - - - - public function is_active() { - if ( ! $this->set_medium_as_post() ) { - return false; - } - - $this->action(); - return true; - } - - private function action() { - add_action( 'admin_enqueue_scripts', array( $this, 'action_assets' ) ); - $this->medium->set_html_editor_backend( array( $this, 'html_output' ) ); - $this->medium->page_reload_after_backend_save(); - } - - public function ajax() { - if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'toolset_user_editors_beaver' ) ) { - die(); - } - - if( isset( $_REQUEST['post_id'] ) - && isset( $_REQUEST['template_path'] ) - && isset( $_REQUEST['preview_domain'] ) - && isset( $_REQUEST['preview_slug'] ) - ) { - $this->store_template_settings( - (int) $_REQUEST['post_id'], - $_REQUEST['template_path'], - sanitize_text_field( $_REQUEST['preview_domain'] ), - sanitize_text_field( $_REQUEST['preview_slug'] ) - ); - } - - die( 1 ); - } - - private function store_template_settings( $post_id, $template_path, $preview_domain, $preview_slug ) { - $settings = array( - 'template_path' => $template_path, - 'preview_domain' => $preview_domain, - 'preview_slug' => $preview_slug - ); - - update_post_meta( $post_id, $this->editor->get_option_name(), $settings ); - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - // Content Template own edit screen assets - - $toolset_assets_manager->register_style( - 'toolset-user-editors-beaver-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/beaver/backend.css', - array(), - TOOLSET_COMMON_VERSION - ); - - $toolset_assets_manager->register_script( - 'toolset-user-editors-beaver-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/beaver/backend.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - $toolset_assets_manager->localize_script( - 'toolset-user-editors-beaver-script', - 'toolset_user_editors_beaver', - array( - 'nonce' => wp_create_nonce( 'toolset_user_editors_beaver' ), - 'mediumId' => $this->medium->get_id() - ) - ); - - // Content Template as inline object assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-beaver-layout-template-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/beaver/backend_layout_template.js', - array( 'jquery', 'views-layout-template-js', 'underscore' ), - TOOLSET_COMMON_VERSION, - true - ); - - $beaver_layout_template_i18n = array( - 'template_editor_url' => admin_url( 'admin.php?page=ct-editor' ), - 'template_overlay' => array( - 'title' => sprintf( __( 'You created this template using %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'button' => sprintf( __( 'Edit with %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'discard' => sprintf( __( 'Stop using %1$s for this Content Template', 'wpv-views' ), $this->editor->get_name() ) - ), - ); - $toolset_assets_manager->localize_script( - 'toolset-user-editors-beaver-layout-template-script', - 'toolset_user_editors_beaver_layout_template_i18n', - $beaver_layout_template_i18n - ); - - } - - public function admin_enqueue_assets() { - if ( $this->is_views_or_wpa_edit_page() ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-beaver-layout-template-script' ) ); - } - } - - public function action_assets() { - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-beaver-style' ) ); - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-beaver-script' ) ); - } - - protected function get_allowed_templates() { - return ; - } - - private function set_medium_as_post() { - $medium_id = $this->medium->get_id(); - - if( ! $medium_id ) { - return false; - } - - $medium_post_object = get_post( $medium_id ); - if( $medium_post_object === null ) { - return false; - } - - $this->post = $medium_post_object; - - // beaver uses the global $post - global $post; - $post = $this->post; - - return true; - } - - /** - * Content Template editor output. - * - * Displays the Beavr Builder message and button to fire up the frontend editor. - * - * @since 2.2 - */ - - public function html_output() { - - if( ! isset( $_GET['ct_id'] ) ) { - return 'No valid content template id'; - } - - ob_start(); - include_once( dirname( __FILE__ ) . '/backend.phtml' ); - $output = ob_get_contents(); - ob_end_clean(); - - $admin_url = admin_url( 'admin.php?page=ct-editor&ct_id=' . esc_attr( $_GET['ct_id'] ) ); - $output .= '

      ' - . sprintf( - __( '%1$sStop using %2$s for this Content Template%3$s', 'wpv-views' ), - '', - $this->editor->get_name(), - '' - ) - . '

      '; - - return $output; - } - - public function register_user_editor( $editors ) { - $editors[ $this->editor->get_id() ] = $this->editor->get_name(); - return $editors; - } - - /** - * Set the builder used by a Content Template, if any. - * - * On a Content Template used inside a View or WPA loop output, we set which builder it is using - * so we can link to the CT edit page with the right builder instantiated. - * - * @since 2.2.0 - */ - - public function layout_template_attribute( $attributes, $content_template, $view_id ) { - $content_template_has_beaver = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'BEAVER_SCREEN_ID' ) ); - if ( $content_template_has_beaver ) { - $attributes['builder'] = $this->editor->get_id(); - } - return $attributes; - } - - /** - * Display a warning on post edit pages when: - * - Beaver Builder is active on that post - * - The post is using a Content Template that also has Beaver Builder active - * - * @param $post WP_Post object - * - * @since 2.2 - */ - - public function prevent_nested( $post ) { - - $beaver_post_types = FLBuilderModel::get_post_types(); - - if ( in_array( $post->post_type, $beaver_post_types ) ) { - $post_has_ct = get_post_meta( $post->ID, '_views_template', true ); - $ct_has_beaver = false; - if ( $post_has_ct ) { - $ct_has_beaver = ( get_post_meta( $post_has_ct, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'BEAVER_SCREEN_ID' ) ); - } - $post_has_beaver = get_post_meta( $post->ID, '_fl_builder_enabled', true ); - if ( - $ct_has_beaver - && $post_has_beaver - ) { - $post_type_object = get_post_type_object( $post->post_type ); - $ct_title = get_the_title( $post_has_ct ); - ?> -
      -

      ', - $this->editor->get_name(), - $this->editor->get_name() - ); ?>

      -

      - %2$s created by %3$s for %4$s. This may work, but could produce visual glitches. Please consider using %5$s only for the template OR for this page.', 'wpv-views' ), - $this->editor->get_name(), - $ct_title, - $this->editor->get_name(), - '' . $post_type_object->labels->name . '', - $this->editor->get_name() - ); ?> -

      -

      - ', - $this->editor->get_name(), - '' - ); ?> -

      -
      - ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'BEAVER_SCREEN_ID' ) ); - ?> - - medium->get_frontend_templates(); -?> - -
      - -

      editor->get_name() ); ?>

      - - -

      - -

      - - - -

      - ' . $template['form-option-label'] . '' - ); - ?> -

      - - - - medium->get_id(), $this->editor->get_option_name(), true ); ?> - -

      - -

      - - -

      - -

      - - - - - -
      diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend_layout_template.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend_layout_template.js deleted file mode 100644 index 5c0a003..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/backend_layout_template.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Backend script for the Content Template editor for Beaver Builder, - * as loop elements in Views and WordPress Archives Loop output sections. - * This initializes the Beaver Builder overlay anc handles the change in user editor to BB. - * - * @summary Inline Content Template editor manager for Beaver Builder compatibility,. - * - * @since 2.3.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_beaver_layout_template_i18n */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.BeaverBuilderBackendLayoutTemplate = function( $ ) { - - var self = this; - - self.selector = '.js-wpv-ct-listing'; - self.template_selector = '#js-wpv-layout-template-overlay-template'; - self.overlayContainer = _.template( jQuery( self.template_selector ).html() ); - self.i18n_data = { - title: toolset_user_editors_beaver_layout_template_i18n.template_overlay.title, - url: toolset_user_editors_beaver_layout_template_i18n.template_editor_url, - button: toolset_user_editors_beaver_layout_template_i18n.template_overlay.button, - discard: toolset_user_editors_beaver_layout_template_i18n.template_overlay.discard, - }; - - self.initBeaverEditors = function() { - $( self.selector ).each( function() { - self.initBeaverEditor( $( this ) ); - }); - return self; - }; - - self.initBeaverEditor = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - // This has been inited before, or it is rendered closed - return self; - } - var attributes = item.data( 'attributes' ); - _.defaults( attributes, { builder: 'basic' } ); - if ( attributes.builder == 'beaver' ) { - item.addClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.find( '.js-wpv-ct-apply-user-editor:not(.js-wpv-ct-apply-user-editor-beaver)' ).prop( 'disabled', false ); - item.prepend( self.overlayContainer( self.i18n_data ) ); - item.find( '.CodeMirror' ).css( { 'height' : '0px'} ); - self.updateBeaverCTEditorLinkTarget( item ); - } - return self; - }; - - self.reloadBeaverEditorsLinkTarget = function() { - $( self.selector ).each( function() { - self.updateBeaverCTEditorLinkTarget( $( this ) ); - }); - return self; - }; - - self.updateBeaverCTEditorLinkTarget = function( item ) { - var ctEditorLink = item.find( '.js-wpv-layout-template-overlay-info-link' ), - ctEditorLinkTarget = toolset_user_editors_beaver_layout_template_i18n.template_editor_url + '&ct_id=' + item.data( 'id' ), - queryMode = Toolset.hooks.applyFilters( 'wpv-filter-wpv-edit-screen-get-query-mode', 'normal' ); - switch ( queryMode ) { - case 'normal': - var queryType = $( '.js-wpv-query-type:checked' ).val(); - switch ( queryType ) { - case 'posts': - $('.js-wpv-query-post-type:checked').map( function() { - ctEditorLinkTarget += '&preview_post_type[]=' + $( this ).val(); - }); - break; - case 'taxonomy': - $('.js-wpv-query-taxonomy-type:checked').map( function() { - ctEditorLinkTarget += '&preview_taxonomy[]=' + $( this ).val(); - }); - break; - case 'users': - $('.js-wpv-query-users-type:checked').map( function() { - ctEditorLinkTarget += '&preview_user[]=' + $( this ).val(); - }); - break; - } - break; - case 'archive': - $( '.js-wpv-settings-archive-loop input:checked' ).map( function() { - switch ( $( this ).data( 'type' ) ) { - case 'native': - - break; - case 'post_type' : - ctEditorLinkTarget += '&preview_post_type_archive[]=' + $( this ).data( 'name' ); - break; - case 'taxonomy': - ctEditorLinkTarget += '&preview_taxonomy_archive[]=' + $( this ).data( 'name' ); - break; - } - }); - break; - } - ctEditorLink.attr( 'href', ctEditorLinkTarget ); - return self; - }; - - $( document ).on( 'js_event_wpv_query_type_options_saved', '.js-wpv-query-type-update', function( event, queryType ) { - self.reloadBeaverEditorsLinkTarget(); - }); - - self.setInlineContentTemplateEvents = function( templateId ) { - self.initBeaverEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }; - - $( document ).on( 'js_event_wpv_ct_inline_editor_inited', function( event, templateId ) { - self.initBeaverEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }); - - self.setUserEditorToBeaver = function( ctId ) { - var item = $( '.js-wpv-ct-listing-' + ctId, '.js-wpv-inline-content-template-listing' ), - attributes = item.data( 'attributes' ); - - attributes.builder = 'beaver'; - item.data( 'attributes', attributes ); - - if ( item.find( '.CodeMirror' ).length == 0 ) { - item.find( '.js-wpv-content-template-open' ).trigger( 'click' ); - } else { - self.initBeaverEditor( item ); - } - }; - - self.initHooks = function() { - Toolset.hooks.addAction( 'wpv-action-wpv-set-inline-content-template-events', self.setInlineContentTemplateEvents ); - Toolset.hooks.addAction( 'toolset-action-toolset-set-user-editor-to-beaver', self.setUserEditorToBeaver ); - return self; - }; - - self.init = function() { - self.initBeaverEditors() - .initHooks(); - - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.BeaverBuilderBackendLayoutTemplateInstance = new ToolsetCommon.UserEditor.BeaverBuilderBackendLayoutTemplate( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend-editor-template-fallback.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend-editor-template-fallback.php deleted file mode 100644 index fa0ed44..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend-editor-template-fallback.php +++ /dev/null @@ -1,15 +0,0 @@ -action(); - return true; - } - - private function action() { - // todo move to content-template frontend-editor as this is independent of the user editor - // Caution! this depends on the current editor option name, as different editors might store different templates (?) - // we need to change the frontend editor template - add_filter( 'template_include', array( $this, 'frontend_editor_template_file' ) ); - } - - public function add_beaver_inputs_to_dialog_for_any_input( $shortcodes_gui_translations ) { - - $shortcodes_gui_translations['integrated_inputs'][] = '.fl-lightbox-content input:text'; - - return $shortcodes_gui_translations; - - } - - public function frontend_editor_template_file( $template_file ) { - global $post; - - if( $post->post_type != $this->medium->get_slug() ) { - return $template_file; - } - - $template_selected_usage = $this->get_frontend_editor_template_file( $post->ID ); - - add_filter( 'get_the_excerpt', array( $this, 'get_ontent_instead_of_excerpt' ) ); - - return $template_selected_usage; - - } - - public function get_ontent_instead_of_excerpt( $excerpt ) { - ob_start(); - the_content(); - $content = ob_get_contents(); - ob_end_clean(); - return $content; - } - - private function get_frontend_editor_template_file( $ct_id ) { - $stored_template = get_post_meta( $ct_id, $this->editor->get_option_name(), true ); - $stored_template = array_key_exists( 'template_path', $stored_template ) - ? $stored_template['template_path'] - : false; - - if( $stored_template ) { - return $stored_template; - } - - // shouldn't happen - return dirname( __FILE__ ) . '/frontend-editor-template-fallback.php'; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php deleted file mode 100644 index fa3edc1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/beaver/frontend.php +++ /dev/null @@ -1,279 +0,0 @@ -beaver_filter_enabled = true; - $this->beaver_post_id_stack = array(); - $this->beaver_post_id_assets_rendered = array(); - - } - - public function is_active() { - return true; - } - - // @todo we need to set the $authordata global, but we need to use it on do_shortcode - // which happens after this filter callback, and as we need to restore after rendering - // we can not do it here - public function before_render_shortcodes( $content ) { - /* - global $authordata; - $authordata_old = $authordata; - $current_post_id = FLBuilderModel::get_post_id(); - if ( $current_post_id ) { - $current_post_author = get_post_field( 'post_author', $current_post_id ); - $authordata = new WP_User( $current_post_author ); - } - */ - $content = WPV_Frontend_Render_Filters::pre_process_shortcodes( $content ); - /* - $authordata = $authordata_old; - */ - return $content; - } - - public function filter_support_medium( $allowed_types ) { - if( ! is_array( $allowed_types ) ) { - return array( $this->medium->get_slug() ); - } - $medium_slug = $this->medium->get_slug(); - if ( ! in_array( $medium_slug, $allowed_types ) ) { - $allowed_types[] = $medium_slug; - } - return $allowed_types; - } - - public function body_class( $classes ) { - if ( ! is_archive() ) { - $current_post = get_post( FLBuilderModel::get_post_id() ); - if ( $current_post ) { - $post_has_ct = get_post_meta( $current_post->ID, '_views_template', true ); - if ( $post_has_ct ) { - $ct_has_beaver = get_post_meta( $post_has_ct, '_fl_builder_enabled', true ); - if ( $ct_has_beaver ) { - $classes[] = 'fl-builder'; - } - } - } - } - return $classes; - } - - public function filter_content_template_output( $content, $template_selected, $id, $kind ) { - - if ( - $template_selected - && $template_selected > 0 - ) { - - // There is a CT applied, either on single/archive pages or on a wpv-post-body shortcode - // Render the BB content of the CT, if any, and prevent Beaver from overwriting it - - $editor_choice = get_post_meta( $template_selected, $this->medium->get_option_name_editor_choice(), true ); - - if ( - $editor_choice - && $editor_choice == $this->editor->get_id() - ) { - - FLBuilderModel::update_post_data( 'post_id', $template_selected ); - - $this->beaver_post_id_stack[] = $template_selected; - - // In order to render the content template output, Beaver Builder checks, among others, the output of the "in_the_loop" function. - // When we try to render the content template output but have the "$wp_query->in_the_loop" set to false, the content template - // output won't get the Beaver Builder touch. - // Here we are faking being in the loop and reverting the setting back to it's previous state right after the content template output - // is produced. - global $wp_query; - $revert_in_the_loop = false; - if ( ! $wp_query->in_the_loop ) { - $revert_in_the_loop = true; - // Fake being in the loop. - $wp_query->in_the_loop = true; - } - - // In Beaver Builder 2.0, when the FLBuilder::render_content method is used, Beaver Builder is getting the - // post ID by forcing globals, which means that they force the use of WP globals instead of checking their - // internal post ID. - // The WP globals contains the post currently rendered and not the Content Template, so we need to temporarily - // set the Content Template in the $wp_the_query (which they use) and then put the old post in its place - // after the content is rendered. - global $wp_the_query; - $wp_the_query_post = $wp_the_query->post; - if ( (int) $template_selected !== $wp_the_query_post->ID ) { - $ct_post = get_post( $template_selected ); - $wp_the_query->post = $ct_post; - } - - $content = FLBuilder::render_content( $content ); - - // If the post inside the $wp_the_query global has been substituted by the Content Template, we are putting - // it back. - if ( $wp_the_query->post->ID !== $wp_the_query_post->ID ) { - $wp_the_query->post = $wp_the_query_post; - } - - if ( $revert_in_the_loop ) { - $wp_query->in_the_loop = false; - } - - if ( ! in_array( $template_selected, $this->beaver_post_id_assets_rendered ) ) { - // When having a Beaver Builder styled Content Template inside a Beaver Builder styled page we need to - // change the current post id for the Beaver Builder model in order to load the style of the Content - // Template instead of the page style. - FLBuilderModel::set_post_id( $template_selected ); - - FLBuilder::enqueue_layout_styles_scripts(); - - // After the Beaver Builder styled Content Template styles are loaded, we are reverting the model's id - // back to the id of the page. - FLBuilderModel::reset_post_id( $template_selected ); - - $this->beaver_post_id_assets_rendered[] = $template_selected; - } - - array_pop( $this->beaver_post_id_stack ); - if ( count( $this->beaver_post_id_stack ) > 0 ) { - $aux_array = array_slice( $this->beaver_post_id_stack, -1 ); - $bb_post_id = array_pop( $aux_array ); - FLBuilderModel::update_post_data( 'post_id', $bb_post_id ); - } else { - FLBuilderModel::update_post_data( 'post_id', get_the_ID() ); - } - - } - - remove_filter( 'the_content', 'FLBuilder::render_content' ); - $this->beaver_filter_enabled = false; - - } else { - global $post; - if ( isset( $post->view_template_override ) ) { - $this_id = get_the_ID(); - // This is coming from a wpv-post-body shortcode with view_template="None" so we do need to apply BB here - FLBuilderModel::update_post_data( 'post_id', $this_id ); - - $this->beaver_post_id_stack[] = $this_id; - - $content = FLBuilder::render_content( $content ); - - if ( isset( $template_selected ) && ! in_array( $template_selected, $this->beaver_post_id_assets_rendered ) ) { - //FLBuilder::enqueue_layout_styles_scripts(); - $this->beaver_post_id_assets_rendered[] = $this_id; - } - - array_pop( $this->beaver_post_id_stack ); - if ( count( $this->beaver_post_id_stack ) > 0 ) { - $aux_array = array_slice( $this->beaver_post_id_stack, -1 ); - $bb_post_id = array_pop( $aux_array ); - FLBuilderModel::update_post_data( 'post_id', $bb_post_id ); - } - - } - } - - return $content; - } - - public function restore_beaver_filter( $content ) { - if ( ! $this->beaver_filter_enabled ) { - add_filter( 'the_content', 'FLBuilder::render_content' ); - } - return $content; - } - - public function filter_archive_content( $content, $template_selected, $id, $kind ) { - - if( $this->get_active_medium_id() && $this->get_active_medium_id() == $template_selected ) { - FLBuilderModel::update_post_data( 'post_id', $this->get_active_medium_id() ); - $content = FLBuilder::render_content( $content ); - } - - - return $content; - } - - /** - * Beaver is looking for $_POST['post_id'] first, to select content - * we use that to get beaver content of our medium id - */ - public function action_globalize_medium_id() { - if( $this->get_active_medium_id() ) - FLBuilderModel::update_post_data( 'post_id', $this->get_active_medium_id() ); - } - - private function get_active_medium_id() { - if( $this->active_medium_id === null ) - $this->active_medium_id = $this->fetch_active_medium_id(); - - return $this->active_medium_id; - } - - private function fetch_active_medium_id() { - $medium_id = $this->medium->get_id(); - - $editor_choice = get_post_meta( $medium_id, $this->medium->get_option_name_editor_choice(), true ); - - if( - $editor_choice - && $editor_choice == $this->editor->get_id() - && isset( $medium_id ) && $medium_id - ) - return $medium_id; - - - return false; - } - - public function action_set_post_id_for_views_body_shortcode() { - add_filter( 'the_content', 'FLBuilder::render_content' ); - FLBuilderModel::update_post_data( 'post_id', get_the_ID() ); - - add_filter( 'wpv_filter_content_template_output', 'FLBuilder::render_content' ); - } - - public function action_set_medium_id_after_views_body_shortcode() { - remove_filter( 'the_content', 'FLBuilder::render_content' ); - - if( $this->get_active_medium_id() ) - FLBuilderModel::update_post_data( 'post_id', $this->get_active_medium_id() ); - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.css deleted file mode 100644 index 44285a2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.css +++ /dev/null @@ -1,5 +0,0 @@ -.toolset-user-editors-divi-backend { - background: #fff; - padding: 20px 20px 40px; - text-align: center; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.php deleted file mode 100644 index f04a71a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.php +++ /dev/null @@ -1,260 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - $this->constants->define( 'DIVI_SCREEN_ID', 'divi' ); - } - - public function initialize() { - add_action( 'init', array( $this, 'register_assets' ), 50 ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ), 50 ); - - add_filter( 'toolset_filter_toolset_registered_user_editors', array( $this, 'register_user_editor' ) ); - add_filter( 'wpv_filter_wpv_layout_template_extra_attributes', array( $this, 'layout_template_attribute' ), 10, 3 ); - - add_action( 'wpv_action_wpv_ct_inline_user_editor_buttons', array( $this, 'register_inline_editor_action_buttons' ) ); - - add_action( 'toolset_set_layout_template_user_editor_divi', array( $this, 'update_divi_builder_post_meta' ) ); - add_action( 'toolset_set_layout_template_user_editor_basic', array( $this, 'update_divi_builder_post_meta' ) ); - - if ( $this->divi_tries_to_load_layouts_or_templates() ) { - add_filter( 'et_pb_show_all_layouts_built_for_post_type', array( $this, 'make_view_template_similar_to_page_for_layouts_or_templates' ) ); - } - } - - public function is_active() { - if ( ! $this->set_medium_as_post() ) { - return false; - } - - $this->action(); - - return true; - } - - private function action() { - add_action( 'admin_enqueue_scripts', array( $this, 'action_enqueue_assets' ) ); - $this->medium->set_html_editor_backend( array( $this, 'html_output' ) ); - $this->medium->page_reload_after_backend_save(); - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - // Content Template own edit screen assets - - $toolset_assets_manager->register_style( - 'toolset-user-editors-divi-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/divi/backend.css', - array(), - TOOLSET_COMMON_VERSION - ); - - // Native post editor screen assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-divi-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/divi/backend_editor.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - // Content Template as inline object assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-divi-layout-template-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/divi/backend_layout_template.js', - array( 'jquery', 'views-layout-template-js', 'underscore' ), - TOOLSET_COMMON_VERSION, - true - ); - - $divi_layout_template_i18n = array( - 'template_editor_url' => admin_url( 'admin.php?page=ct-editor' ), - 'template_overlay' => array( - 'title' => sprintf( __( 'You created this template using %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'button' => sprintf( __( 'Edit with %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'discard' => sprintf( __( 'Stop using %1$s for this Content Template', 'wpv-views' ), $this->editor->get_name() ), - ), - ); - - $toolset_assets_manager->localize_script( - 'toolset-user-editors-divi-layout-template-script', - 'toolset_user_editors_divi_layout_template_i18n', - $divi_layout_template_i18n - ); - } - - public function admin_enqueue_assets() { - if ( $this->is_views_or_wpa_edit_page() ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-divi-layout-template-script' ) ); - } - } - - public function action_enqueue_assets() { - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-divi-style' ) ); - } - - private function set_medium_as_post() { - $medium_id = $this->medium->get_id(); - - if ( ! $medium_id ) { - return false; - } - - $medium_post_object = get_post( $medium_id ); - if ( null === $medium_post_object ) { - return false; - } - - $this->post = $medium_post_object; - - return true; - } - - public function register_user_editor( $editors ) { - $editors[ $this->editor->get_id() ] = $this->editor->get_name(); - return $editors; - } - - /** - * Content Template editor output. - * - * Displays the Native Editor message and button to fire it up. - * - * @since 2.5.0 - */ - - public function html_output() { - - if ( ! isset( $_GET['ct_id'] ) ) { - return 'No valid content template id'; - } - - ob_start(); - include_once( dirname( __FILE__ ) . '/backend.phtml' ); - $output = ob_get_contents(); - ob_end_clean(); - - $admin_url = admin_url( 'admin.php?page=ct-editor&ct_id=' . esc_attr( $_GET['ct_id'] ) ); - $output .= '

      ' - . sprintf( - __( '%1$sStop using %2$s for this Content Template%3$s', 'wpv-views' ), - '', - $this->editor->get_name(), - '' - ) - . '

      '; - - return $output; - } - - public function register_inline_editor_action_buttons( $content_template ) { - $content_template_has_divi = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'DIVI_SCREEN_ID' ) ); - ?> - - ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'DIVI_SCREEN_ID' ) ); - if ( $content_template_has_divi ) { - $attributes['builder'] = $this->editor->get_id(); - } - return $attributes; - } - - public function update_divi_builder_post_meta() { - if ( - isset( $_POST['ct_id'] ) - && $_POST['ct_id'] - ) { - do_action( 'toolset_update_divi_builder_post_meta', $_POST['ct_id'], 'editor' ); - } - } - - /** - * Divi saves it's layouts and templates for the 'page' post type. In order to fetch those layouts or templates for - * "view-template" post type, we need to do it the same way Divi does it for the 'post' and 'project' post type. - * When the current post type is 'post', Divi replaces that with an array containing the current post type and the - * 'page' post type. So for the case of 'view-template', we are also adding the 'page' post type to the returned value. - * - * @param $post_types - * - * @return array The post types to fetch layouts or template for. - */ - public function make_view_template_similar_to_page_for_layouts_or_templates( $post_types ) { - if ( ! is_array( $post_types ) ) { - $post_types = array( $post_types ); - } - $post_types[] = 'page'; - - return $post_types; - } - - /** - * Detect whether or not Divi performs an AJAX call to load layouts or templates from its library. - * - * @return bool - */ - public function divi_tries_to_load_layouts_or_templates() { - if ( - ! defined( 'DOING_AJAX' ) - || ! DOING_AJAX - || ! isset( $_POST['action'] ) - ) { - return false; - } - - if ( - 'et_pb_show_all_layouts' === $_POST['action'] - && isset( $_POST['et_layouts_built_for_post_type'] ) - && 'view-template' === $_POST['et_layouts_built_for_post_type'] - ) { - return true; - } - - if ( - 'et_pb_get_saved_templates' === $_POST['action'] - && isset( $_POST['et_post_type'] ) - && 'view-template' === $_POST['et_post_type'] - ) { - return true; - } - - return false; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.phtml b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.phtml deleted file mode 100644 index 0de9c8d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend.phtml +++ /dev/null @@ -1,42 +0,0 @@ -medium->get_frontend_templates(); -?> - -
      -

      editor->get_name() ); ?>

      - -

      - ' . $template['form-option-label'] . '' - ); - ?> -

      - -

      - -

      - -
      - - - -
      -
      \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend_editor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend_editor.js deleted file mode 100644 index 1b72922..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend_editor.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Backend script for the native post editor when editing Content Templates using Divi Builder. - * - * @summary Content Template editor manager for Divi Builder using the native editor compatibility. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_native */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.DiviEditor = function( $ ) { - - var self = this; - - self.init = function() { - $( '#et_pb_toggle_builder' ).remove(); - - /** - * When Content Templates are edited using either the native post editor or a page builder, WordPress keeps autosave - * data in the browser's local storage even though revisions are off for this post type. In order to prevent relevant - * notifications to appear, we need to catch the heartbeat event and remove the needed data that will be used to - * create an autosave entry in the database. - */ - $( document ).on( 'heartbeat-send.bb-heartbeat', function( event, heartbeatData ){ - if( - typeof( heartbeatData.wp_autosave ) != 'undefined' - && typeof( heartbeatData.wp_autosave.post_type ) != 'undefined' - && heartbeatData.wp_autosave.post_type == 'view-template' - ) { - delete heartbeatData.wp_autosave; - } - }); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.DiviEditorInstance = new ToolsetCommon.UserEditor.DiviEditor( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend_layout_template.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend_layout_template.js deleted file mode 100644 index 3d73a04..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/backend_layout_template.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Backend script for the Content Template editor for Divi Builder using the native editor, - * as loop elements in Views and WordPress Archives Loop output sections. - * This initializes the Divi Builder using the native editor overlay and handles the change in user editor to Divi Builder using the native editor. - * - * @summary Inline Content Template editor manager for Divi Builder using the native editor compatibility,. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_divi_layout_template_i18n */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.DiviEditorBackendLayoutTemplate = function( $ ) { - - var self = this; - - self.selector = '.js-wpv-ct-listing'; - self.template_selector = '#js-wpv-layout-template-overlay-template'; - self.overlayContainer = _.template( jQuery( self.template_selector ).html() ); - self.i18n_data = { - title: toolset_user_editors_divi_layout_template_i18n.template_overlay.title, - url: toolset_user_editors_divi_layout_template_i18n.template_editor_url, - button: toolset_user_editors_divi_layout_template_i18n.template_overlay.button, - discard: toolset_user_editors_divi_layout_template_i18n.template_overlay.discard, - }; - - self.initDiviEditors = function() { - $( self.selector ).each( function() { - self.initDiviEditor( $( this ) ); - }); - return self; - }; - - self.initDiviEditor = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - // This has been inited before, or it is rendered closed - return self; - } - var attributes = item.data( 'attributes' ); - _.defaults( attributes, { builder: 'basic' } ); - if ( attributes.builder == 'divi' ) { - item.addClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.find( '.js-wpv-ct-apply-user-editor:not(.js-wpv-ct-apply-user-editor-divi)' ).prop( 'disabled', false ); - item.prepend( self.overlayContainer( self.i18n_data ) ); - item.find( '.CodeMirror' ).css( { 'height' : '0px'} ); - self.updateDiviCTEditorLinkTarget( item ); - } - return self; - }; - - self.reloadDiviEditorsLinkTarget = function() { - $( self.selector ).each( function() { - self.updateDiviCTEditorLinkTarget( $( this ) ); - }); - return self; - }; - - self.updateDiviCTEditorLinkTarget = function( item ) { - var ctEditorLink = item.find( '.js-wpv-layout-template-overlay-info-link' ), - ctEditorLinkTarget = toolset_user_editors_divi_layout_template_i18n.template_editor_url + '&ct_id=' + item.data( 'id' ), - queryMode = Toolset.hooks.applyFilters( 'wpv-filter-wpv-edit-screen-get-query-mode', 'normal' ); - switch ( queryMode ) { - case 'normal': - var queryType = $( '.js-wpv-query-type:checked' ).val(); - switch ( queryType ) { - case 'posts': - $('.js-wpv-query-post-type:checked').map( function() { - ctEditorLinkTarget += '&preview_post_type[]=' + $( this ).val(); - }); - break; - case 'taxonomy': - $('.js-wpv-query-taxonomy-type:checked').map( function() { - ctEditorLinkTarget += '&preview_taxonomy[]=' + $( this ).val(); - }); - break; - case 'users': - $('.js-wpv-query-users-type:checked').map( function() { - ctEditorLinkTarget += '&preview_user[]=' + $( this ).val(); - }); - break; - } - break; - case 'archive': - $( '.js-wpv-settings-archive-loop input:checked' ).map( function() { - switch ( $( this ).data( 'type' ) ) { - case 'native': - - break; - case 'post_type' : - ctEditorLinkTarget += '&preview_post_type_archive[]=' + $( this ).data( 'name' ); - break; - case 'taxonomy': - ctEditorLinkTarget += '&preview_taxonomy_archive[]=' + $( this ).data( 'name' ); - break; - } - }); - break; - } - ctEditorLink.attr( 'href', ctEditorLinkTarget ); - return self; - }; - - $( document ).on( 'js_event_wpv_query_type_options_saved', '.js-wpv-query-type-update', function( event, queryType ) { - self.reloadDiviEditorsLinkTarget(); - }); - - self.setInlineContentTemplateEvents = function( templateId ) { - self.initDiviEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }; - - $( document ).on( 'js_event_wpv_ct_inline_editor_inited', function( event, templateId ) { - self.initDiviEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }); - - self.setUserEditorToDivi = function( ctId ) { - var item = $( '.js-wpv-ct-listing-' + ctId, '.js-wpv-inline-content-template-listing' ), - attributes = item.data( 'attributes' ); - - attributes.builder = 'divi'; - item.data( 'attributes', attributes ); - - if ( item.find( '.CodeMirror' ).length == 0 ) { - item.find( '.js-wpv-content-template-open' ).trigger( 'click' ); - } else { - self.initDiviEditor( item ); - } - }; - - self.initHooks = function() { - Toolset.hooks.addAction( 'wpv-action-wpv-set-inline-content-template-events', self.setInlineContentTemplateEvents ); - Toolset.hooks.addAction( 'toolset-action-toolset-set-user-editor-to-divi', self.setUserEditorToDivi ); - return self; - }; - - self.init = function() { - self.initDiviEditors() - .initHooks(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.DiviEditorBackendLayoutTemplateInstance = new ToolsetCommon.UserEditor.DiviEditorBackendLayoutTemplate( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/frontend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/frontend.php deleted file mode 100644 index c4d4e34..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/divi/frontend.php +++ /dev/null @@ -1,110 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - } - - public function initialize() { - /** - * Filter Divi Builder ajax request exceptions to also include Views the selected Views ajax actions. - */ - add_filter( 'et_builder_load_requests', array( $this, 'add_divi_builder_request_expections' ) ); - - add_filter( 'et_get_option_et_divi_divi_use_excerpt', array( $this, 'prevent_the_excerpt_truncation' ), 10, 2 ); - - add_filter( 'wpv_filter_wpv_get_third_party_css', array( $this, 'set_custom_css_for_ct' ), 10, 2 ); - } - - /** - * Divi allows only a specific set of AJAX calls to access its data. The good thing is that it also provides a filter - * to add third party actions in this set of allowed calls. Here we are adding ours to enable custom search and pagination - * output to render Divi Builder content, when they are done using AJAX. - * - * @param array $load_requests The set of allowed actions. - * - * @return array The enriched array of allowed actions. - */ - public function add_divi_builder_request_expections( $load_requests ) { - - $load_requests['action'][] = 'wpv_get_view_query_results'; - $load_requests['action'][] = 'wpv_get_archive_query_results'; - - return $load_requests; - } - - /** - * Divi is using the custom function "truncate_post" to generate the archive post content. This custom function, - * though, checks for a Divi settings option to decide what to output. Here we are using a filter to override the - * saved value for this option and adjust it in a way that the "truncate_post" always returns the CT content. - * - * @param string $option_value The value of the option. - * @param string $option_name The name of the option. - * - * @return string The filtered option value. - */ - public function prevent_the_excerpt_truncation( $option_value, $option_name ) { - if ( 'et_divi_divi_use_excerpt' === $option_name ) { - $option_value = 'on'; - } - - return $option_value; - } - - /** - * Set the custom CSS of a Content Template built with Divi Builder, when a page assigned to that CT is loaded. - * - * @param string $custom_css The page's custom CSS. - * @param int $template_id The Content Template id. - * - * @return string The filtered custom CSS containing the Custom CSS of the CT used. - */ - public function set_custom_css_for_ct( $custom_css, $template_id ) { - if ( $this->is_divi_builder_used_in_ct( $template_id ) ) { - $custom_css .= get_post_meta( $template_id, '_et_pb_custom_css', true ); - } - - return $custom_css; - } - - /** - * Detect if Divi builder is used on the defined CT. - * - * @param int $template_id The id of the CT. - * - * @return bool Return true if Divi Builder is used for the defined CT or false otherwise. - */ - public function is_divi_builder_used_in_ct( $template_id ) { - $divi_builder_enabled = false; - if ( ! empty( $template_id ) ) { - $builder_selected = get_post_meta( $template_id, '_toolset_user_editors_editor_choice', true ); - if ( $this->constants->constant( 'DIVI_SCREEN_ID' ) === $builder_selected ) { - $divi_builder_enabled = true; - } - } - - return $divi_builder_enabled; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.css deleted file mode 100644 index 544a1de..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.css +++ /dev/null @@ -1,5 +0,0 @@ -.toolset-user-editors-gutenberg-backend { - background: #fff; - padding: 20px 20px 40px; - text-align: center; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.php deleted file mode 100644 index d4027e9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.php +++ /dev/null @@ -1,224 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - $this->constants->define( 'GUTENBERG_SCREEN_ID', 'gutenberg' ); - } - - public function initialize() { - add_action( 'init', array( $this, 'register_assets' ), 50 ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ), 50 ); - - add_action( 'edit_form_advanced', array( $this, 'register_assets_for_gutenberg_compatibility' ) ); - - add_filter( 'toolset_filter_toolset_registered_user_editors', array( $this, 'register_user_editor' ) ); - add_filter( 'wpv_filter_wpv_layout_template_extra_attributes', array( $this, 'layout_template_attribute' ), 10, 3 ); - - add_action( 'wpv_action_wpv_ct_inline_user_editor_buttons', array( $this, 'register_inline_editor_action_buttons' ) ); - } - - /** - * Check if current editor is active. - * - * @return bool - * - * @refactoring Change the name of the following function as it is confusing. - * Warning!!! This has to be changed for all editors, otherwise it will break the editors integration. - */ - public function is_active() { - if ( ! $this->set_medium_as_post() ) { - return false; - } - - $this->action(); - - return true; - } - - private function action() { - add_action( 'admin_enqueue_scripts', array( $this, 'action_enqueue_assets' ) ); - $this->medium->set_html_editor_backend( array( $this, 'html_output' ) ); - $this->medium->page_reload_after_backend_save(); - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - // Content Template own edit screen assets - - $toolset_assets_manager->register_style( - 'toolset-user-editors-gutenberg-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/gutenberg/backend.css', - array(), - TOOLSET_COMMON_VERSION - ); - - $toolset_assets_manager->register_style( - 'toolset-user-editors-gutenberg-editor-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/gutenberg/backend_editor.css', - array(), - TOOLSET_COMMON_VERSION - ); - - // Native post editor screen assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-gutenberg-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/gutenberg/backend_editor.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - // Content Template as inline object assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-gutenberg-layout-template-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/gutenberg/backend_layout_template.js', - array( 'jquery', 'views-layout-template-js', 'underscore' ), - TOOLSET_COMMON_VERSION, - true - ); - - $gutenberg_layout_template_i18n = array( - 'template_editor_url' => admin_url( 'admin.php?page=ct-editor' ), - 'template_overlay' => array( - 'title' => sprintf( __( 'You created this template using %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'button' => sprintf( __( 'Edit with %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'discard' => sprintf( __( 'Stop using %1$s for this Content Template', 'wpv-views' ), $this->editor->get_name() ), - ), - ); - - $toolset_assets_manager->localize_script( - 'toolset-user-editors-gutenberg-layout-template-script', - 'toolset_user_editors_gutenberg_layout_template_i18n', - $gutenberg_layout_template_i18n - ); - } - - public function admin_enqueue_assets() { - if ( $this->is_views_or_wpa_edit_page() ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-gutenberg-layout-template-script' ) ); - } - } - - public function action_enqueue_assets() { - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-gutenberg-style' ) ); - } - - private function set_medium_as_post() { - $medium_id = $this->medium->get_id(); - - if ( ! $medium_id ) { - return false; - } - - $medium_post_object = get_post( $medium_id ); - if ( null === $medium_post_object ) { - return false; - } - - $this->post = $medium_post_object; - - return true; - } - - public function register_user_editor( $editors ) { - $editors[ $this->editor->get_id() ] = $this->editor->get_name(); - return $editors; - } - - /** - * Content Template editor output. - * - * Displays the Native Editor message and button to fire it up. - * - * @since 2.5.1 - */ - - public function html_output() { - - if ( ! isset( $_GET['ct_id'] ) ) { - return 'No valid content template id'; - } - - ob_start(); - include_once( dirname( __FILE__ ) . '/backend.phtml' ); - $output = ob_get_contents(); - ob_end_clean(); - - $admin_url = admin_url( 'admin.php?page=ct-editor&ct_id=' . esc_attr( $_GET['ct_id'] ) ); - $output .= '

      ' - . sprintf( - __( '%1$sStop using %2$s for this Content Template%3$s', 'wpv-views' ), - '', - $this->editor->get_name(), - '' - ) - . '

      '; - - return $output; - } - - public function register_inline_editor_action_buttons( $content_template ) { - $content_template_has_gutenberg = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'GUTENBERG_SCREEN_ID' ) ); - ?> - - ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'GUTENBERG_SCREEN_ID' ) ); - if ( $content_template_has_gutenberg ) { - $attributes['builder'] = $this->editor->get_id(); - } - return $attributes; - } - - public function register_assets_for_gutenberg_compatibility( $content_template ) { - $content_template_has_gutenberg = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'GUTENBERG_SCREEN_ID' ) ); - if ( $content_template_has_gutenberg ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-gutenberg-script' ) ); - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-gutenberg-editor-style' ) ); - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.phtml b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.phtml deleted file mode 100644 index 00da08a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.phtml +++ /dev/null @@ -1,42 +0,0 @@ -medium->get_frontend_templates(); -?> - -
      -

      editor->get_name() ); ?>

      - -

      - ' . $template['form-option-label'] . '' - ); - ?> -

      - -

      - -

      - -
      - - - -
      -
      \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_editor.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_editor.css deleted file mode 100644 index 0f043f0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_editor.css +++ /dev/null @@ -1,3 +0,0 @@ -.edit-post-post-status, .editor-meta-boxes-panel { - display: none !important; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_editor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_editor.js deleted file mode 100644 index d08646b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_editor.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Backend script to be used when editing Content Templates using Gutenberg Editor. - * - * @summary Content Template editor manager for Gutenberg Editor. - * - * @since 2.6.9 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_native */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.GutenbergEditor = function( $ ) { - - var self = this; - - self.init = function() { - // The following two lines are a fix for the Gutenberg issue where the admin notices are hidden behind the Editor - // toolbar. They can be removed when https://github.com/WordPress/gutenberg/issues/3395 is fixed. - $( '.toolset-notice-wp' ).appendTo( '.components-notice-list' ); - $( '.components-notice-list' ).css( 'position', 'initial' ); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.GutenbergEditorInstance = new ToolsetCommon.UserEditor.GutenbergEditor( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_layout_template.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_layout_template.js deleted file mode 100644 index 341653d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend_layout_template.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Backend script for the Content Template editor for Divi Builder using the native editor, - * as loop elements in Views and WordPress Archives Loop output sections. - * This initializes the Divi Builder using the native editor overlay and handles the change in user editor to Divi Builder using the native editor. - * - * @summary Inline Content Template editor manager for Divi Builder using the native editor compatibility,. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_gutenberg_layout_template_i18n */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.GutenbergEditorBackendLayoutTemplate = function( $ ) { - - var self = this; - - self.selector = '.js-wpv-ct-listing'; - self.template_selector = '#js-wpv-layout-template-overlay-template'; - self.overlayContainer = _.template( jQuery( self.template_selector ).html() ); - self.i18n_data = { - title: toolset_user_editors_gutenberg_layout_template_i18n.template_overlay.title, - url: toolset_user_editors_gutenberg_layout_template_i18n.template_editor_url, - button: toolset_user_editors_gutenberg_layout_template_i18n.template_overlay.button, - discard: toolset_user_editors_gutenberg_layout_template_i18n.template_overlay.discard, - }; - - self.initGutenbergEditors = function() { - $( self.selector ).each( function() { - self.initGutenbergEditor( $( this ) ); - }); - return self; - }; - - self.initGutenbergEditor = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - // This has been inited before, or it is rendered closed - return self; - } - var attributes = item.data( 'attributes' ); - _.defaults( attributes, { builder: 'basic' } ); - if ( attributes.builder == 'gutenberg' ) { - item.addClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.find( '.js-wpv-ct-apply-user-editor:not(.js-wpv-ct-apply-user-editor-gutenberg)' ).prop( 'disabled', false ); - item.prepend( self.overlayContainer( self.i18n_data ) ); - item.find( '.CodeMirror' ).css( { 'height' : '0px'} ); - self.updateGutenbergCTEditorLinkTarget( item ); - } - return self; - }; - - self.reloadGutenbergEditorsLinkTarget = function() { - $( self.selector ).each( function() { - self.updateGutenbergCTEditorLinkTarget( $( this ) ); - }); - return self; - }; - - self.updateGutenbergCTEditorLinkTarget = function( item ) { - var ctEditorLink = item.find( '.js-wpv-layout-template-overlay-info-link' ), - ctEditorLinkTarget = WPV_Toolset.Utils.updateUrlQuery( 'ct_id', item.data( 'id' ), toolset_user_editors_gutenberg_layout_template_i18n.template_editor_url ), - queryMode = Toolset.hooks.applyFilters( 'wpv-filter-wpv-edit-screen-get-query-mode', 'normal' ); - switch ( queryMode ) { - case 'normal': - var queryType = $( '.js-wpv-query-type:checked' ).val(); - switch ( queryType ) { - case 'posts': - $('.js-wpv-query-post-type:checked').map( function() { - ctEditorLinkTarget = WPV_Toolset.Utils.updateUrlQuery( 'preview_post_type[]', $( this ).val(), ctEditorLinkTarget ); - }); - break; - case 'taxonomy': - $('.js-wpv-query-taxonomy-type:checked').map( function() { - ctEditorLinkTarget = WPV_Toolset.Utils.updateUrlQuery( 'preview_taxonomy[]', $( this ).val(), ctEditorLinkTarget ); - }); - break; - case 'users': - $('.js-wpv-query-users-type:checked').map( function() { - ctEditorLinkTarget = WPV_Toolset.Utils.updateUrlQuery( 'preview_user[]', $( this ).val(), ctEditorLinkTarget ); - }); - break; - } - break; - case 'archive': - $( '.js-wpv-settings-archive-loop input:checked' ).map( function() { - switch ( $( this ).data( 'type' ) ) { - case 'native': - - break; - case 'post_type' : - ctEditorLinkTarget = WPV_Toolset.Utils.updateUrlQuery( 'preview_post_type_archive[]', $( this ).data( 'name' ), ctEditorLinkTarget ); - break; - case 'taxonomy': - ctEditorLinkTarget = WPV_Toolset.Utils.updateUrlQuery( 'preview_taxonomy_archive[]', $( this ).data( 'name' ), ctEditorLinkTarget ); - break; - } - }); - break; - } - ctEditorLink.attr( 'href', ctEditorLinkTarget ); - return self; - }; - - $( document ).on( 'js_event_wpv_query_type_options_saved', '.js-wpv-query-type-update', function( event, queryType ) { - self.reloadGutenbergEditorsLinkTarget(); - }); - - self.setInlineContentTemplateEvents = function( templateId ) { - self.initGutenbergEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }; - - $( document ).on( 'js_event_wpv_ct_inline_editor_inited', function( event, templateId ) { - self.initGutenbergEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }); - - self.setUserEditorToGutenberg = function( ctId ) { - var item = $( '.js-wpv-ct-listing-' + ctId, '.js-wpv-inline-content-template-listing' ), - attributes = item.data( 'attributes' ); - - attributes.builder = 'gutenberg'; - item.data( 'attributes', attributes ); - - if ( item.find( '.CodeMirror' ).length == 0 ) { - item.find( '.js-wpv-content-template-open' ).trigger( 'click' ); - } else { - self.initGutenbergEditor( item ); - } - }; - - self.initHooks = function() { - Toolset.hooks.addAction( 'wpv-action-wpv-set-inline-content-template-events', self.setInlineContentTemplateEvents ); - Toolset.hooks.addAction( 'toolset-action-toolset-set-user-editor-to-gutenberg', self.setUserEditorToGutenberg ); - return self; - }; - - self.init = function() { - self.initGutenbergEditors() - .initHooks(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.GutenbergEditorBackendLayoutTemplateInstance = new ToolsetCommon.UserEditor.GutenbergEditorBackendLayoutTemplate( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/interface.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/interface.php deleted file mode 100644 index 68aab49..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/interface.php +++ /dev/null @@ -1,8 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - $this->constants->define( 'NATIVE_SCREEN_ID', 'native' ); - } - - public function initialize() { - - add_action( 'init', array( $this, 'register_assets' ), 50 ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ), 50 ); - - add_filter( 'toolset_filter_toolset_registered_user_editors', array( $this, 'register_user_editor' ) ); - add_filter( 'wpv_filter_wpv_layout_template_extra_attributes', array( $this, 'layout_template_attribute' ), 10, 3 ); - - /** - * If we need to enable the Native Editor button in the CT editor, the TOOLSET_SHOW_NATIVE_EDITOR_BUTTON_FOR_CT - * needs to be defined. - */ - if ( $this->constants->defined( 'TOOLSET_SHOW_NATIVE_EDITOR_BUTTON_FOR_CT' ) ) { - add_action( 'wpv_action_wpv_ct_inline_user_editor_buttons', array( $this, 'register_inline_editor_action_buttons' ) ); - } - - } - - public function is_active() { - if ( ! $this->set_medium_as_post() ) { - return false; - } - - $this->action(); - - return true; - } - - private function action() { - add_action( 'admin_enqueue_scripts', array( $this, 'action_enqueue_assets' ) ); - $this->medium->set_html_editor_backend( array( $this, 'html_output' ) ); - $this->medium->page_reload_after_backend_save(); - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - // Content Template own edit screen assets - - $toolset_assets_manager->register_style( - 'toolset-user-editors-native-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/native/backend.css', - array(), - TOOLSET_COMMON_VERSION - ); - - // Native post editor screen assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-native-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/native/backend_editor.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - // Content Template as inline object assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-native-layout-template-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/native/backend_layout_template.js', - array( 'jquery', 'views-layout-template-js', 'underscore' ), - TOOLSET_COMMON_VERSION, - true - ); - - $native_layout_template_i18n = array( - 'template_editor_url' => admin_url( 'admin.php?page=ct-editor' ), - 'template_overlay' => array( - 'title' => sprintf( __( 'This Content Template uses %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'button' => sprintf( __( 'Edit with %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'discard' => sprintf( __( 'Stop using %1$s for this Content Template', 'wpv-views' ), $this->editor->get_name() ), - ), - ); - $toolset_assets_manager->localize_script( - 'toolset-user-editors-native-layout-template-script', - 'toolset_user_editors_native_layout_template_i18n', - $native_layout_template_i18n - ); - } - - public function admin_enqueue_assets() { - if ( $this->is_views_or_wpa_edit_page() ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-native-layout-template-script' ) ); - } - } - - public function action_enqueue_assets() { - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-native-style' ) ); - } - - private function set_medium_as_post() { - $medium_id = $this->medium->get_id(); - - if ( ! $medium_id ) { - return false; - } - - $medium_post_object = get_post( $medium_id ); - if ( null === $medium_post_object ) { - return false; - } - - $this->post = $medium_post_object; - - return true; - } - - public function register_user_editor( $editors ) { - $editors[ $this->editor->get_id() ] = $this->editor->get_name(); - return $editors; - } - - /** - * Content Template editor output. - * - * Displays the Native Editor message and button to fire it up. - * - * @since 2.5.0 - */ - - public function html_output() { - - if ( ! isset( $_GET['ct_id'] ) ) { - return 'No valid content template id'; - } - - ob_start(); - include_once( dirname( __FILE__ ) . '/backend.phtml' ); - $output = ob_get_contents(); - ob_end_clean(); - - $admin_url = admin_url( 'admin.php?page=ct-editor&ct_id=' . esc_attr( $_GET['ct_id'] ) ); - $output .= '

      ' - . sprintf( - __( '%1$sStop using %2$s for this Content Template%3$s', 'wpv-views' ), - '', - $this->editor->get_name(), - '' - ) - . '

      '; - - return $output; - } - - public function register_inline_editor_action_buttons( $content_template ) { - $content_template_has_native = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'NATIVE_SCREEN_ID' ) ); - ?> - - ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'NATIVE_SCREEN_ID' ) ); - if ( $content_template_has_native ) { - $attributes['builder'] = $this->editor->get_id(); - } - return $attributes; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend.phtml b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend.phtml deleted file mode 100644 index e0d4f41..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend.phtml +++ /dev/null @@ -1,41 +0,0 @@ -medium->get_frontend_templates(); -?> - -
      -

      editor->get_name() ); ?>

      - -

      - ' . $template['form-option-label'] . '' - ); - ?> -

      - -

      - -

      - -
      - - - -
      -
      \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend_editor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend_editor.js deleted file mode 100644 index bce27d3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend_editor.js +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Backend script for the native post editor when editing Content Templates. - * - * @summary Content Template editor manager for native editor compatibility. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_native */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.NativeEditor = function( $ ) { - - var self = this; - - /** - * In Views 2.5.0, we introduced support for shortcodes using placeholders instead of brackets. The selected placeholder - * for the left bracket "[" was chosen to be the "{!{" and the selected placeholder for the right bracket "]" was chosen - * to be the "}!}". This was done to allow the use of Toolset shortcodes inside the various page builder module fields. - * Here, we are replacing the instances of brackets with placeholders to allow them to be used in the various page builder - * module fields. - **/ - self.secureShortcodeFromSanitization = function( shortcode_data ) { - var shortcode_string; - if ( typeof( shortcode_data ) === 'object' ) { - shortcode_string = shortcode_data.shortcode; - } else { - shortcode_string = shortcode_data; - } - - shortcode_string = shortcode_string.replace( /\[/g, '{!{' ).replace( /]/g, '}!}' ); - - if ( -1 !== shortcode_string.indexOf( '[wpv-conditional' ) ) { - shortcode_string.replace( /"/g, '\'' ); - }; - - if ( typeof( shortcode_data ) === 'object' ) { - shortcode_data.shortcode = shortcode_string; - } else { - shortcode_data = shortcode_string; - } - - return shortcode_data; - } - - self.findPropertyByPrefix = function(object, prefix) { - for ( var property in object ) { - if ( - object.hasOwnProperty( property ) - && property.toString().startsWith( prefix ) - ) { - return { key: property, value: object[ property ] }; - } - } - } - - /** - * When Content Templates are edited using either the native post editor or a page builder, WordPress keeps autosave - * data in the browser's local storage even though revisions are off for this post type. In order to prevent relevant - * notifications to appear, we need to manually remove them from there. - */ - self.removeCtAutosaveDataFromSessionstorage = function() { - var data, - autosave_data_property, - prefix = 'wp-autosave'; - - autosave_data_property = self.findPropertyByPrefix( sessionStorage, prefix ) - if ( typeof autosave_data_property != 'undefined' ) { - data = JSON.parse( autosave_data_property.value ); - - for ( var property in data ) { - if ( data.hasOwnProperty( property ) ) { - if ( data[ property ].post_type == 'view-template' ) { - delete data[ property ]; - } - } - } - - data = JSON.stringify( data ); - - sessionStorage.setItem( autosave_data_property.key, data ); - } - } - - self.removeUnnecessaryNativeEditorElements = function() { - $( '.misc-pub-section.misc-pub-post-status, .misc-pub-section.misc-pub-visibility, .edit-timestamp, .page-title-action, .submitdelete.deletion, fieldset.metabox-prefs' ).remove(); - } - - self.init = function() { - Toolset.hooks.addFilter( 'wpv-filter-wpv-shortcodes-gui-before-do-action', self.secureShortcodeFromSanitization ); - - Toolset.hooks.addFilter( 'wpv-filter-wpv-shortcodes-transform-format', self.secureShortcodeFromSanitization ); - - // Here the new Types shortcodes gets sanitized. - Toolset.hooks.addFilter( 'toolset-filter-get-crafted-shortcode', self.secureShortcodeFromSanitization, 11 ); - - self.removeCtAutosaveDataFromSessionstorage(); - - self.removeUnnecessaryNativeEditorElements(); - - /** - * When Content Templates are edited using either the native post editor or a page builder, WordPress keeps autosave - * data in the browser's local storage even though revisions are off for this post type. In order to prevent relevant - * notifications to appear, we need to catch the heartbeat event and remove the needed data that will be used to - * create an autosave entry in the database. - */ - $( document ).on( 'heartbeat-send.native', function( event, heartbeatData ){ - if( - typeof( heartbeatData.wp_autosave ) != 'undefined' - && typeof( heartbeatData.wp_autosave.post_type ) != 'undefined' - && heartbeatData.wp_autosave.post_type == 'view-template' - ) { - delete heartbeatData.wp_autosave; - } - }); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.NativeEditorInstance = new ToolsetCommon.UserEditor.NativeEditor( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend_layout_template.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend_layout_template.js deleted file mode 100644 index 8c9853d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/native/backend_layout_template.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Backend script for the Content Template editor for native editor, - * as loop elements in Views and WordPress Archives Loop output sections. - * This initializes the native editor overlay and handles the change in user editor to native editor. - * - * @summary Inline Content Template editor manager for native editor compatibility,. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_beaver_layout_template_i18n */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.NativeEditorBackendLayoutTemplate = function( $ ) { - - var self = this; - - self.selector = '.js-wpv-ct-listing'; - self.template_selector = '#js-wpv-layout-template-overlay-template'; - self.overlayContainer = _.template( jQuery( self.template_selector ).html() ); - self.i18n_data = { - title: toolset_user_editors_native_layout_template_i18n.template_overlay.title, - url: toolset_user_editors_native_layout_template_i18n.template_editor_url, - button: toolset_user_editors_native_layout_template_i18n.template_overlay.button, - discard: toolset_user_editors_native_layout_template_i18n.template_overlay.discard, - }; - - self.initNativeEditors = function() { - $( self.selector ).each( function() { - self.initNativeEditor( $( this ) ); - }); - return self; - }; - - self.initNativeEditor = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - // This has been inited before, or it is rendered closed - return self; - } - var attributes = item.data( 'attributes' ); - _.defaults( attributes, { builder: 'basic' } ); - if ( attributes.builder == 'native' ) { - item.addClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.find( '.js-wpv-ct-apply-user-editor:not(.js-wpv-ct-apply-user-editor-native)' ).prop( 'disabled', false ); - item.prepend( self.overlayContainer( self.i18n_data ) ); - item.find( '.CodeMirror' ).css( { 'height' : '0px'} ); - self.updateNativeCTEditorLinkTarget( item ); - } - return self; - }; - - self.reloadNativeEditorsLinkTarget = function() { - $( self.selector ).each( function() { - self.updateNativeCTEditorLinkTarget( $( this ) ); - }); - return self; - }; - - self.updateNativeCTEditorLinkTarget = function( item ) { - var ctEditorLink = item.find( '.js-wpv-layout-template-overlay-info-link' ), - ctEditorLinkTarget = toolset_user_editors_native_layout_template_i18n.template_editor_url + '&ct_id=' + item.data( 'id' ), - queryMode = Toolset.hooks.applyFilters( 'wpv-filter-wpv-edit-screen-get-query-mode', 'normal' ); - switch ( queryMode ) { - case 'normal': - var queryType = $( '.js-wpv-query-type:checked' ).val(); - switch ( queryType ) { - case 'posts': - $('.js-wpv-query-post-type:checked').map( function() { - ctEditorLinkTarget += '&preview_post_type[]=' + $( this ).val(); - }); - break; - case 'taxonomy': - $('.js-wpv-query-taxonomy-type:checked').map( function() { - ctEditorLinkTarget += '&preview_taxonomy[]=' + $( this ).val(); - }); - break; - case 'users': - $('.js-wpv-query-users-type:checked').map( function() { - ctEditorLinkTarget += '&preview_user[]=' + $( this ).val(); - }); - break; - } - break; - case 'archive': - $( '.js-wpv-settings-archive-loop input:checked' ).map( function() { - switch ( $( this ).data( 'type' ) ) { - case 'native': - - break; - case 'post_type' : - ctEditorLinkTarget += '&preview_post_type_archive[]=' + $( this ).data( 'name' ); - break; - case 'taxonomy': - ctEditorLinkTarget += '&preview_taxonomy_archive[]=' + $( this ).data( 'name' ); - break; - } - }); - break; - } - ctEditorLink.attr( 'href', ctEditorLinkTarget ); - return self; - }; - - $( document ).on( 'js_event_wpv_query_type_options_saved', '.js-wpv-query-type-update', function( event, queryType ) { - self.reloadNativeEditorsLinkTarget(); - }); - - self.setInlineContentTemplateEvents = function( templateId ) { - self.initNativeEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }; - - $( document ).on( 'js_event_wpv_ct_inline_editor_inited', function( event, templateId ) { - self.initNativeEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }); - - self.setUserEditorToNative = function( ctId ) { - var item = $( '.js-wpv-ct-listing-' + ctId, '.js-wpv-inline-content-template-listing' ), - attributes = item.data( 'attributes' ); - - attributes.builder = 'native'; - item.data( 'attributes', attributes ); - - if ( item.find( '.CodeMirror' ).length == 0 ) { - item.find( '.js-wpv-content-template-open' ).trigger( 'click' ); - } else { - self.initNativeEditor( item ); - } - }; - - self.initHooks = function() { - Toolset.hooks.addAction( 'wpv-action-wpv-set-inline-content-template-events', self.setInlineContentTemplateEvents ); - Toolset.hooks.addAction( 'toolset-action-toolset-set-user-editor-to-native', self.setUserEditorToNative ); - return self; - }; - - self.init = function() { - self.initNativeEditors() - .initHooks(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.NativeEditorBackendLayoutTemplateInstance = new ToolsetCommon.UserEditor.NativeEditorBackendLayoutTemplate( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.php deleted file mode 100644 index 7498fd3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.php +++ /dev/null @@ -1,339 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - $this->constants->define( 'VC_SCREEN_ID', 'vc' ); - } - - public function initialize() { - $shortcode_transformer = new Toolset_Shortcode_Transformer(); - - add_action( 'init', array( $this, 'register_assets' ), 50 ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ), 50 ); - - add_filter( 'toolset_filter_toolset_registered_user_editors', array( $this, 'register_user_editor' ) ); - add_filter( 'wpv_filter_wpv_layout_template_extra_attributes', array( $this, 'layout_template_attribute' ), 10, 3 ); - add_action( 'wpv_action_wpv_ct_inline_user_editor_buttons', array( $this, 'register_inline_editor_action_buttons' ) ); - - add_filter( 'wpcf_filter_wpcf_admin_get_current_edited_post', array( $this, 'get_current_ct_id_for_wpcf_admin' ), 11, 1 ); - - add_action( 'wpv_action_wpv_save_item', array( $this, 'save_vc_custom_css' ) ); - - add_filter( 'vc_btn_a_href', array( $shortcode_transformer, 'replace_shortcode_placeholders_with_brackets' ) ); - add_filter( 'vc_btn_a_href', 'do_shortcode' ); - - add_filter( 'vc_btn_a_title', array( $shortcode_transformer, 'replace_shortcode_placeholders_with_brackets' ) ); - add_filter( 'vc_btn_a_title', 'do_shortcode' ); - - add_filter( 'vc_raw_html_module_content', array( $shortcode_transformer, 'replace_shortcode_placeholders_with_brackets' ) ); - - // Post edit page integration - //add_action( 'edit_form_after_title', array( $this, 'preventNested' ) ); - } - - public function is_active() { - if( ! $this->set_medium_as_post() ) - return false; - - // check for functions used - if( - ! function_exists( 'vc_user_access' ) - || ! class_exists( 'Vc_Shortcodes_Manager' ) - || ! method_exists( 'Vc_Manager', 'backendEditor' ) - ) - return false; - - // don't show VC if user role is not allowed to use the backend editor - if( ! vc_user_access()->part( 'backend_editor' )->can()->get() ) { - return false; - } - - $this->action(); - return true; - } - - private function action() { - add_action( 'admin_init', array( $this, 'setup' ) ); - - add_action( 'admin_print_scripts', array( &$this->editor, 'enqueueEditorScripts' ) ); - add_action( 'admin_print_scripts', array( $this, 'print_scripts' ) ); - add_action( 'admin_print_scripts', array( Vc_Shortcodes_Manager::getInstance(), 'buildShortcodesAssets' ), 1 ); - - add_filter( 'toolset_filter_force_shortcode_generator_display', array( $this, 'force_shortcode_generator_display' ) ); - - $this->medium->set_html_editor_backend( array( $this, 'html_output' ) ); - } - - /** - * Setup the editor - * called on action 'admin_init' - */ - public function setup() { - // Disable WPBakery Page Builder (former Visual Composer) Frontend Editor - vc_disable_frontend(); - - // Get backend editor object through VC_Manager (vc di container) - global $vc_manager; - $this->editor = $vc_manager->backendEditor(); - - // VC_Backend_Editor->render() registers all needed scripts - // the "real" render came later in $this->html_output(); - $this->editor->render( $this->post->post_type ); - } - - - private function set_medium_as_post() { - $medium_id = $this->medium->get_id(); - - if( ! $medium_id ) - return false; - - $medium_post_object = get_post( $medium_id ); - if( $medium_post_object === null ) - return false; - - $this->post = $medium_post_object; - - return true; - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - // Content Template as inline object assets - - $toolset_assets_manager->register_script( - 'toolset-user-editors-vc-layout-template-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/visual-composer/backend_layout_template.js', - array( 'jquery', 'views-layout-template-js', 'underscore' ), - TOOLSET_COMMON_VERSION, - true - ); - - $toolset_assets_manager->register_script( - 'toolset-user-editors-vc-script', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/visual-composer/backend_editor.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - $toolset_assets_manager->register_style( - 'toolset-user-editors-vc-editor-style', - TOOLSET_COMMON_URL . '/user-editors/editor/screen/visual-composer/backend_editor.css', - array(), - TOOLSET_COMMON_VERSION - ); - - $vc_layout_template_i18n = array( - 'template_editor_url' => admin_url( 'admin.php?page=ct-editor' ), - 'template_overlay' => array( - 'title' => sprintf( __( 'You created this template using %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'button' => sprintf( __( 'Edit with %1$s', 'wpv-views' ), $this->editor->get_name() ), - 'discard' => sprintf( __( 'Stop using %1$s for this Content Template', 'wpv-views' ), $this->editor->get_name() ) - ), - ); - $toolset_assets_manager->localize_script( - 'toolset-user-editors-vc-layout-template-script', - 'toolset_user_editors_vc_layout_template_i18n', - $vc_layout_template_i18n - ); - - } - - public function admin_enqueue_assets( $screen_id ) { - $content_template_has_vc = ( get_post_meta( wpv_getget( 'ct_id' ), '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'VC_SCREEN_ID' ) ); - $ct_edit_page_screen_id = class_exists( 'WPV_Page_Slug' ) ? WPV_Page_Slug::CONTENT_TEMPLATES_EDIT_PAGE : 'toolset_page_ct-editor'; - - if ( $this->is_views_or_wpa_edit_page() ) { - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-vc-layout-template-script' ) ); - } - - if ( - $content_template_has_vc - && $ct_edit_page_screen_id === $screen_id - ) { - // We need to enqueue the following style and script on the Content Template edit page but only when the - // template is built with WPBakery Page Builder (former Visual Composer). - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-vc-script' ) ); - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-vc-editor-style' ) ); - } - - } - - public function html_output() { - - ob_start(); - - include_once( dirname( __FILE__ ) . '/backend.phtml' ); - - $output = ob_get_contents(); - - ob_end_clean(); - - $admin_url = admin_url( 'admin.php?page=ct-editor&ct_id=' . esc_attr( $_GET['ct_id'] ) ); - $output .= '

      ' - . sprintf( - __( '%1$sStop using %2$s for this Content Template%3$s', 'wpv-views' ), - '', - $this->medium->get_manager()->get_active_editor()->get_name(), - '' - ) - . '

      '; - - return $output; - } - - /** - * We need some custom scripts ( &styles ) - * called on 'admin_print_scripts' - */ - public function print_scripts() { - - // disable the 100% and fixed vc editor navigation when scrolling down - $output = ' - '; - - // disable our backbone extension due to conflicts with vc (see util.js) - $output .= ""; - echo preg_replace('/\v(?:[\v\h]+)/', '', $output ); - } - - public function register_user_editor( $editors ) { - $editors[ $this->editor->get_id() ] = $this->editor->get_name(); - return $editors; - } - - /** - * Set the builder used by a Content Template, if any. - * - * On a Content Template used inside a View or WPA loop output, we set which builder it is using - * so we can link to the CT edit page with the right builder instantiated. - * - * @since 2.3.0 - */ - - public function layout_template_attribute( $attributes, $content_template, $view_id ) { - $content_template_has_vc = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'VC_SCREEN_ID' ) ); - if ( $content_template_has_vc ) { - $attributes['builder'] = $this->editor->get_id(); - } - return $attributes; - } - - public function register_inline_editor_action_buttons( $content_template ) { - $content_template_has_vc = ( get_post_meta( $content_template->ID, '_toolset_user_editors_editor_choice', true ) == $this->constants->constant( 'VC_SCREEN_ID' ) ); - ?> - - constants->constant( 'VC_SCREEN_ID' ) ); - if ( $content_template_has_vc ) { - foreach ( $_POST['properties'] as $property ) { - if ( 'template_extra_css' === $property['name'] ) { - update_post_meta( $content_template_id, '_wpb_post_custom_css', $property['value'] ); - } - } - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.phtml b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.phtml deleted file mode 100644 index 498eec3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend.phtml +++ /dev/null @@ -1,16 +0,0 @@ -
      - - - - post->post_content, - 'content', - array( - 'media_buttons' => true, - ) - ); - ?> -
      - -
      editor->renderEditor( $this->post ); ?>
      \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_editor.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_editor.css deleted file mode 100644 index d8eaf02..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_editor.css +++ /dev/null @@ -1,3 +0,0 @@ -.toolset_page_ct-editor .vc_ui-panel.vc_ui-panel-window { - z-index: 20000; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_editor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_editor.js deleted file mode 100644 index 2be6641..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_editor.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Backend script for the Visual Composer editor when editing Content Templates. - * - * @summary Content Template editor manager for isual Composer editor compatibility. - * - * @since 2.5.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_visual_composer */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.VisualComposerEditor = function( $ ) { - - var self = this; - - /** - * In Views 2.5.0, we introduced support for shortcodes using placeholders instead of brackets. The selected placeholder - * for the left bracket "[" was chosen to be the "{!{" and the selected placeholder for the right bracket "]" was chosen - * to be the "}!}". This was done to allow the use of Toolset shortcodes inside the various page builder module fields. - * Here, we are replacing the instances of brackets with placeholders to allow them to be used in the various page builder - * module fields. - **/ - self.secureShortcodeFromSanitization = function( shortcode_data ) { - var shortcode_string; - if ( typeof( shortcode_data ) === 'object' ) { - shortcode_string = shortcode_data.shortcode; - } else { - shortcode_string = shortcode_data; - } - - shortcode_string = shortcode_string.replace( /\[/g, '{!{' ).replace( /]/g, '}!}' ); - - if ( -1 !== shortcode_string.indexOf( '[wpv-conditional' ) ) { - shortcode_string.replace( /"/g, '\'' ); - }; - - if ( typeof( shortcode_data ) === 'object' ) { - shortcode_data.shortcode = shortcode_string; - } else { - shortcode_data = shortcode_string; - } - - return shortcode_data; - } - - self.findPropertyByPrefix = function(object, prefix) { - for ( var property in object ) { - if ( - object.hasOwnProperty( property ) - && property.toString().startsWith( prefix ) - ) { - return { key: property, value: object[ property ] }; - } - } - } - - self.initializeVisualComposerBackendEditor = function() { - $( window ).load( function() { - /* no fullscreen, no vc save button */ - jQuery( '#vc_navbar .vc_save-backend, #vc_fullscreen-button' ).remove(); - - /* show vc editor */ - vc.app.show(); - vc.app.status = 'shown'; - - var viewsBasicTextarea = jQuery( '#wpv_content' ); - var wordpressDefaultTextarea = jQuery( '#content' ); - - var viewsCSSArea = jQuery( '#wpv_template_extra_css' ); - vc.post_settings_view.on( 'save', function() { - if( this.saved_css_data != vc.$custom_css.val() ) { - viewsCSSArea.val( vc.$custom_css.val() ); - - WPViews.ct_edit_screen.vm.templateCssAccepted = function(){ return vc.$custom_css.val(); }; - WPViews.ct_edit_screen.vm.propertyChangeByComparator( 'templateCss', _.isEqual ); - } - } ); - - /* Visual Composer fires the 'sync' event everytime something is changed */ - /* we use this to enable button 'Save all sections at once' if content has changed */ - vc.shortcodes.on( 'sync', function() { - if( wordpressDefaultTextarea.val() != viewsBasicTextarea.val() ) { - viewsBasicTextarea.val( wordpressDefaultTextarea.val() ); - - WPViews.ct_edit_screen.vm.postContentAccepted = function(){ return wordpressDefaultTextarea.val() }; - WPViews.ct_edit_screen.vm.propertyChangeByComparator( 'postContent', _.isEqual ); - } - } ); - }); - } - - self.init = function() { - Toolset.hooks.addFilter( 'wpv-filter-wpv-shortcodes-gui-before-do-action', self.secureShortcodeFromSanitization ); - - Toolset.hooks.addFilter( 'wpv-filter-wpv-shortcodes-transform-format', self.secureShortcodeFromSanitization ); - - self.initializeVisualComposerBackendEditor(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.VisualComposerEditorInstance = new ToolsetCommon.UserEditor.VisualComposerEditor( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_layout_template.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_layout_template.js deleted file mode 100644 index 8986af1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/backend_layout_template.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Backend script for the Content Template editor for Visual Composer, - * as loop elements in Views and WordPress Archives Loop output sections. - * This initializes the Visual Composer overlay anc handles the change in user editor to BB. - * - * @summary Inline Content Template editor manager for Visual Composer compatibility,. - * - * @since 2.3.0 - * @requires jquery.js - * @requires underscore.js - */ - -/* global toolset_user_editors_vc_layout_template_i18n */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.VisualComposerBackendLayoutTemplate = function( $ ) { - - var self = this; - - self.selector = '.js-wpv-ct-listing'; - self.template_selector = '#js-wpv-layout-template-overlay-template'; - self.overlayContainer = _.template( jQuery( self.template_selector ).html() ); - self.i18n_data = { - title: toolset_user_editors_vc_layout_template_i18n.template_overlay.title, - url: toolset_user_editors_vc_layout_template_i18n.template_editor_url, - button: toolset_user_editors_vc_layout_template_i18n.template_overlay.button, - discard: toolset_user_editors_vc_layout_template_i18n.template_overlay.discard, - }; - - self.initVCEditors = function() { - $( self.selector ).each( function() { - self.initVCEditor( $( this ) ); - }); - return self; - }; - - self.initVCEditor = function( item ) { - if ( - item.hasClass( 'js-wpv-ct-listing-user-editor-inited' ) - || item.find( '.CodeMirror' ).length == 0 - ) { - // This has been inited before, or it is rendered closed - return self; - } - var attributes = item.data( 'attributes' ); - _.defaults( attributes, { builder: 'basic' } ); - if ( attributes.builder == 'vc' ) { - item.addClass( 'js-wpv-ct-listing-user-editor-inited' ); - item.find( '.js-wpv-layout-template-overlay' ).remove(); - item.find( '.js-wpv-ct-apply-user-editor:not(.js-wpv-ct-apply-user-editor-vc)' ).prop( 'disabled', false ); - item.prepend( self.overlayContainer( self.i18n_data ) ); - item.find( '.CodeMirror' ).css( { 'height' : '0px'} ); - self.updateVCCTEditorLinkTarget( item ); - } - return self; - }; - - self.reloadVCEditorsLinkTarget = function() { - $( self.selector ).each( function() { - self.updateVCCTEditorLinkTarget( $( this ) ); - }); - return self; - }; - - self.updateVCCTEditorLinkTarget = function( item ) { - var ctEditorLink = item.find( '.js-wpv-layout-template-overlay-info-link' ), - ctEditorLinkTarget = toolset_user_editors_vc_layout_template_i18n.template_editor_url + '&ct_id=' + item.data( 'id' ), - queryMode = Toolset.hooks.applyFilters( 'wpv-filter-wpv-edit-screen-get-query-mode', 'normal' ); - switch ( queryMode ) { - case 'normal': - var queryType = $( '.js-wpv-query-type:checked' ).val(); - switch ( queryType ) { - case 'posts': - $( '.js-wpv-query-post-type:checked' ).map( function() { - ctEditorLinkTarget += '&preview_post_type[]=' + $( this ).val(); - }); - break; - case 'taxonomy': - $( '.js-wpv-query-taxonomy-type:checked' ).map( function() { - ctEditorLinkTarget += '&preview_taxonomy[]=' + $( this ).val(); - }); - break; - case 'users': - $( '.js-wpv-query-users-type:checked' ).map( function() { - ctEditorLinkTarget += '&preview_user[]=' + $( this ).val(); - }); - break; - } - break; - case 'archive': - $( '.js-wpv-settings-archive-loop input:checked' ).map( function() { - switch ( $( this ).data( 'type' ) ) { - case 'native': - - break; - case 'post_type' : - ctEditorLinkTarget += '&preview_post_type_archive[]=' + $( this ).data( 'name' ); - break; - case 'taxonomy': - ctEditorLinkTarget += '&preview_taxonomy_archive[]=' + $( this ).data( 'name' ); - break; - } - }); - break; - } - ctEditorLink.attr( 'href', ctEditorLinkTarget ); - return self; - }; - - $( document ).on( 'js_event_wpv_query_type_options_saved', '.js-wpv-query-type-update', function( event, queryType ) { - self.reloadVCEditorsLinkTarget(); - }); - - self.setInlineContentTemplateEvents = function( templateId ) { - self.initVCEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }; - - $( document ).on( 'js_event_wpv_ct_inline_editor_inited', function( event, templateId ) { - self.initVCEditor( $( '.js-wpv-ct-listing-' + templateId ) ); - }); - - self.setUserEditorToVC = function( ctId ) { - var item = $( '.js-wpv-ct-listing-' + ctId, '.js-wpv-inline-content-template-listing' ), - attributes = item.data( 'attributes' ); - - attributes.builder = 'vc'; - item.data( 'attributes', attributes ); - - if ( item.find( '.CodeMirror' ).length == 0 ) { - item.find( '.js-wpv-content-template-open' ).trigger( 'click' ); - } else { - self.initVCEditor( item ); - } - }; - - self.initHooks = function() { - Toolset.hooks.addAction( 'wpv-action-wpv-set-inline-content-template-events', self.setInlineContentTemplateEvents ); - Toolset.hooks.addAction( 'toolset-action-toolset-set-user-editor-to-vc', self.setUserEditorToVC ); - return self; - }; - - self.init = function() { - self.initVCEditors() - .initHooks(); - - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.VisualComposerBackendLayoutTemplateInstance = new ToolsetCommon.UserEditor.VisualComposerBackendLayoutTemplate( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/frontend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/frontend.php deleted file mode 100644 index 63e0254..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/screen/visual-composer/frontend.php +++ /dev/null @@ -1,109 +0,0 @@ -log_rendered_css[$content_template] ) ) { - $vcbase = new Vc_Base(); - $vcbase->addPageCustomCss( $content_template ); - $vcbase->addShortcodesCustomCss( $content_template ); - $this->log_rendered_css[$content_template] = true; - } - } - return $content; - } - - /** - * Some of the WPBakery Page Builder (former Visual Composer) shortcodes are accessing the post meta of the post - * currently displayed to get the setting of the shortcodes settings. For the case where a Content Template is built - * with WPBakery Page Builder (former Visual Composer), in order for the shortcode settings to be retrieved correctly - * we need to access the Content Template post. - * - * @note Part of the method's code is copied by "findPostShortcodeById" method of WPBakery Page Builder. - * - * @param $shortcode The shortcode currently being rendered. - * @param $page_id The page ID currently displayed. - * @param $grid_id The grid ID saved inside the post meta. - * - * @return array The new shortcode fetched from the Content Template - * - * @since 2.5.7 - */ - public function maybe_get_shortcode_from_assigned_ct_id( $shortcode, $page_id, $grid_id ) { - if ( - class_exists( 'WPBMap' ) - && class_exists( 'WPBakeryShortCode_VC_Basic_Grid' ) - && method_exists( 'WPBMap', 'getShortCode' ) - && method_exists( 'WPBakeryShortCode_VC_Basic_Grid', 'findPostShortcodeById' ) - ) { - $page_id = intval( $page_id ); - - $template_selected = get_post_meta( $page_id, '_views_template', true ); - - if ( - ! empty( $template_selected ) - && intval( $template_selected ) > 0 - ) { - $page_id = $template_selected; - } - - remove_filter( 'vc_basic_grid_find_post_shortcode', array( $this, 'maybe_get_shortcode_from_assigned_ct_id' ) ); - - $ct_post_meta = get_post_meta( (int) $page_id, '_vc_post_settings', true ); - - $settings = WPBMap::getShortCode( $ct_post_meta['vc_grid_id']['shortcodes'][ $grid_id ]['tag'] ); - - $vc_basic_grid = new WPBakeryShortCode_VC_Basic_Grid( $settings ); - - $shortcode = $vc_basic_grid->findPostShortcodeById( $page_id, $grid_id ); - - add_filter( 'vc_basic_grid_find_post_shortcode', array( $this, 'maybe_get_shortcode_from_assigned_ct_id' ) ); - } - - return $shortcode; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/templates/inline-ct-overlay.tpl.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/templates/inline-ct-overlay.tpl.php deleted file mode 100644 index 0e4cc88..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/templates/inline-ct-overlay.tpl.php +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/templates/inline-ct-saving-overlay.tpl.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/templates/inline-ct-saving-overlay.tpl.php deleted file mode 100644 index 2943aea..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/templates/inline-ct-saving-overlay.tpl.php +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/visual-composer.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/visual-composer.php deleted file mode 100644 index c5a2d36..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/editor/visual-composer.php +++ /dev/null @@ -1,88 +0,0 @@ -minimum_version ) < 0 ) { - add_filter( 'wpv_ct_control_switch_editor_buttons', array( $this, 'add_disabled_button' ) ); - return false; - } - - if( version_compare( WPB_VC_VERSION, $this->minimum_wp_bakery_pb_version ) < 0 ) { - $this->name = 'Visual Composer'; - $this->logo_image_svg = 'vc_old.svg'; - } - - return true; - } - - public function run() { - // register medium slug - add_filter( 'vc_check_post_type_validation', array( $this, 'support_medium' ), 10, 2 ); - } - - /** - * If version requirements does not met, we show a hint. - * - * @param $buttons - * @return array - */ - public function add_disabled_button( $buttons ) { - $buttons[] = ''; - $buttons = array_reverse( $buttons ); - return $buttons; - } - - /** - * We need to add Views type of content templates - * to the allowed types of WPBakery Page Builder (former Visual Composer). - * - * - * @param $default - * @param $type - * - * @return bool - */ - public function support_medium( $default, $type ) { - if( $type == $this->medium->get_slug() ) - return true; - - return $default; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/interface.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/interface.php deleted file mode 100644 index 250c7e5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/interface.php +++ /dev/null @@ -1,18 +0,0 @@ -medium = $medium; - $this->medium->add_manager( $this ); - } - - /** - * @param Toolset_User_Editors_Editor_Interface $editor - * - * @return bool - */ - public function add_editor( Toolset_User_Editors_Editor_Interface $editor ) { - if( ! $editor->required_plugin_active() ) { - return false; - } - - $this->editors[$editor->get_id()] = $editor; - return true; - } - - /** - * Return all editors - * @return Toolset_User_Editors_Editor_Interface[] - */ - public function get_editors() { - return $this->editors; - } - - /** - * Return current active editor - * - * @return false|Toolset_User_Editors_Editor_Interface - */ - public function get_active_editor() { - if( $this->active_editor === null ) { - $this->active_editor = $this->fetch_active_editor(); - } - - return $this->active_editor; - } - - public function get_medium() { - return $this->medium; - } - - /** - * @return bool - */ - protected function fetch_active_editor() { - - $user_editor_choice = $this->medium->user_editor_choice(); - // check every screen of medium - foreach( $this->medium->get_screens() as $id => $screen ) { - - // if screen is active - if( $id_medium = $screen->is_active() ) { - $screen->add_manager( $this ); - - // check editors - foreach( $this->get_editors() as $editor ) { - - // skip if we have a user editor choice and current editor not matching selection - if( $user_editor_choice - && array_key_exists( $user_editor_choice, $this->editors ) - && $user_editor_choice != $editor->get_id() - ) - continue; - - // check editor screens - if( $editor_screen = $editor->get_screen_by_id( $id ) ) { - $this->medium->set_id( $id_medium ); - if( $editor_screen->is_active() ) { - $screen->equivalent_editor_screen_is_active(); - - return $editor; - } else if( $screen->drop_if_not_active() ) { - $this->medium->remove_screen( $id ); - } - } - } - } else if( $screen->drop_if_not_active() ) { - $this->medium->remove_screen( $id ); - } - } - - // if we have no editor active here it still can be a frontend - if ( $this->active_editor === null ) { - add_action( 'wp', array( $this, 'run' ), -1000 ); - } - - return false; - } - - public function run() { - if( $this->active_editor == false ) { - $this->active_editor = null; - } - - if( $editor = $this->get_active_editor() ) { - $editor->run(); - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/abstract.php deleted file mode 100644 index 404b2a9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/abstract.php +++ /dev/null @@ -1,98 +0,0 @@ -id = $id; - } - - public function get_id() { - return $this->id; - } - - public function get_slug() { - return $this->slug; - } - - public function get_option_name_editor_choice() { - return $this->option_name_editor_choice; - } - - /** - * @param $id - * @param Toolset_User_Editors_Medium_Screen_Interface $screen - */ - public function add_screen( $id, Toolset_User_Editors_Medium_Screen_Interface $screen ) { - $this->screens[$id] = $screen; - } - - /** - * @param $id - */ - public function remove_screen( $id ) { - if( array_key_exists( $id, $this->screens ) ) { - unset( $this->screens[$id] ); - } - } - - /** - * @return Toolset_User_Editors_Medium_Screen_Interface[] - */ - public function get_screens() { - return $this->screens; - } - - public function add_manager( Toolset_User_Editors_Manager_Interface $manager ) { - $this->manager = $manager; - } - - public function get_manager() { - return $this->manager; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/content-template.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/content-template.php deleted file mode 100644 index df0b1e3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/content-template.php +++ /dev/null @@ -1,334 +0,0 @@ -constants = $constants - ? $constants - : new Toolset_Constants(); - - if( array_key_exists( 'ct_id', $_REQUEST ) ) - $this->id = (int) $_REQUEST['ct_id']; - - if( $this->id && array_key_exists( 'ct_editor_choice', $_REQUEST ) ) - update_post_meta( $this->id, $this->option_name_editor_choice, sanitize_text_field( $_REQUEST['ct_editor_choice'] ) ); - - add_filter( 'toolset_user_editors_backend_html_editor_select', array( $this, 'editor_selection' ) ); - } - - public function user_editor_choice() { - if( $this->user_editor_choice !== null ) - return $this->user_editor_choice; - - if( ! $this->get_id() ) - return false; - - $content_template_id = wpv_getget( 'ct_id' ); - - if( $editor_choice = get_post_meta( $content_template_id, $this->option_name_editor_choice, true ) ) { - $this->user_editor_choice = $editor_choice; - return $editor_choice; - } // backward compatibility (since Views Visual Comopser Beta we used 'wpv_ct_editor_choice') - elseif ( $editor_choice = get_post_meta( $content_template_id, 'wpv_ct_editor_choice', true ) ) { - $this->user_editor_choice = $editor_choice; - update_post_meta( $content_template_id, $this->option_name_editor_choice, $editor_choice ); - delete_post_meta( $content_template_id, 'wpv_ct_editor_choice' ); - return $editor_choice; - } elseif( get_post_type( $content_template_id ) == $this->slug ) { - update_post_meta( $content_template_id, $this->option_name_editor_choice, 'basic' ); - return 'basic'; - } - - return false; - } - - /** - * Register the list of allowed theme PHP templates based on the usage of the current Content Template. - * - * @since unknown - * @since 2.3.0 Covers the frontend PHP templates for Content Templates assigned to single pages. - */ - public function get_frontend_templates() { - - if( $this->allowed_templates !== null ) - return $this->allowed_templates; - - $content_template_usages = $this->get_usages(); - $theme_template_files = (array) wp_get_theme()->get_files( 'php', 1, true ); - - $wpv_options_patterns = array( - 'views_template_for_' => array( - 'label' => __( 'Single', 'wpv-views' ), - 'domain' => 'post', - 'template_hierarchy' => array( - 'single-%NAME%.php', - 'single.php', - 'singular.php', - 'index.php' - ) - ), - 'views_template_archive_for_' => array( - 'label' => __( 'Posts archive', 'wpv-views' ), - 'domain' => 'post', - 'template_hierarchy' => array( - 'archive-%NAME%.php', - 'archive.php', - 'index.php' - ) - ), - 'views_template_loop_' => array( - 'label' => __( 'Taxonomy archive', 'wpv-views' ), - 'domain' => 'taxonomy', - 'template_hierarchy' => array( - 'taxonomy-%NAME%.php', - 'taxonomy.php', - 'archive.php', - 'index.php' - ) - ), - 'view_loop_preview_post_type_' => array( - 'label' => __( 'View loop', 'wpv-views' ), - 'domain' => 'post', - 'template_hierarchy' => array( - 'single-%NAME%.php', - 'single.php', - 'singular.php', - 'index.php' - ) - ), - 'view_wpa_loop_preview_post_type_' => array( - 'label' => __( 'WordPress Archive loop', 'wpv-views' ), - 'domain' => 'post', - 'template_hierarchy' => array( - 'archive-%NAME%.php', - 'archive.php', - 'index.php' - ) - ), - 'view_wpa_loop_preview_taxonomy_' => array( - 'label' => __( 'WordPress Archive loop', 'wpv-views' ), - 'domain' => 'taxonomy', - 'template_hierarchy' => array( - 'taxonomy-%NAME%.php', - 'taxonomy.php', - 'archive.php', - 'index.php' - ) - ), - ); - - $this->allowed_templates = array(); - - foreach( $content_template_usages as $usage => $ct_id ) { - if ( 'views_template_for_page' == $usage ) { - // Content Templates assigned to single pages demand a speial management, - // since they are indeed single posts but with special templates in the - // native WordPress PHP templates hierarchy. - // Note that there is no CT for the non-existing pages archive loop at all. - $single_page_template_hierarchy = array( - 'page.php', - 'singular.php', - 'index.php' - ); - $single_page_post_type_object = get_post_type_object( 'page' ); - if ( is_object( $single_page_post_type_object ) ) { - foreach( $single_page_template_hierarchy as $template_file ) { - if( array_key_exists( $template_file, $theme_template_files ) ) { - $this->allowed_templates[] = array( - 'slug' => 'page', - 'domain' => 'post', - 'form-option-label' => $single_page_post_type_object->labels->name . ' [' . __( 'Single', 'wpv-views' ) . ']', - 'path' => $theme_template_files[ $template_file ] - ); - break; - } - } - } - } else { - foreach( $wpv_options_patterns as $pattern => $settings ) { - if( strpos( $usage, $pattern ) !== false ) { - $type_name = str_replace( $pattern, '', $usage ); - $type_object = $settings['domain'] == 'post' - ? get_post_type_object( $type_name ) - : get_taxonomy( $type_name ); - if ( is_object( $type_object ) ) { - foreach( $settings['template_hierarchy'] as $template_file ) { - $template_file = str_replace( '%NAME%', $type_object->name, $template_file ); - if( array_key_exists( $template_file, $theme_template_files ) ) { - $this->allowed_templates[] = array( - 'slug' => $type_object->name, - 'domain' => $settings['domain'], - 'form-option-label' => $type_object->labels->name . ' [' . $settings['label'] . ']', - 'path' => $theme_template_files[ $template_file ] - ); - break; - } - } - } - } - } - } - } - - // Make sure that the stored template path is in the allowed ones, or force it otherwise - $allowed_paths = wp_list_pluck( $this->allowed_templates, 'path' ); - $current_template = get_post_meta( (int) $_GET['ct_id'], $this->manager->get_active_editor()->get_option_name(), true ); - - if ( isset( $_GET['ct_id'] ) ) { - if ( empty( $allowed_paths ) ) { - $settings_to_store = array( - 'template_path' => false, - 'preview_domain' => 'post', - 'preview_slug' => '' - ); - - update_post_meta( (int) $_GET['ct_id'], $this->manager->get_active_editor()->get_option_name(), $settings_to_store ); - } else { - if ( - ! isset( $current_template['template_path'] ) - || ! in_array( $current_template['template_path'], $allowed_paths ) - ) { - $slide_allowed_template = array_slice( $this->allowed_templates, 0, 1 ); - $first_allowed_template = array_shift( $slide_allowed_template ); - $settings_to_store = array( - 'template_path' => wp_slash( $first_allowed_template['path'] ), - 'preview_domain' => $first_allowed_template['domain'], - 'preview_slug' => $first_allowed_template['slug'] - ); - - update_post_meta( (int) $_GET['ct_id'], $this->manager->get_active_editor()->get_option_name(), $settings_to_store ); - } - } - - } - - return $this->allowed_templates; - } - - private function get_usages() { - $views_settings = WPV_Settings::get_instance(); - $views_options = $views_settings->get(); - $views_options = array_filter( $views_options, array( $this, 'filter_templates_by_template_id' ) ); - - if ( isset( $_GET['ct_id'] ) ) { - - if ( - isset( $_GET['preview_post_type'] ) - && is_array( $_GET['preview_post_type'] ) - && ! empty ( $_GET['preview_post_type'] ) - ) { - $preview_post_type = array_map( 'sanitize_text_field', $_GET['preview_post_type'] ); - foreach ( $preview_post_type as $prev_cpt ) { - $views_options[ 'view_loop_preview_post_type_' . $prev_cpt ] = (int) $_GET['ct_id']; - } - } - - if ( - isset( $_GET['preview_post_type_archive'] ) - && is_array( $_GET['preview_post_type_archive'] ) - && ! empty ( $_GET['preview_post_type_archive'] ) - ) { - $preview_post_type_archive = array_map( 'sanitize_text_field', $_GET['preview_post_type_archive'] ); - foreach ( $preview_post_type_archive as $prev_cpt ) { - $views_options[ 'view_wpa_loop_preview_post_type_' . $prev_cpt ] = (int) $_GET['ct_id']; - } - } - - if ( - isset( $_GET['preview_taxonomy_archive'] ) - && is_array( $_GET['preview_taxonomy_archive'] ) - && ! empty ( $_GET['preview_taxonomy_archive'] ) - ) { - $preview_taxonomy_archive = array_map( 'sanitize_text_field', $_GET['preview_taxonomy_archive'] ); - foreach ( $preview_taxonomy_archive as $prev_cpt ) { - $views_options[ 'view_wpa_loop_preview_taxonomy_' . $prev_cpt ] = (int) $_GET['ct_id']; - } - } - - // @todo implement the rest of the Layout Loop usages - - } - - return $views_options; - } - - private function filter_templates_by_template_id( $stored_value ) { - if( ! isset( $_GET['ct_id'] ) ) - return false; - - return( (int) $stored_value == (int) $_GET['ct_id'] ); - } - - /** - * @param $content_function callable - */ - public function set_html_editor_backend( $content_function ) { - add_filter( 'toolset_user_editors_backend_html_active_editor', $content_function ); - } - - - public function editor_selection() { - $control_editor_select = ''; - $editors = $this->manager->get_editors(); - - if( count( $editors ) > 1 ) { - $admin_url = admin_url( 'admin.php?page=ct-editor&ct_id='. (int) $_GET['ct_id'] ); - - $editor_switch_buttons = array(); - - foreach( $editors as $editor ) { - if ( $editor->get_id() != $this->manager->get_active_editor()->get_id() ) { - if ( - 'native' == $editor->get_id() - && ! $this->constants->defined( 'TOOLSET_SHOW_NATIVE_EDITOR_BUTTON_FOR_CT' ) - ) { - continue; - } - $editor_switch_buttons[] = sprintf( - '', - sanitize_html_class( $editor->get_logo_class() ), - esc_url($admin_url . '&ct_editor_choice=' . $editor->get_id() ), - esc_attr( __( 'Edit with', 'wpv-views' ) . ' ' . $editor->get_name() ), - $editor->get_logo_image_svg() ? '' : '', - esc_html( $editor->get_name() ) - ); - } - } - - $control_editor_select .= '
      '; - //$control_editor_select .= __( 'Select Editor: ', 'wpv-views' ); - $control_editor_select .= ''; - $control_editor_select .= '
      '; - } - - return $control_editor_select; - } - - public function page_reload_after_backend_save() { - add_action( 'admin_print_footer_scripts', array( $this, '_action_page_reload_after_backend_save' ) ); - } - - /** - * @todo refactor this, it should not happen this way. If after saving a section we need to reload, we set it on a caninical way. - * ALso, this should NOT happen any time a CT setting is saved, just when a CT usage chnage is... - */ - - public function _action_page_reload_after_backend_save() { - echo ""; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/interface.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/interface.php deleted file mode 100644 index 38a74ce..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/interface.php +++ /dev/null @@ -1,108 +0,0 @@ -manager = $manager; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/backend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/backend.php deleted file mode 100644 index 3859837..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/backend.php +++ /dev/null @@ -1,30 +0,0 @@ -manager->get_active_editor()->get_id(); - return $l10n_data; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.css deleted file mode 100644 index 44d8f75..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.css +++ /dev/null @@ -1,50 +0,0 @@ -.fl-builder .wpv-dialog ul { - list-style-type: none; -} - -#wpv-ct-preview-post { - width: 135px; - display: inline; - font-size:13px; - margin: 5px 0 5px 5px; -} - -/*.fl-builder-actions .fl-builder-button.fl-builder-discard-button,*/ -.fl-builder-actions .fl-builder-button.fl-builder-draft-button { - display: none !important; -} - -.fl-builder-bar { - z-index: 100010; -} - -.fl-builder .toolset-ui-dialog.ui-widget { - z-index: 1000002 !important; -} - -.fl-builder .ui-widget-overlay { - z-index: 1000001 !important; -} - -.fl-builder-bar-content { - height: 100% !important; -} - -.toolset-editors-frontend-editor-extra { - display: none; - border-left: solid 1px #ccc; - padding: 0; - font-size: 13px !important; -} - -.toolset-editors-frontend-editor-extra-content-icon-container { - display: inline-block; -} - -.toolset-editors-frontend-editor-extra-content-icon-container i { - color: #F05A29; - font-size: 30px; - vertical-align: middle; - float: left; - height: 100%; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.js deleted file mode 100644 index 0600e1d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Frontend script for the Content Template editor for Beaver Builder. - * This controls the changes in the post preview as well as redirection on exit. - * - * @summary Frontend Content Template editor manager for Beaver Builder compatibility,. - * - * @since 2.3.0 - * @requires jquery.js - */ - -/* globals jQuery, toolset_user_editors */ - -var ToolsetCommon = ToolsetCommon || {}; -ToolsetCommon.UserEditor = ToolsetCommon.UserEditor || {}; - -ToolsetCommon.UserEditor.BeaverBuilderFrontendEditor = function( $ ) { - - var self = this; - - self.extraContainer = $( '.js-toolset-editors-frontend-editor-extra' ); - - self.previewPostSelector = $( '#wpv-ct-preview-post' ); - - self.setExitUrl = function() { - FLBuilder._exitUrl = toolset_user_editors.mediumUrl; - }; - - /** - * As of Beaver Builder 2.0 in order to exit the builder page and return to the Content Template edit page - * we need to force set the "shouldRefreshOnPublish" setting to true. - */ - self.setForceRefreshOnPublish = function() { - if ( !FLBuilderConfig.shouldRefreshOnPublish ) { - FLBuilderConfig.shouldRefreshOnPublish = true; - } - } - - self.forceResetAndExit = function() { - self.setExitUrl(); - self.setForceRefreshOnPublish(); - } - - self.doneButtonClicked = function() { - self.forceResetAndExit(); - FLBuilder.triggerHook('triggerDone'); - } - - $( window ).load( self.setExitUrl ); - $( document ).on( 'click', '.fl-builder-save-actions .fl-builder-publish-button', self.setExitUrl ); - $( document ).on( 'click', '.fl-builder-save-actions .fl-builder-discard-button', self.setExitUrl ); - $( document ).on( 'click', '.fl-builder-save-actions .fl-builder-cancel-button', self.setExitUrl ); - - $( document ).on( 'click', '.fl-builder-done-button.fl-builder-button', self.doneButtonClicked ); - $( document ).on( 'click', '.fl-builder-button.fl-builder-button-primary[data-action="publish"]', self.forceResetAndExit ); - - self.previewPostSelector.on( 'change', function() { - $.ajax( { - type: 'post', - dataType: 'json', - url: ajaxurl, - data: { - action: 'set_preview_post', - ct_id: toolset_user_editors.mediumId, - preview_post_id: this.value, - nonce: toolset_user_editors.nonce - }, - complete: function() { - FLBuilder._updateLayout(); - } - } ); - } ); - - self.preventExraContainerPreventClickPropagation = function() { - $( 'body' ).on( 'click', '.js-toolset-editors-frontend-editor-extra .js-toolset-editors-frontend-editor-extra-content', function( e ) { - e.stopPropagation(); - }); - }; - - self.init = function() { - self.extraContainer.insertBefore( '.fl-builder-bar-actions' ); - self.extraContainer.show(); - FLBuilder._updateLayout(); - self.preventExraContainerPreventClickPropagation(); - }; - - self.init(); - -}; - -jQuery( document ).ready( function( $ ) { - ToolsetCommon.UserEditor.BeaverBuilderFrontendEditorInstance = new ToolsetCommon.UserEditor.BeaverBuilderFrontendEditor( $ ); -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.php deleted file mode 100644 index a513696..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend-editor.php +++ /dev/null @@ -1,255 +0,0 @@ -action(); - return true; - } - - private function action() { - - } - - public function equivalent_editor_screen_is_active() { - add_action( 'init', array( $this, 'register_as_post_type' ) ); - add_action( 'wp', array( $this, 'load_medium_id_by_post' ), -1 ); - - add_action( 'wp', array( $this, 'register_assets' ) ); - } - - public function load_medium_id_by_post() { - global $post; - - if( ! is_object( $post ) || $post->post_type != 'view-template' ) { - return false; - } - - $this->manager->get_medium()->set_id( $post->ID ); - - // todo outsource complete preview selector to 'resources' - add_action( 'wp_footer', array( $this, 'render_preview_post_selector') ); - - // set global post helper labels outside the frontend editor - add_action( 'wp', array( $this, 'set_global_post_helper_labels' ) ); - - // set preview post as global post - // todo move to beaver/screen/backend - add_action( 'fl_builder_before_render_module', array( $this, 'set_preview_post' ) ); - - // reset global post after content is loaded via ajax - // todo move to beaver/screen/backend - add_action( 'fl_builder_after_render_content', array( $this, 'reset_preview_post' ) ); - - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); - } - - public function register_assets() { - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - $toolset_assets_manager->register_style( - 'toolset-user-editors-ct-frontend-editor-style', - TOOLSET_COMMON_URL . '/user-editors/medium/screen/content-template/frontend-editor.css', - array(), - TOOLSET_COMMON_VERSION - ); - - $toolset_assets_manager->register_script( - 'toolset-user-editors-ct-frontend-editor-script', - TOOLSET_COMMON_URL . '/user-editors/medium/screen/content-template/frontend-editor.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - - $toolset_assets_manager->localize_script( - 'toolset-user-editors-ct-frontend-editor-script', - 'toolset_user_editors', - array( - 'nonce' => wp_create_nonce( 'toolset_user_editors' ), - 'mediumId' => $this->manager->get_medium()->get_id(), - 'mediumUrl' => admin_url( 'admin.php?page=ct-editor&ct_id=' . $this->manager->get_medium()->get_id() ), - ) - ); - - } - - public function enqueue_assets() { - - do_action( 'toolset_enqueue_styles', array( 'toolset-user-editors-ct-frontend-editor-style' ) ); - do_action( 'toolset_enqueue_scripts', array( 'toolset-user-editors-ct-frontend-editor-script' ) ); - - } - - - public function register_as_post_type() { - register_post_type( 'view-template', array( - 'public' => false, - 'publicly_queryable' => true, - 'show_ui' => false, - 'show_in_menu' => false, - 'rewrite' => array( 'slug' => 'view-template' ), - 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ) - ) ); - - flush_rewrite_rules(); - } - - public function set_global_post_helper_labels() { - if( isset( $_GET['fl_builder'] ) ) { - global $post; - $post->post_title = __( '{{Post title}}', 'wpv-views' ); - $post->post_author = get_current_user_id(); - $post->post_date = date( "Y-m-d H:i:s" ); - } - } - - public function set_preview_post() { - if( isset( $_POST['fl_builder_data'] ) ) { - global $post; - - if( $this->original_global_post === null ) { - $this->original_global_post = $post; - } - - $preview_post = $this->get_preview_post_id( $this->original_global_post->ID ); - - if( $preview_post ) { - $post = get_post( $preview_post ); - } - // no preview post selected or selected does not exist anymore - else { - // disable shortcode rendering - add_filter( 'fl_builder_render_shortcodes', '__return_false' ); - } - } - } - - public function reset_preview_post() { - if( isset( $_POST['fl_builder_data'] ) ) { - global $post; - $post = $this->original_global_post; - } - } - - // @todo Offer to preview only posts that have this CT assigned, when frontend editing a CT assigned to single posts. - public function render_preview_post_selector() { - if( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) { - global $post; - - $toolset_frontend_editor = get_post_meta( $post->ID, '_toolset_user_editors_beaver_template', true ); - $preview_slug = array_key_exists( 'preview_slug', $toolset_frontend_editor ) - ? $toolset_frontend_editor['preview_slug'] - : false; - - $preview_posts = array(); - - if( $toolset_frontend_editor['preview_domain'] == 'post' ) { - if ( post_type_exists( $preview_slug ) ) { - $preview_posts = wp_get_recent_posts( array( 'post_type' => $preview_slug ), ARRAY_A ); - } - } else { - if ( taxonomy_exists( $preview_slug ) ) { - - $terms = get_terms( $preview_slug ); - $term_ids = array(); - foreach( $terms as $term ) { - $term_ids[] = $term->term_id; - } - - $preview_posts = wp_get_recent_posts( array( 'post_type' => 'any', 'tax_query' => array( - array( - 'taxonomy' => $preview_slug, - 'field' => 'id', - 'terms' => $term_ids - ))), ARRAY_A ); - - } - } - - $preview_post = $this->get_preview_post_id( $post->ID ); - $preview_post_offered = false; - - $selected = $preview_post == 0 - ? ' selected="selected"' - : ''; - - $options = ''; - foreach( $preview_posts as $single_post ) { - $selected = $preview_post == $single_post['ID'] - ? ' selected="selected"' - : ''; - if ( ! empty( $selected ) ) { - $preview_post_offered = true; - } - $options .= ''; - } - - $output = '' . - '' . - '' . - '' . - '' . - '' . - __( 'Preview this Content Template with:', 'wpv-views' ) . - '' . - '' . - '' . - ''; - - echo $output; - - if ( ! $preview_post_offered ) { - $this->store_preview_post_id( $post->ID, 0 ); - } - } - } - - public function ajax_set_preview_post() { - if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'toolset_user_editors' ) ) { - die( -1 ); - } - - if( isset( $_REQUEST['ct_id'] ) && isset( $_REQUEST['preview_post_id'] ) ) { - $this->store_preview_post_id( (int) $_REQUEST['ct_id'], (int) $_REQUEST['preview_post_id'] ); - } - - die( 1 ); - } - - private function store_preview_post_id( $ct_id, $preview_post_id ) { - update_post_meta( $ct_id, '_toolset_user_editors_frontend_editor_preview_post', $preview_post_id ); - } - - private function get_preview_post_id( $ct_id ) { - $stored_template = get_post_meta( $ct_id, '_toolset_user_editors_frontend_editor_preview_post', true ); - - // stored template available and is an allowed template - if( $stored_template && get_post( $stored_template ) ) { - return $stored_template; - } - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend.php deleted file mode 100644 index c7233aa..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/content-template/frontend.php +++ /dev/null @@ -1,86 +0,0 @@ -is_active_single_post() ) { - return $id; - } - - if( $id = $this->is_active_taxonomy_archive() ) { - return $id; - } - - if( $id = $this->is_active_post_archive() ) { - return $id; - } - - return false; - } - - private function is_active_single_post() { - global $post; - - if( is_single() && is_object( $post ) ) { - $template_selected = get_post_meta( $post->ID, '_views_template', true ); - } - - if( isset( $template_selected ) && $template_selected ) { - return $template_selected; - } - - return false; - } - - private function is_active_taxonomy_archive() { - global $wp_query; - if ( - is_tax() - || is_category() - || is_tag() - ) { - $views_settings = WPV_Settings::get_instance(); - $wpv_options = $views_settings->get(); - $term = $wp_query->get_queried_object(); - if( array_key_exists( 'views_template_loop_' . $term->taxonomy, $wpv_options ) ) { - return $wpv_options['views_template_loop_' . $term->taxonomy]; - } - } - - return false; - } - - private function is_active_post_archive() { - global $post; - - if( is_object( $post ) == false ) { - return; - } - - if( is_post_type_archive( $post->post_type ) && is_object( $post ) ) { - $views_settings = WPV_Settings::get_instance(); - $wpv_options = $views_settings->get(); - - if( array_key_exists( 'views_template_archive_for_' . $post->post_type, $wpv_options ) ) { - return $wpv_options['views_template_archive_for_' . $post->post_type]; - } - } - - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/interface.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/interface.php deleted file mode 100644 index 7fc29d7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/user-editors/medium/screen/interface.php +++ /dev/null @@ -1,25 +0,0 @@ -equivalent_editor_screen_is_active() - */ - public function equivalent_editor_screen_is_active(); - - /** - * This manager class uses this function to make itself available for the medium - * @param Toolset_User_Editors_Manager_Interface $manager - */ - public function add_manager( Toolset_User_Editors_Manager_Interface $manager ); -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/abstract.php deleted file mode 100644 index d60ebca..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/abstract.php +++ /dev/null @@ -1,405 +0,0 @@ -add_condition() concept. - * - * @var bool - */ - protected $is_only_for_administrators = true; - - - /** - * @var string - */ - private $similar_notices_key; - - - /** - * @var callable[] - */ - private $dependency_callbacks = array(); - - - /** - * @var array|null - */ - private $template_context; - - - /** - * Toolset_Admin_Notice constructor. - * - * @param string $id - * @param string $message - * @param Toolset_Constants|null $constants - */ - public function __construct( $id, $message = '', Toolset_Constants $constants = null ) { - - if ( null === $constants ) { - $constants = new Toolset_Constants(); - } - $this->constants = $constants; - - if( ! function_exists( 'sanitize_title' ) ) { - // abort, called to early - throw new InvalidArgumentException( - 'Toolset_Admin_Notice_Abstract Error: "sanitize_title()" does not exists. ' - . 'Toolset_Admin_Notice_Abstract::create_notice() was called too early.' - ); - } - - if( ! is_string( $id ) ) { - // no string given - throw new InvalidArgumentException( 'Toolset_Admin_Notice_Abstract Error: $id must be a string.' ); - } - - if( ! empty( $message ) ) { - $this->set_content( $message ); - } - - $this->id = sanitize_title( $id ); - - // set default template file - $this->set_default_template_file(); - } - - /** - * @return string - */ - public function get_id() { - return $this->id; - } - - /** - * @param string $title - */ - public function set_title( $title ) { - $this->title = $title; - } - - /** - * @param string $key - */ - public function set_similar_notices_key( $key ) { - $this->similar_notices_key = $key; - } - - /** - * @return string - */ - public function get_similar_notices_key() { - return $this->similar_notices_key; - } - - /** - * @return string - */ - public function get_title() { - return $this->title; - } - - /** - * @param string $content - * - * @return bool - */ - public function set_content( $content ) { - if( ! is_string( $content ) ) { - return false; - } - - $this->content = $content; - } - - /** - * @return string - */ - public function get_content() { - return $this->content; - } - - /** - * Output of string - */ - public function render_content() { - if( is_file( $this->content ) ) { - include( $this->content ); - return; - } - - echo $this->content; - } - - /** - * Adds a condition - * - * @param Toolset_Condition_Interface $condition - */ - public function add_condition( Toolset_Condition_Interface $condition ) { - $this->conditions[] = $condition; - } - - /** - * Sets priority of the message - * - * @param int $priority - */ - public function set_priority( $priority ) { - if( is_numeric( $priority ) ) { - $this->priority = $priority; - } - } - - /** - * @return int - */ - public function get_priority( ) { - return $this->priority; - } - - /** - * True or false - * @param bool $bool - */ - public function set_is_dismissible_permanent( $bool ) { - $this->is_dismissible_permanent = $bool === false - ? false - : true; - } - - /** - * @return bool - */ - public function is_dismissible_permanent() { - return $this->is_dismissible_permanent; - } - - /** - * True or false - * @param bool $bool - */ - public function set_is_dismissible_globally( $bool ) { - $this->is_dismissible_globally = $bool === false - ? false - : true; - - if( $this->is_dismissible_globally ) { - $this->is_dismissible_permanent = true; - } - } - - /** - * @return bool - */ - public function is_dimissibile_globally() { - return $this->is_dismissible_globally; - } - - /** - * Getter of is_temporary - * @return bool - */ - public function is_temporary(){ - return $this->is_temporary; - } - - /** - * Print Notice - */ - public function render() { - if( ! file_exists( $this->template_file ) ) { - error_log( 'Toolset_Admin_Notice_Abstract Error: Template "'. $this->template_file . '" could not be found.' ); - return; - } - - $this->run_dependency_callbacks(); - - include( $this->template_file ); - } - - abstract protected function set_default_template_file(); - - public function conditions_met() { - if( $this->get_is_only_for_administrators() && ! current_user_can( 'manage_options' ) ) { - // this notice is only for administrators - return false; - } - - if( empty( $this->conditions ) ) { - // this notice has no conditions - return true; - } - - foreach( $this->conditions as $condition ) { - if( ! $condition->is_met() ) { - return false; - } - } - - // all conditions met - return true; - } - - /** - * Dismiss notice - */ - public function dismiss() { - if( ! $this->is_dismissible_permanent() ) { - error_log( 'Notice with id "' . $this->get_id() . '" is not dismissible.' ); - return; - } - - Toolset_Admin_Notices_Manager::dismiss_notice_by_id( $this->get_id(), $this->is_dimissibile_globally() ); - } - - /** - * @return bool - */ - public function get_is_only_for_administrators() { - return $this->is_only_for_administrators; - } - - /** - * @param bool $bool - */ - public function set_is_only_for_administrators( $bool ) { - $this->is_only_for_administrators = $bool === false - ? false - : true; - } - - public function set_template_path( $template_path ) { - if( file_exists( $template_path ) ) { - $this->template_file = $template_path; - } - } - - /** - * Template path for a notice with the Toolset Robot - */ - public function set_template_toolset_robot() { - $this->template_file = TOOLSET_COMMON_PATH . '/templates/admin/notice/toolset-robot.phtml'; - } - - - /** - * @inheritdoc - * @param callable $callback - * @since 2.8 - */ - public function add_dependency_callback( $callback ) { - if( ! is_callable( $callback ) ) { - throw new InvalidArgumentException(); - } - - $this->dependency_callbacks[] = $callback; - } - - - /** - * Run all callbacks previously added via add_dependency_callback(). - * - * @since 2.8 - */ - public function run_dependency_callbacks() { - foreach( $this->dependency_callbacks as $callback ) { - $callback(); - } - } - - - /** - * Set a context variable that will be accessible when rendering the notice template. - * - * @param array $context - * - * @return void - * @since 2.á - */ - public function set_template_context( $context ) { - $this->template_context = toolset_ensarr( $context ); - } - - - /** - * Get the context variable. - * - * @return array - */ - public function get_template_context() { - return toolset_ensarr( $this->template_context ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/dismissible.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/dismissible.php deleted file mode 100644 index 08d2c25..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/dismissible.php +++ /dev/null @@ -1,30 +0,0 @@ -template_file = TOOLSET_COMMON_PATH . '/templates/admin/notice/toolset.phtml'; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/error.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/error.php deleted file mode 100644 index 67fe47e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/error.php +++ /dev/null @@ -1,22 +0,0 @@ -template_file = TOOLSET_COMMON_PATH . '/templates/admin/notice/error.phtml'; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/interface.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/interface.php deleted file mode 100644 index bf8446d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/interface.php +++ /dev/null @@ -1,152 +0,0 @@ -message - */ - public function get_content(); - - - /** - * Renders the whole notice - */ - public function render(); - - /** - * Adds a condition - * - * @param Toolset_Condition_Interface $condition - */ - public function add_condition( Toolset_Condition_Interface $condition ); - - /** - * True or false - * @param bool $bool - */ - public function set_is_dismissible_permanent( $bool ); - - /** - * @return bool - */ - public function is_dismissible_permanent(); - - - /** - * True or false - * @param bool $bool - */ - public function set_is_dismissible_globally( $bool ); - - /** - * @return bool - */ - public function is_dimissibile_globally(); - - /** - * Sets priority of the message - * - * @param int $priority - */ - public function set_priority( $priority ); - - /** - * @return int - */ - public function get_priority(); - - /** - * Temporary message or not - * @return bool - */ - public function is_temporary(); - - /** - * @return mixed - */ - public function dismiss(); - - /** - * @return bool - */ - public function get_is_only_for_administrators(); - - /** - * @param bool $bool - */ - public function set_is_only_for_administrators( $bool ); - - /** - * @param string $key - */ - public function set_similar_notices_key( $key ); - - /** - * @return string - */ - public function get_similar_notices_key(); - - - /** - * @return string - */ - public function render_content(); - - - /** - * Add a callback that will be invoked just before rendering the notice. - * - * It can be used for enqueuing assets, etc. - * - * @param callable $callback - * @return void - * @since 2.8 - */ - public function add_dependency_callback( $callback ); - - - /** - * Set a context variable that will be accessible when rendering the notice template. - * - * @param array $context - * - * @return void - * @since 2.á - */ - public function set_template_context( $context ); - - - /** - * Get the context variable. - * - * @return array - */ - public function get_template_context(); -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/layouts/help.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/layouts/help.php deleted file mode 100644 index f775de8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/layouts/help.php +++ /dev/null @@ -1,66 +0,0 @@ -template_file = TOOLSET_COMMON_PATH . '/templates/admin/notice/toolset-custom-position.phtml'; - } - - /** - * Overwrites the render which is fired on 'admin_notices' - * We use it to forward the rendering to 'ddl-print-editor-additional-help-link' - * to show the notice after the title of the layout - */ - public function render() { - add_action( 'ddl-print-editor-additional-help-link', array( $this, 'true_render' ), 100, 2 ); - } - - /** - * Called on 'ddl-print-editor-additional-help-link' - * This renders the notice. - * - * @param $layouts_array - * @param $current_id - */ - public function true_render( $layouts_array, $current_id ) { - if( empty( $this->content ) || Toolset_Admin_Notices_Manager::is_notice_dismissed( $this ) ) { - // abort if we have no content or notices is dismissed - return; - } - parent::render(); - } - - /** - * As Toolset_Admin_Notice_Layouts_Help is registered before we knowing the id, - * we need to allow to set the id afterwards - * - * @param $id - */ - public function set_id( $id ) { - if( is_string( $id ) ) { - $this->id = sanitize_title( $id ); - } - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/required/action.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/required/action.php deleted file mode 100644 index 51ea495..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/required/action.php +++ /dev/null @@ -1,30 +0,0 @@ -template_file = TOOLSET_COMMON_PATH . '/templates/admin/notice/toolset.phtml'; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/success.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/success.php deleted file mode 100644 index a354bb0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/success.php +++ /dev/null @@ -1,23 +0,0 @@ -template_file = TOOLSET_COMMON_PATH . '/templates/admin/notice/success.phtml'; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/undismissible.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/undismissible.php deleted file mode 100644 index 1bd3bef..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/undismissible.php +++ /dev/null @@ -1,30 +0,0 @@ -template_file = $this->constants->constant( 'TOOLSET_COMMON_PATH' ) . '/templates/admin/notice/toolset.phtml'; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/warning.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/warning.php deleted file mode 100644 index c4812f7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notice/warning.php +++ /dev/null @@ -1,23 +0,0 @@ -template_file = TOOLSET_COMMON_PATH . '/templates/admin/notice/warning.phtml'; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notices/Builder.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notices/Builder.php deleted file mode 100644 index ceda59d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notices/Builder.php +++ /dev/null @@ -1,114 +0,0 @@ -tplCreateButton( 'toolset-button toolset-button-primary', $title, $attributes ); - } - - /** - * Button - * - * @param $title - * @param array $attributes - * - * @return string - */ - public function tplButton( $title, $attributes = array() ) { - return $this->tplCreateButton( 'toolset-button', $title, $attributes ); - } - - /** - * @param \Toolset_Admin_Notice_Abstract $notice - * @param string $content - */ - public function addNotice( \Toolset_Admin_Notice_Abstract $notice, $content = '' ) { - \Toolset_Admin_Notices_Manager::add_notice( $notice, $content ); - } - - /** - * Internal function to create a button - * - * @param $tpl_class - * @param $title - * @param $attributes - * - * @return string - */ - private function tplCreateButton( $tpl_class, $title, $attributes ) { - $btnClasses = esc_attr( $tpl_class ); - $title = esc_attr( $title ); - - if( ! is_array( $attributes ) ) { - throw new \InvalidArgumentException( - 'OTGS\Toolset\Common\Utility\Admin\Notices\Builder::tplButtonPrimary()' . - ' - Second parameter must be an array.' ); - } - - // define html element based on href - $html_element = isset( $attributes['href'] ) - ? 'a' - : 'span'; - - // attribute class - $attributes['class'] = isset( $attributes['class'] ) - ? $btnClasses . ' ' . esc_attr( $attributes['class'] ) - : $btnClasses; - - // stringify all attributes - $attributes_string = ''; - foreach( $attributes as $key => $value ) { - $attributes_string .= ' ' . esc_attr( $key ). '="' . esc_attr( $value ) . '"'; - } - - // html link - return '<' . $html_element . $attributes_string . '>' . $title . ''; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notices/manager.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notices/manager.php deleted file mode 100644 index b143169..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/admin/notices/manager.php +++ /dev/null @@ -1,451 +0,0 @@ -getMessage() ); - return false; - } - } - - if( ! empty( $content ) ) { - // user sets a message for the notice - $notice->set_content( $content ); - } - - if( array_key_exists( $notice->get_id(), self::$notices ) ) { - // abort, key already exists - //error_log( 'Toolset_Admin_Notices_Manager Info: Notices with key "' . $notice->get_id() . '" already exists.' ); - - return false; - } - - // collect notice - self::$notices[$notice->get_id()] = $notice; - - return $notice; - } - - - /** - * called on WordPress hook 'admin_notices' - */ - public static function show_notices() { - - /** - * toolset-admin-notices-manager-show-notices - * - * @deprecated Use toolset_admin_notices_manager_show_notices instead. - */ - $notices = apply_filters( 'toolset-admin-notices-manager-show-notices', self::$notices ); - - $notices = apply_filters( 'toolset_admin_notices_manager_show_notices', $notices ); - - if( empty( $notices ) ) { - return; - } - - foreach( $notices as $notice ) { - if( ! $notice->conditions_met() - || self::is_notice_dismissed( $notice ) - || self::are_similar_notices_dismissed( $notice ) ) { - // visitor don't want to see the message anymore - continue; - } - - $notice->render(); - } - } - - /** - * Ajax Handler - */ - public static function ajax() { - - if( ! array_key_exists( self::JS_VARNAME_ACTION, $_REQUEST ) - || ! array_key_exists( self::JS_VARNAME_NOTICE_ID, $_REQUEST ) ) { - error_log( 'Toolset_Admin_Notices_Manager Ajax Error: missing js variables.' ); - die(); - } - - if( ! array_key_exists( self::JS_VARNAME_NONCE, $_REQUEST ) ) { - error_log( 'Toolset_Admin_Notices_Manager Ajax Error: nonce is not set.' ); - die(); - } - - if ( ! wp_verify_nonce( $_REQUEST[ self::JS_VARNAME_NONCE ], self::ID ) ) { - error_log( 'Toolset_Admin_Notices_Manager Ajax Error: nonce is not valid.' ); - die(); - } - - switch( $_REQUEST[ self::JS_VARNAME_ACTION ] ) { - case self::JS_TRIGGER_NOTICE_DISMISSIBLE: - $dismiss_globally = substr( $_REQUEST[ self::JS_VARNAME_NOTICE_ID ], -1) == '$' - ? true - : false; - - self::dismiss_notice_by_id( rtrim( $_REQUEST[ self::JS_VARNAME_NOTICE_ID ], '$' ), $dismiss_globally ); - - if( ! empty( $_REQUEST[ self::JS_VARNAME_DISMISS_SIMILAR_NOTICES ] ) ) { - foreach( $_REQUEST[ self::JS_VARNAME_DISMISS_SIMILAR_NOTICES ] as $key ) { - self::dismiss_similar_notices( $key ); - } - } - - die( $_REQUEST[ self::JS_VARNAME_NOTICE_ID ] ); - break; - - default: - die( 'action not found' ); - } - } - - /** - * CSS / JS - */ - public static function public_resources() { - if( ! class_exists( 'Toolset_Assets_Manager' ) ) { - error_log( 'Toolset_Admin_Notices_Manager Error: Dependency "Toolset_Assets_Manager" could not be found.' ); - return; - } - - $toolset_assets_manager = Toolset_Assets_Manager::getInstance(); - - $toolset_assets_manager->register_style( - 'toolset-admin-notices', - TOOLSET_COMMON_URL . '/res/css/toolset-admin-notices.css', - array(), - TOOLSET_COMMON_VERSION - ); - $toolset_assets_manager->enqueue_styles( 'toolset-admin-notices' ); - - $toolset_assets_manager->register_script( - 'toolset-admin-notices', - TOOLSET_COMMON_URL . '/res/js/toolset-admin-notices.js', - array( 'jquery' ), - TOOLSET_COMMON_VERSION, - true - ); - $toolset_assets_manager->localize_script( - 'toolset-admin-notices', - 'toolset_admin_notices', - array( - 'action' => self::ID, - 'nonce' => wp_create_nonce( self::ID ), - 'varnameNonce' => self::JS_VARNAME_NONCE, - 'varnameAction' => self::JS_VARNAME_ACTION, - 'varnameNoticeId' => self::JS_VARNAME_NOTICE_ID, - 'varnameDismissSimilarNotices' => self::JS_VARNAME_DISMISS_SIMILAR_NOTICES, - 'triggerNoticeDismissible' => self::JS_TRIGGER_NOTICE_DISMISSIBLE - ) - ); - - $toolset_assets_manager->enqueue_scripts( 'toolset-admin-notices' ); - } - - /** - * - * @param Toolset_Admin_Notice_Interface $notice - * - * @return bool - */ - public static function is_notice_dismissed( Toolset_Admin_Notice_Interface $notice ) { - if( ! $notice->is_dismissible_permanent() ) { - // notice is not dismissible - return false; - } - - return self::is_notice_dismissed_by_notice_id( $notice->get_id() ); - } - - /** - * This function can be used by using the "id" of the notice instead of Toolset_Admin_Notice_Interface - * "ID" is in this case a unique string, which describes the notice. - * - * @param $notice_id - * - * @return bool - */ - public static function is_notice_dismissed_by_notice_id( $notice_id ) { - $user_id = get_current_user_id(); - - if( $user_id == 0 ) { - return false; - } - - // user settings - $user_settings = get_user_meta( $user_id, self::ID, true ); - - if( is_array( $user_settings ) - && array_key_exists( self::OPTION_FIELD_DISMISSED_NOTICE, $user_settings ) - && array_key_exists( $notice_id, $user_settings[ self::OPTION_FIELD_DISMISSED_NOTICE ] ) - ) { - // user dimissed the message - return true; - } - - // globally dismissed - $settings = get_option( self::ID ); - - if( is_array( $settings ) - && array_key_exists( self::OPTION_FIELD_DISMISSED_NOTICE, $settings ) - && array_key_exists( $notice_id, $settings[ self::OPTION_FIELD_DISMISSED_NOTICE ] ) - ) { - // notice globally dismissed - return true; - } - - return false; - } - - /** - * Store that the current user don't want to see the notice with id anymore - * Notice: We don't check if an notice with that id really exists, - * this way we don't have to initialize notices on ajax calls - * - * @param $notice_id - * - * @param bool $globally - * - * @return bool - */ - public static function dismiss_notice_by_id( $notice_id, $globally = false ) { - if( $globally ) { - // store globally - $settings = get_option( self::ID, array() ); - $settings[ self::OPTION_FIELD_DISMISSED_NOTICE ][ $notice_id ] = true; - update_option( self::ID, $settings ); - return; - } - - $user_id = get_current_user_id(); - - if( $user_id == 0 ) { - return false; - } - - $user_settings = get_user_meta( $user_id, self::ID, true ); - $user_settings = empty( $user_settings ) ? array() : $user_settings; - $user_settings[ self::OPTION_FIELD_DISMISSED_NOTICE ][ $notice_id ] = true; - update_user_meta( $user_id, self::ID, $user_settings ); - } - - /** - * Set stop showing similiar notices by $key_for_similar_notices - * - * @param $key_for_similar_notices - * - * @return bool - */ - public static function dismiss_similar_notices( $key_for_similar_notices ) { - $user_id = get_current_user_id(); - - if( $user_id == 0 ) { - return false; - } - - $user_settings = get_user_meta( $user_id, self::ID, true ); - $user_settings = empty( $user_settings ) ? array() : $user_settings; - $user_settings[ self::OPTION_FIELD_DISMISSED_SIMILAR_NOTICES ][ $key_for_similar_notices ] = true; - update_user_meta( $user_id, self::ID, $user_settings ); - } - - /** - * Check if current user has used the option to stop similar notices - * - * @param Toolset_Admin_Notice_Interface $notice - * - * @return bool - */ - public static function are_similar_notices_dismissed( $notice ) { - if( ! $notice instanceof Toolset_Admin_Notice_Interface ) { - // no proper $notice (we have a filter for it, so probably that's the reason) - return false; - } - - $similar_notices_key = $notice->get_similar_notices_key(); - if( empty( $similar_notices_key ) ) { - // no similar notices key used for this message - return false; - } - - $user_id = get_current_user_id(); - - if( $user_id == 0 ) { - return false; - } - - // user settings - $user_settings = get_user_meta( $user_id, self::ID, true ); - - if( is_array( $user_settings ) - && array_key_exists( self::OPTION_FIELD_DISMISSED_SIMILAR_NOTICES, $user_settings ) - && array_key_exists( $notice->get_similar_notices_key(), $user_settings[ self::OPTION_FIELD_DISMISSED_SIMILAR_NOTICES ] ) - ) { - // user dimissed similar notices - return true; - } - - return false; - } - - - /** - * Create a button. Use of tpl_button_primary() or tpl_button_secondary() is preferred. - * - * @param string $title - * @param string $href - * @param string $class - * @param bool $external - * - * @return string TPL of the link - * @since 2.8 - */ - public static function tpl_button( $title, $href, $class, $external = false ) { - $title = esc_attr( $title ); - $href = esc_url( $href ); - $class = 'toolset-button ' . $class; - $target = ''; - - if( $external === true ) { - // external link - $class .= ' toolset-button-external-link'; - $target = ' target="_blank"'; - } - - // html link - return '' . $title . ''; - } - - - /** - * Create a primary button - * - * @param string $title - * @param string $href - * @param bool $external - * @param string $extra_class - * - * @return string HTML markup of the link. - */ - public static function tpl_button_primary( $title, $href, $external = false, $extra_class = '' ) { - return self::tpl_button( $title, $href, 'toolset-button-primary ' . $extra_class, $external ); - } - - - /** - * Create a secondary button - * - * @param string $title - * @param string $href - * @param bool $external - * @param string $extra_class - * - * @return string HTML markup of the link. - * @since 2.8 - */ - public static function tpl_button_secondary( $title, $href, $external = false, $extra_class = '' ) { - return self::tpl_button( $title, $href, 'toolset-button-secondary ' . $extra_class, $external ); - } - - - /** - * Create a link - * - * @param $title - * @param string $href - * @param bool $external - * - * @return string TPL of the link - */ - public static function tpl_link( $title, $href, $external = false ) { - $title = esc_attr( $title ); - $href = esc_url( $href ); - $class = ''; - $target = ''; - - if( $external === true ) { - // external link - $class .= ' toolset-button-external-link'; - $target = ' target="_blank"'; - } - - // html link - return '' . $title . ''; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/autoloader.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/autoloader.php deleted file mode 100644 index 1f9a5ad..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/autoloader.php +++ /dev/null @@ -1,126 +0,0 @@ - absolute path to a file where this class is defined - * @throws InvalidArgumentException - * @since m2m - */ - add_action( 'toolset_register_classmap', array( $instance, 'register_classmap' ) ); - - // Actually register the autoloader. - // - // If available (PHP >= 5.3.0), we're setting $prepend = true because this implementation is significantly - // faster than other (legacy) Toolset autoloaders, especially when they don't find the class we're looking for. - // This will (statistically) save a lot of execution time. - if ( PHP_VERSION_ID < 50300 ) { - spl_autoload_register( array( $instance, 'autoload' ), true ); - } else { - spl_autoload_register( array( $instance, 'autoload' ), true, true ); - } - - self::$is_initialized = true; - } - - - private $classmap = array(); - - - /** - * Register a classmap. - * - * Merges given classmap with the existing one. - * - * The one who is adding mappings is responsible for existence of the files. - * - * @param string[string] $classmap class name => absolute path to a file where this class is defined - * @param null|string $base_path - * @throws InvalidArgumentException - * @since m2m - */ - public function register_classmap( $classmap, $base_path = null ) { - - if( ! is_array( $classmap ) ) { - throw new InvalidArgumentException( 'The classmap must be an array.' ); - } - - if( is_string( $base_path ) ) { - foreach( $classmap as $class_name => $relative_path ) { - $classmap[ $class_name ] = "$base_path/$relative_path"; - } - } - - $this->classmap = array_merge( $this->classmap, $classmap ); - - } - - - /** - * Try to autoload a class if it's in the classmap. - * - * @param string $class_name - * @return bool True if the file specified by the classmap was loaded, false otherwise. - * @since m2m - */ - public function autoload( $class_name ) { - - if( array_key_exists( $class_name, $this->classmap ) ) { - $file_name = $this->classmap[ $class_name ]; - - // If this causes an error, blame the one who filled the $classmap. - require_once $file_name; - - return true; - } - - return false; - } - - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/interface.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/interface.php deleted file mode 100644 index 8059d71..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/interface.php +++ /dev/null @@ -1,8 +0,0 @@ -is_met() ) { - // false, if views is active - self::$is_met_result = false; - return false; - } - - $layouts_active = new Toolset_Condition_Plugin_Layouts_Active(); - if( $layouts_active->is_met() ) { - // false, if layouts is active - self::$is_met_result = false; - return false; - } - - $cred_active = new Toolset_Condition_Plugin_Cred_Active(); - if( $cred_active->is_met() ) { - // false, if access is active - self::$is_met_result = false; - return false; - } - - $access_active = new Toolset_Condition_Plugin_Access_Active(); - if( $access_active->is_met() ) { - // false, if access is active - self::$is_met_result = false; - return false; - } - - $all_plugins = get_plugins(); - - foreach( $all_plugins as $plugin_path => $plugin ) { - if( strpos( $plugin['Name'], 'Toolset' ) !== false // Toolset Plugin - && strpos( $plugin['Name'], 'Types' ) === false // except Types - && is_plugin_active( $plugin_path ) // and is active - ) { - preg_match( '#Working only while (.*?) is active#', $plugin['Description'], $description ); - error_log( '$description ' . print_r( $description, true ) ); - $theme_name = isset( $description[1] ) && ! empty( $description[1] ) - ? $description[1] - : true; - - // true, there is a encrypted Toolset commercial plugin active, - // but not working because of an invalid theme - self::$is_met_result = $theme_name; - return true; - } - } - - // only types installed - self::$is_met_result = false; - return false; - } - - /** - * @return bool - */ - public function get_theme() { - return is_string( self::$is_met_result ) ? self::$is_met_result : false; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/installer/is_available.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/installer/is_available.php deleted file mode 100644 index 021ba45..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/installer/is_available.php +++ /dev/null @@ -1,42 +0,0 @@ -is_types_active_condition = $is_types_active_di ?: new \Toolset_Condition_Plugin_Types_Active(); - $this->is_wpml_active_condition = $is_wpml_active_di ?: new \Toolset_Condition_Plugin_Wpml_Is_Active_And_Configured(); - } - - - /** - * @return bool - */ - public function is_met() { - return ( $this->is_types_active_condition->is_met() || $this->is_wpml_active_condition->is_met() ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/installer/is_toolset_subscription_valid.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/installer/is_toolset_subscription_valid.php deleted file mode 100644 index d50aa0f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/installer/is_toolset_subscription_valid.php +++ /dev/null @@ -1,43 +0,0 @@ -is_installer_available = $is_available_di ?: new IsAvailable(); - } - - - /** - * @return bool - */ - public function is_met() { - if( ! $this->is_installer_available->is_met() ) { - return false; - } - - $subscription_status = apply_filters( 'otgs_installer_repository_subscription_status', null, 'toolset' ); - $is_registered = ( 'valid' === $subscription_status ); - - return $is_registered; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/layouts/active.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/layouts/active.php deleted file mode 100644 index 37fd9f7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/layouts/active.php +++ /dev/null @@ -1,18 +0,0 @@ - 'dd_layouts', 'numberposts' => 1 ) ); - - if( ! empty( $existing_layouts ) ) { - self::$is_met_result = false; - return false; - } - - self::$is_met_result = true; - return true; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/types/active.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/types/active.php deleted file mode 100644 index 13cc75d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/types/active.php +++ /dev/null @@ -1,17 +0,0 @@ - $relationship ) { - if( is_array( $relationship ) && ! empty( $relationship ) ) { - // Found something. - return true; - } - } - - // No actual relationship found. - return false; - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/types/missing.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/types/missing.php deleted file mode 100644 index 678d6c5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/types/missing.php +++ /dev/null @@ -1,14 +0,0 @@ -is_wpml_active_and_configured() ) { - return false; - } - - return version_compare( - Toolset_WPML_Compatibility::get_instance()->get_wpml_version(), - Toolset_Relationship_Controller::MINIMAL_WPML_VERSION, - '<' - ); - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/wpml/is_active_and_configured.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/wpml/is_active_and_configured.php deleted file mode 100644 index 4c200f8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/wpml/is_active_and_configured.php +++ /dev/null @@ -1,16 +0,0 @@ -is_wpml_active_and_configured(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/wpml/is_current_language_default.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/wpml/is_current_language_default.php deleted file mode 100644 index de13942..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/plugin/wpml/is_current_language_default.php +++ /dev/null @@ -1,22 +0,0 @@ -is_wpml_active_and_configured() - || $wpml_service->get_current_language() === $wpml_service->get_default_language() - ); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/avada/not-active-or-greater-equal-5-0.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/avada/not-active-or-greater-equal-5-0.php deleted file mode 100644 index dc04d8d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/avada/not-active-or-greater-equal-5-0.php +++ /dev/null @@ -1,37 +0,0 @@ -= 0 ) { - // Avada active and version >= 5.0 - self::$is_met_result = true; - return true; - } - - // Avada is active but lower than 5.0 - self::$is_met_result = false; - return false; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/native/available.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/native/available.php deleted file mode 100644 index 9716c9c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/native/available.php +++ /dev/null @@ -1,58 +0,0 @@ -get_supported_plugin_integration(); - return self::$is_met_result === false ? false : true; - } - - /** - * Returns array of information (see get_supported_themes()) - * - * @return array|false - */ - public function get_supported_plugin_integration() { - if ( self::$is_met_result !== null ) { - // we have a cached result - return self::$is_met_result; - } - - $current_theme = wp_get_theme( get_template() ); - - if ( ! is_object( $current_theme ) - || ! method_exists( $current_theme, 'get' ) - || $current_theme->get( 'Name' ) === false ) { - return false; - } - - $theme_name = $current_theme->get( 'Name' ); - - $supported_themes = $this->get_supported_themes(); - - if ( ! array_key_exists( $theme_name, $supported_themes ) ) { - return false; - } - - return $supported_themes[ $theme_name ]; - } - - /** - * Returns a list of supported themes - */ - public function get_supported_themes() { - return array( - 'Avada' => array( - 'theme_name' => 'Avada', - 'plugin_name' => 'Toolset Avada Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/toolset-avada-integration/' . - '?utm_source=typesplugin' . - '&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-Avada-sites-with-Layouts' . - '&utm_content=layouts-Avada' - ), - - 'Cornerstone, for WordPress' => array( - 'theme_name' => 'Cornerstone', - 'plugin_name' => 'Toolset Cornerstone Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/toolset-cornerstone-integration/' . - '?utm_source=typesplugin' . - '&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-Cornerstone-sites-with-Layouts' . - '&utm_content=layouts-Cornerstone' - ), - - 'Divi' => array( - 'theme_name' => 'Divi', - 'plugin_name' => 'Toolset Divi Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/toolset-divi-integration/' . - '?utm_source=typesplugin' . - '&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-Divi-sites-with-Layouts' . - '&utm_content=layouts-Divi' - ), - - 'Genesis' => array( - 'theme_name' => 'Genesis', - 'plugin_name' => 'Toolset Genesis Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/layouts-genesis-integration/' . - '?utm_source=typesplugin' . - '&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-Genesis-sites-with-Layouts' . - '&utm_content=layouts-Genesis' - ), - - 'Customizr' => array( - 'theme_name' => 'Customizr', - 'plugin_name' => 'Toolset Customizr Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/toolset-customizr-integration/' . - '?utm_source=typesplugin' . - '&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-Customizr-sites-with-Layouts' . - '&utm_content=layouts-Customizr' - ), - - 'Twenty Sixteen' => array( - 'theme_name' => 'Twenty Sixteen', - 'plugin_name' => 'Toolset Twenty Sixteen Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/toolset-twenty-sixteen-integration/' . - '?utm_source=typesplugin' . - '&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-TwentySixteen-sites-with-Layouts' . - '&utm_content=layouts-TwentySixteen' - ), - - 'Twenty Fifteen' => array( - 'theme_name' => 'Twenty Fifteen', - 'plugin_name' => 'Toolset Twenty Fifteen Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/toolset-twenty-fifteen-integration/' . - '?utm_source=typesplugin&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-TwentyFifteen-sites-with-Layouts' . - '&utm_content=layouts-TwentyFifteen' - ), - - 'Twenty Seventeen' => array( - 'theme_name' => 'Twenty Seventeen', - 'plugin_name' => 'Toolset Twenty Seventeen Integration', - 'doc_link' => 'https://toolset.com/documentation/user-guides/toolset-twenty-seventeen-integration/' . - '?utm_source=typesplugin' . - '&utm_campaign=types' . - '&utm_medium=theme-integration-message' . - '&utm_term=how-to-design-TwentySeventeen-sites-with-Layouts' . - '&utm_content=layouts-TwentySeventeen' - ), - ); - } - - /** - * @param $name - * - * @return mixed - */ - public function get_supported_theme_by_name( $name ) { - foreach( $this->get_supported_themes() as $theme ) { - if( $theme['theme_name'] == $name ) { - return $theme; - } - } - } -} - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/missing.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/missing.php deleted file mode 100644 index a312510..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/missing.php +++ /dev/null @@ -1,15 +0,0 @@ - $plugin ) { - if( $plugin['Name'] == $integration_plugin['plugin_name'] ) { - if( is_plugin_inactive( $plugin_path ) ) { - $plugin['Path'] = $plugin_path; - self::$is_met_result = $plugin; - return true; - } - } - } - - self::$is_met_result = false; - return false; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/not-installed.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/not-installed.php deleted file mode 100644 index 758672e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/plugin/not-installed.php +++ /dev/null @@ -1,42 +0,0 @@ -get_supported_plugin_integration(); - - $all_plugins = get_plugins(); - - foreach( $all_plugins as $plugin ) { - if( $plugin['Name'] == $integration_plugin['plugin_name'] ) { - self::$is_met_result = false; - return false; - } - } - - self::$is_met_result = true; - return true; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/active.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/active.php deleted file mode 100644 index 18da615..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/active.php +++ /dev/null @@ -1,53 +0,0 @@ -get( 'Name' ) == $current_theme->get( 'Name' ) - || $theme_for_integration->get_template() == $current_theme->get_template() ) { - self::$is_met_result = $theme_for_integration; - return true; - } - - // theme is active - self::$is_met_result = false; - return false; - } - - /** - * @return WP_Theme|false - */ - public function get_theme() { - if( self::$is_met_result !== null ) { - // return cached result - return self::$is_met_result; - } - - return false; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/installed.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/installed.php deleted file mode 100644 index 96a3f58..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/installed.php +++ /dev/null @@ -1,51 +0,0 @@ -get( 'Name' ) == $theme_supported_by_integration ) { - self::$is_met_result = $theme; - return true; - } - } - - self::$is_met_result = false; - return false; - } - - /** - * @return WP_Theme|false - */ - public function get_theme() { - if( self::$is_met_result === null ) { - self::is_met(); - } - - return self::$is_met_result; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/not-active.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/not-active.php deleted file mode 100644 index d2f4f5e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/layouts-support/theme/not-active.php +++ /dev/null @@ -1,52 +0,0 @@ -get( 'Name' ) != $current_theme->get( 'Name' ) ) { - self::$is_met_result = $theme_for_integration; - return true; - } - - // theme is active - self::$is_met_result = false; - return false; - } - - /** - * @return WP_Theme|false - */ - public function get_theme() { - if( self::$is_met_result !== null ) { - // return cached result - return self::$is_met_result; - } - - return false; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/toolset-based/active.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/toolset-based/active.php deleted file mode 100644 index 4af3722..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/theme/toolset-based/active.php +++ /dev/null @@ -1,35 +0,0 @@ -is_met() ) { - // false, if views is active - self::$is_met_result = false; - return false; - } - - $layouts_active = new Toolset_Condition_Plugin_Layouts_Active(); - if( $layouts_active->is_met() ) { - // false, if layouts is active - self::$is_met_result = false; - return false; - } - - $cred_active = new Toolset_Condition_Plugin_Cred_Active(); - if( $cred_active->is_met() ) { - // false, if access is active - self::$is_met_result = false; - return false; - } - - $access_active = new Toolset_Condition_Plugin_Access_Active(); - if( $access_active->is_met() ) { - // false, if access is active - self::$is_met_result = false; - return false; - } - - if( defined( 'TOOLSET_BASED_THEME_ACTIVE' ) ) { - // it can happen that twice toolset based themes are running on the same site - self::$is_met_result = false; - return false; - } - - if( defined( 'TOOLSET_BASED_THEME_INACTIVE' ) ) { - // no other tbt active and one inactive tbt - self::$is_met_result = TOOLSET_BASED_THEME_INACTIVE; - return true; - } - - self::$is_met_result = false; - return false; - } - - /** - * @return string|false - */ - public function get_theme() { - return is_string( self::$is_met_result ) ? self::$is_met_result : false; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/user/role/admin.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/user/role/admin.php deleted file mode 100644 index 2fafe81..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/condition/user/role/admin.php +++ /dev/null @@ -1,16 +0,0 @@ -
      or
        */ -.ddl-form { - margin: 0 0 15px 0; -} - -ul.ddl-form { /* If .ddl-form class is added directly to
          element */ - list-style: none; -} - -.ddl-form ul { /* If .ddl-form class is added to
            element wrapper */ - margin: 0; -} - -/* form elements */ -.ddl-form > li, -.ddl-form > p, -.ddl-form .ddl-form-item, -.ddl-form .ddl-form-item > p, -.ddl-form .ddl-form-item .fields-group, -.ddl-form .ddl-form-item .ddl-form-item { - margin: 0 0 5px 0; -} - -.ddl-form > p:first-child { - margin-top: 0; -} -.ddl-form > p:last-child { - margin-bottom: 0; -} - -/* clearfix */ -.ddl-form:after, -.ddl-form > li:after, -.ddl-form > p:after, -.ddl-form .ddl-form-item:after, -.ddl-form > ul:before, -.ddl-form > li:before, -.ddl-form > p:before, -.ddl-form:before, -.ddl-form .ddl-form-item:before, -.ddl-form .ddl-form-item > ul:after, -.ddl-form .ddl-form-item > li:after, -.ddl-form .ddl-form-item > p:after, -.ddl-form .ddl-form-item .fields-group:after, -.ddl-form .ddl-form-item > p:before, -.ddl-form .ddl-form-item .fields-group:before { - display: table; - content: " "; -} - -.ddl-form:after, -.ddl-form > ul:after, -.ddl-form li:after, -.ddl-form > p:after, -.ddl-form .ddl-form-item:after, -.ddl-form .ddl-form-item > ul:after, -.ddl-form .ddl-form-item > p:after, -.ddl-form .ddl-form-item .fields-group:after { - clear: both; -} - -.ddl-form label, -.ddl-form legend { - display: block; - float: left; - margin: 0 0px 0 0; - padding: 1px 4px 1px 0px; - width: 168px; - vertical-align: top; - font-weight: bold; - font-size: 13px; - text-align:right; -} -.ddl-form .cred-popup-box label, .ddl-form .cred-popup-box legend{text-align: left;} - - -.ddl-form input, -.ddl-form textarea, .ddl-form select { - font-size: 13px; -} - -.ddl-form input[type="text"], -.ddl-form input[type="number"], -.ddl-form textarea, -.ddl-form select, -.ddl-form .radio, /* radios and checkboxes should be wrapped in .radio or .checkbox element */ -.ddl-form .checkbox, -.ddl-form .fields-group, -.ddl-form .desc, -.ddl-form .toolset_select2-container { - display: block; - float: right; - clear: right; - width: 555px; - color: #474747; -} - -.ddl-form .ddl-form-input-alert { - display: block; - float: right; - clear: right; - width: 536px; - padding: 5px 14px 5px 14px; -} - - -.ddl-form select.ddl-narrow-width, .ddl-form input.ddl-narrow-width{ - width: 277px; - margin-right: 278px; -} - -.ddl-form input[type="text"].ddl-form-indent, -.ddl-form input[type="number"].ddl-form-indent, -.ddl-form textarea.ddl-form-indent, -.ddl-form select.ddl-form-indent, -.ddl-form .radio.ddl-form-indent, /* radios and checkboxes should be wrapped in .radio or .checkbox element */ -.ddl-form .checkbox.ddl-form-indent, -.ddl-form .fields-group.ddl-form-indent, -.ddl-form .desc.ddl-form-indent, -.ddl-form .toolset_select2-container.ddl-form-indent { - width: 534px; -} - -.ddl-form .desc.ddl-form-indent { - float: right !important; -} - -.ddl-form .ddl-form-input-alert.ddl-form-indent { - width: 506px; -} - -.ddl-form .desc { - margin: 5px 0 0 0; - color: #999; - font-size: 10px; -} - -.ddl-form .fields-group > p:first-child { - margin-top: 0; -} -.ddl-form .fields-group > p:last-child { - margin-bottom: 0; -} - -.ddl-form .radio label, -.ddl-form .checkbox label, -.ddl-form fieldset label, -.ddl-form .fields-group label { - margin: 0; - width: auto; - font-weight: normal; -} - -.ddl-form .radio, -.ddl-form .checkbox { - margin-right: 0; - font-weight: normal; -} - -.ddl-form .radio input, -.ddl-form .checkbox input { - vertical-align: middle; -} - -.ddl-form fieldset label, -.ddl-form .fields-group label { - float: none; - margin: 0 10px 0 0; -} - -.ddl-form .fields-group > ul > li, -.ddl-form .fields-group > p, -.ddl-form .fields-group > .ddl-form-item { - margin: 0 0 5px 0; -} - -.ddl-form .fields-group input[type="text"], -.ddl-form .fields-group input[type="number"], -.ddl-form .fields-group textarea, -.ddl-form .fields-group select, -.ddl-form .fields-group .radio, -.ddl-form .fields-group .checkbox, -.ddl-form .fields-group .desc, -.ddl-form .fields-group .toolset_select2-container { - float: none; -} - -.ddl-form .radio, /* radios and checkboxes should be wrapped in .radio or .checkbox element */ -.ddl-form .checkbox,.ddl-form .fields-group .radio, -.ddl-form .fields-group .checkbox{ - float:left; -} - -/* Alternative vertical layout. .ddl-form-item-fullwidth should be added to: .ddl-form-item,
          • or

            tag */ -.ddl-form .ddl-form-item-fullwidth label, -.ddl-form .ddl-form-item-fullwidth legend, -.ddl-form .ddl-form-item-fullwidth input[type="text"], -.ddl-form .ddl-form-item-fullwidth input[type="number"], -.ddl-form .ddl-form-item-fullwidth textarea, -.ddl-form .ddl-form-item-fullwidth select, -.ddl-form .ddl-form-item-fullwidth .desc, -.ddl-form .ddl-form-item-fullwidth .ddl-form .toolset_select2-container, -.ddl-form .ddl-form-item-fullwidth .fields-group { - display: block; - width: 100%; - float: none; -} - -.ddl-form .ddl-form-item-fullwidth legend { - margin-bottom: 10px; -} - -/* .ddl-form-inputs-inline should be added to inputs direct wrapper element, not to .ddl-form-item

          • or

            tag */ -.ddl-form .ddl-form-inputs-inline label, -.ddl-form .ddl-form-inputs-inline input[type="text"], -.ddl-form .ddl-form-inputs-inline input[type="number"], -.ddl-form .ddl-form-inputs-inline textarea, -.ddl-form .ddl-form-inputs-inline select { - display: inline-block; - float: none; - margin: 0 10px 10px 0; - width: auto; - vertical-align: baseline; -} - -.ddl-form .ddl-form-inputs-inline label { - margin: 0; -} - -.ddl-form .ddl-form-inputs-inline .radio, -.ddl-form .ddl-form-inputs-inline .checkbox { - margin: 0 10px 10px 0; - vertical-align: baseline; -} - -/* Validation */ -.ddl-form .invalid, -.ddl-form .invalid:focus, -.ddl-form .invalid .toolset_select2-choices { - border-color: #e9322d; - box-shadow: 0 0 6px #f8b9b7 inset; -} -.ddl-form .invalid.toolset_select2-container { - border: none; - box-shadow: none; -} -/* Dialogs Forms END */ - -/* ----------------- */ -/* Repeatable fields */ -/* ----------------- */ -.ddl-repeat-field-container { -} - -.ddl-repeat-field, -.ddl-repeat-field-placeholder { - padding: 10px 0; - border-top: 1px solid #ededed; - background-color: #fff; -} - -.ddl-repeat-field-placeholder { - border: 1px dashed #ccc; -} - -.ddl-repeat-field:hover { - background: #fafafa; -} - -/* clearfix */ -.ddl-repeat-field:before, -.ddl-repeat-field:after, -.ddl-repeat-field > ul:before, -.ddl-repeat-field > li:before, -.ddl-repeat-field > p:before, -.ddl-repeat-field > ul:after, -.ddl-repeat-field > li:after, -.ddl-repeat-field > p:after { - display: table; - content: " "; -} - -.ddl-repeat-field:after, -.ddl-repeat-field > ul:after, -.ddl-repeat-field li:after, -.ddl-repeat-field > p:after { - clear: both; -} - -.ddl-form-button-wrap { - padding-top: 15px; - clear: both; - text-align: right; -} - -.ddl-form-button-wrap button { - margin-left: 0; -} - -.ddl-repeat-field-toolbar { - position: relative; -} -.ddl-repeat-field:only-child .ddl-repeat-field-toolbar { - display: none; -} - -.ddl-repeat-field-container:only-of-type .ddl-repeat-field-toolbar { - display: none; -} - -.ddl-repeat-field-toolbar .icon-remove { - position: absolute; - right: 5px; - color: #d54e21; - opacity: .8; - cursor: pointer; -} - -.ddl-repeat-field-toolbar .icon-resize-vertical { - display: inline-block; - width: 20px; - color: #0074a2; - text-align: center; - opacity: .6; - cursor: ns-resize; -} -.ddl-repeat-field-toolbar i:hover { - opacity: 1; -} -/* Repeating fields END */ - -/* - This file contains generic forms styles ONLY. - General dialogs styles should go into dd-dialogs-general.css - Styles for specific dialogs should go into dd-dialogs.css -*/ - -/* Add a custom styling for CRED */ -.ddl-cred-css .ddl-form h3 [class^="icon-layouts"] { - position: relative; - top: -4px; -} - - -/* Message inside the form */ -.ddl-form .ddl-dialog-form-message{display: block; - float: right; - clear: right; - width: 540px;} - -input#searchbar-input{float:none;} - -.cm-s-default { z-index: 0; } - -/* SHOW MORE POSTS */ -li.toolset_select2-results-dept-0.toolset_select2-result.show-more-posts-options{font-weight:bold;color:#f05a28;} -i.load-posts-spinner{color:black;} -i.load-posts-spinner:hover{color:white;} -/* ////// LANGUAGE SWITCHER///////// */ -.ddl-single-assignments-box-controls{ - display: block; - clear: both; - float: left; - width: 100%; -} -.ddl-single-assignments-posts-who-controls{ - float: left; -} -.ddl-single-assignments-box-lang-controls{ - float:right; -} -/* OVERRIDES */ -fieldset.ddl-dialog-fieldset{margin:0px 0px 0px;padding:10px 0px 0px;} -fieldset.ddl-dialog-fieldset span{padding-right:6px;} -i.ddl-wpml-flag{float:left;width:20px;height:20px;padding-right:4px;} - -/* //////// MARKUP CONTROLS IN CELL DIALOG START/////////*/ -.css-styling-controls{padding-top:12px;border-top:1px solid #ededed;margin-top:20px;} -.ddl-markup-controls{padding-top:0px!important;} -/* extra cells*/ -.visual-editor-editor-switch-container-wrap{margin-top:6px!important;} -.ddl-dialog-button-wrap{} -/* IMAGE CELL*/ -.ddl-button-media-huge{width:340px;height:56px!important;font-size:16px!important;margin-top:30px!important;margin-bottom:30px!important;} -.ddl-form-button-image-wrap{text-align:center;padding-top:0px;} -.ddl-imagebox-cell-preview-wrap img{margin-bottom:6px;} -ul.form-image-box-wrap li{} -.ddl-border-bottom{border-bottom:1px solid #ededed;padding-bottom:20px!important;margin-bottom:20px!important;} -ul.form-image-box-wrap li:last-child{} -.ddl-align-center{text-align:center!important;display:block;} -.ddl-manual-width{width:192px!important;} -.ddl-manual-width-190{width:190px!important;} -.ddl-manual-width-201{} -.label{text-align:left;} -.ddl-input-wrap{display: block; - float: right; - clear: right; - width: 555px;} -/*////// SLIDER CELL OVERRIDES //////////*/ -.ddl-input-half-width{width:50%!important;float:left!important;margin-left: -1px;} -.question-mark-and-the-mysterians{margin-left:3px;cursor:pointer;color:rgba(128, 128, 128, 0.71);} -.ddl-input-two-thirds-width{width:76%!important;margin-right:2px;float:left!important;margin-left: -1px;} -.ddl-measure-unit{font-size:11px;margin-left:3px;} -/* //////// MARKUP CONTROLS IN CELL DIALOG END /////////*/ -.ddl-zero{height:1px!important;padding:0px!important;margin:0px!important;} -.checkbox-smaller{width:95%!important;margin-right:0px!important;padding-right:0px!important;display:inline!important;} -.ddl-button-group{width:140px!important;} -/* ////////// FORM CT CELL OVERRIDES ///////////////////////// */ -.ddl-dialog-label{ - display: block!important; - float: left!important; - margin: 0 0px 0 0!important; - padding: 1px 0!important; - width: 168px!important; - vertical-align: top!important; - font-weight: bold!important; - font-size: 13px!important; -} -.ddl-dialog-form-span-inner{ - font-weight: bold!important; - font-size: 13px!important; - margin-right:6px; - margin-left:6px; -} -.ddl-ct-cell-content-controls-box{padding-bottom: 6px;} -.ddl-ct-cell-content-controls-box a.button-small{margin-bottom:4px;} -.ddl-button-open-wrap{ - width: 77%; - text-align: right; - display: inline-block; -} -/* /// JS and CSS Editors Controls //////////*/ -.wpv-editor-metadata-toggle{ - border-top: none; - display: block; - margin: 0; - padding: 0 28px 0 0; - height: 35px; - line-height: 35px; - border: solid 1px #ccc; - font-weight: bold; - cursor: pointer; - background: #e5e5e5; - background: -moz-linear-gradient(top, #e5e5e5 0%, #f4f4f4 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e5e5e5), color-stop(100%,#f4f4f4)); - background: -webkit-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: -o-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: -ms-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: linear-gradient(to bottom, #e5e5e5 0%,#f4f4f4 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5e5e5', endColorstr='#f4f4f4',GradientType=0 ); -} -/*///////////// DUPLICATE LAYOUT TOOLSET RESOURCES DIALOG //////////////////////*/ -table.ddl-duplicate-selection-table{width:100%;} -.ddl-duplicate-selection-table-title-row th{width:25%;text-align:left;font-weight:bold;padding:8px;} -.ddl-duplicate-selection-table-data-row td{width:25%;text-align:left;font-weight:normal;padding:8px;} -.ddl-duplicate-selection-table-data-row td.ddl-duplicate-selection-table-data-column-input-wrap{} -.ddl-duplicate-selection-table-data-row td input[type="checkbox"]{margin-left:54px;} -.ddl-duplicate-selection-table-data-row td input[type="radio"]{margin-left:54px;} -.ddl-duplicate-selection-table-data-row td.ddl-duplicate-anchor{cursor:pointer;font-size:11px;margin-left:4px;} -.ddl-duplicate-selection-table-data-row td.ddl-duplicate-result-first{width:18%;} -.ddl-duplicate-selection-table-data-row td.ddl-duplicate-result-middle{width:30%;} -.ddl-duplicate-selection-table-data-row td.ddl-duplicate-result-last{width:10%;padding-left:35px;} -.ddl-dialog-content-main{border-right:none!important;} -.ddl-duplicate-template-alert{width:95%;line-height: 1.3!important;} -a.ddl-duplicate-anchor{cursor:pointer;} -.ddl-duplicate-info-details{display:none;} -/*///////// IFRAME OVERRIDES //////////////////////////////////////////////////////*/ -.ddl-setting-for-layouts-container-in-iframe div.js-default-dialog-content, .ddl-setting-for-layouts-container-in-iframe div.row-not-render-message{display:none;} -.ddl-setting-for-layouts-container-in-iframe .css-styling-controls{padding-top:0px;margin-top:0px;} -.ddl-setting-for-layouts-container-in-iframe span.desc{padding-bottom:6px;padding-top:0px;width:555px!important;} -input.css-id-control{width:555px!important;} -/* -@todo This should not be here, cotainers with specific size limitations should have a specific classname, not the generic Toolset dialogs ones. -*/ -.toolset-ui-dialog:not(.toolset-ui-dialog-responsive) .toolset-shortcode-gui-dialog-container{min-height:92px!important;max-height:370px!important;} -/*///////// OVERRIDES /////////////////*/ -/* -@todo This should not be here, buttonpanes with specific styles should have a specific classname, not the generic Toolset dialogs ones. -*/ -.ui-dialog-buttonpane{padding: 8px;} - -.ddl-youtube-video-cell span.px_box { - display: block; - margin-top: 4px; - float: right; - clear: right; - width: auto; - text-align: left; -} -.ddl-youtube-video-cell .ddl-layout-video-input{ - display: block; - float: left !important; - clear: right; - width: 515px !important; - color: #474747; -} - -.ddl-youtube-video-cell .desc { - margin: 5px 0 0 0; - color: #999; - width: 545px !important; - font-size: 10px; - text-align: left; -} -.ddl-youtube-video-cell label{ - width: 211px !important; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/css/dd-dialogs-general.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/css/dd-dialogs-general.css deleted file mode 100644 index 28f6c62..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/css/dd-dialogs-general.css +++ /dev/null @@ -1,312 +0,0 @@ -/* - This file should contain generic dialogs styles only. - Styles for dialogs forms are in the dd-forms.css file - Styles for specific dialogs are in the dd-dialogs.css file - */ - -/* ------- */ -/* DIALOGS */ -/* ------- */ - -/* Dialogs global */ -.ddl-dialogs-container { - display: none; -} - -.ddl-dialog { - position: relative; - width: 800px; - background: #fff; - box-shadow: 0 0 15px rgba(0,0,0,.4); -} - -/* - Add auto-width class to make dialog width adapt automatically to contents - But use it wisely! Dialogs forms are designed for fixed width - If auto-width is set you can use only fullwidth forms ( .ddl-form-item-fullwidth class ); -*/ -.ddl-dialog.auto-width { - width: auto; - min-width: 400px; -} - - .ddl-dialog-header, - .ddl-dialog-content, - .ddl-dialog-footer { - overflow: hidden; - margin: 0; - padding: 10px; - border: 1px solid #ededed; - background: #fafafa; - position:relative; - } - - .ddl-dialog-header{ - padding-top: 9px; - padding-bottom: 9px; - } - - .ddl-dialog-footer{ - padding-top: 8px; - padding-bottom: 7px; - } - - .ddl-dialog-content { - overflow-y: auto; - padding-right: 10px; - max-height: 400px; - border-width: 0 0 0 0; /*no content borders*/ - background: #fff; - } - - .auto-width .ddl-dialog-content { - padding-right: 10px; - } - - /* .h-lt-X classes are added dynamicaly to the HTML tag. See more details in dd_layouts_common_scripts.js */ - .h-lt-1100 .ddl-dialog-content, - .h-lt-1100 .layouts-views-loading { - max-height: 870px; - } - .h-lt-1050 .ddl-dialog-content, - .h-lt-1050 .layouts-views-loading { - max-height: 820px; - } - .h-lt-1000 .ddl-dialog-content, - .h-lt-1000 .layouts-views-loading { - max-height: 770px; - } - .h-lt-950 .ddl-dialog-content, - .h-lt-950 .layouts-views-loading { - max-height: 720px; - } - .h-lt-900 .ddl-dialog-content, - .h-lt-900 .layouts-views-loading{ - max-height: 670px; - } - .h-lt-850 .ddl-dialog-content, - .h-lt-850 .layouts-views-loading { - max-height: 620px; - } - .h-lt-800 .ddl-dialog-content, - .h-lt-800 .layouts-views-loading { - max-height: 570px; - } - .h-lt-750 .ddl-dialog-content, - .h-lt-750 .layouts-views-loading { - max-height: 520px; - } - .h-lt-700 .ddl-dialog-content, - .h-lt-700 .layouts-views-loading { - max-height: 470px; - } - .h-lt-650 .ddl-dialog-content, - .h-lt-650 .layouts-views-loading { - max-height: 420px; - } - .h-lt-600 .ddl-dialog-content, - .h-lt-600 .layouts-views-loading { - max-height: 370px; - } - .h-lt-550 .ddl-dialog-content, - .h-lt-550 .layouts-views-loading { - max-height: 320px; - } - .h-lt-500 .ddl-dialog-content, - .h-lt-500 .layouts-views-loading { - max-height: 220px; - } - - .ddl-dialog-content::-webkit-scrollbar { - width: 12px; - height: 12px; - border-left: 1px solid #f1f1f1; - background-color: #fafafa; - } - .ddl-dialog-content::-webkit-scrollbar:hover { - background-color: #eee; - } - .ddl-dialog-content::-webkit-scrollbar-thumb { - min-width: 13px; - min-height: 12px; - background-color: rgba(0, 0, 0, .1); - } - .ddl-dialog-content::-webkit-scrollbar-thumb:hover { - background-color: rgba(0, 0, 0, .2); - } - .ddl-dialog-content::-webkit-scrollbar-thumb:active { - background-color: rgba(0, 0, 0, .3); - } - - .h-lt-1100 .ddl-dialog-content.no-scrollbar { - padding-right: 20px; - max-height: none; - } - - .ddl-dialog-content > :first-child { - margin-top: 0; - } - - /* Dialog tabs */ - .ddl-dialog .ui-tabs-nav { - border-bottom: 1px solid #ddd; - overflow: hidden; - } - - .ddl-dialog .ui-tabs-nav li { - position: relative; - top: 1px; - display: inline-block; - margin: 0 5px 0 0; - padding: 5px; - outline: none; - border: 1px solid #ddd; - border-radius: 3px 3px 0 0; - background: #eee; - float:left; - } - .ddl-dialog .ui-tabs-nav .ui-tabs-active { - border-bottom: 1px solid #fff; - background: #fff; - } - - .ddl-dialog .ui-tabs-nav a { - outline: none; - color: #333; - text-decoration: none; - } - - .ddl-popup-tab { - padding: 0px 0 0 10px; - } - - .ddl-popup-tab-full { - margin-top: -14px; - margin-bottom: 5px; - border: 1px solid #ddd; - padding: 10px 0 0 10px; - } - - .ddl-tab-right { - float: right !important; - } - - /* Dialog tabs END */ - - .ddl-video-toolbar { - position: relative; - top: -10px; - left: -10px; - overflow: hidden; - margin-right: -30px; - } - - .ddl-video-container { - margin-bottom: 10px; - } - - .ddl-video-container:empty { - margin: 0; - } - - .ddl-dialog-content-main { - } - .ddl-dialog-content-main:empty { - display: none; - } - - .ddl-dialog-header { - border-width: 0 0 1px 0; - } - - .ddl-dialog-header .icon-remove { - position: absolute; - top: 10px; - right: 10px; - cursor: pointer; - font-size:14px; - } - - .ddl-dialog-header .icon-remove:hover { - color: #00a0d2; - } - - .ddl-dialog-header h2 { - margin: 0; - padding: 0 20px 0 0; - font-weight: normal; - font-size: 18px; - font-weight: 600; - } - - .ddl-dialog-footer { - clear: both; - text-align: right; - } - - .ddl-dialog-content .ddl-section-title { - margin-top : 0px; - margin-bottom : 0px; - padding: 1px 0px 1px 5px; - border-left: 1px solid #CCC; - } -/* Dialogs global END */ - - -/* New Layout: Select Parent*/ -label.set-parent-layout-select{ - width: 150px !important; - float:left !important; - margin-left: -2px !important; -} -.set-parent-layout-select select{ - width:145px; -} -.set-parent-layout-checkbox{ - float:left !important; - width:350px !important; - margin-top: 6px !important; - display: inline-block; -} -/* New Layout: Select Parent*/ - - -/* - This file should contain generic dialogs styles only. - Styles for dialogs forms are in the dd-forms.css file - Styles for specific dialogs are in the dd-dialogs.css file - */ - -/* OVERRIDES FOR CREATION DIALOG - @Riccardo: I am placing these rules here since I cannot load dd-dialog.css in post edit page - since it completely changes the rules for the editor sidebar -*/ -ul.post-types-list-in-layout-editor{padding: 0px 0px 10px 10px;} -.close-change-use{float:left;} -.create-layout-form-dialog .change-layout-use-section{margin-left:15px;} -.assign-checkboxes-elements-wrap{display:block;clear:both;} -.assign-checkboxes-elements-wrap label{float:left;display:inline-block;clear:right;font-size: 13px;} -label.post-types-apply-to-all-selection-label{display:none;} -label.post-types-apply-to-all-selection-label input[type="checkbox"]{margin-left:4px;} -.ddl-change-layout-use-for-post-types-box-wrapper .assign-checkboxes-elements-wrap label.post-types-apply-to-all-selection-label{margin-left:8px;} -.ddl-change-layout-use-for-post-types-box-wrapper .assign-checkboxes-elements-wrap label{margin-bottom: 6px;} -.ddl-continue-to-layout-creation{float:right;margin-left:10px!important;} -.ddl-for-post-types-messages{float:left;padding:0px 72px 12px 24px;} - -/* - * Styling for the layouts css controls shown at bottom of CRED form - */ - -.ddl-cred-css { - border: 1px solid #ddd; - padding: 10px; -} - -.ddl-cred-css h3 { - padding: 0px 0px !important; - margin: 0px; -} - -/* GENERAL OVERRIDES FOR TOOLSET ELEMENTS DIALOGS */ -.ddl-dialog-footer button.ddl-toolset-cell-button{margin-left:3px;} -p.cleared{clear:both!important;padding-top:4px!important;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/css/dd-dialogs.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/css/dd-dialogs.css deleted file mode 100644 index 68c0326..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/css/dd-dialogs.css +++ /dev/null @@ -1,1238 +0,0 @@ -/* - This file contains styles for specific dialogs only. - General dialogs styles should go into dd-dialogs-general.css - General forms styles should go into dd-dialogs-forms.css - */ - -/* ------------------*/ -/* Hiererchical tree */ -/* ------------------*/ -.grid, -.grid ul, -.tree, -.tree ul { - margin: 0; - padding: 0; - list-style: none; - cursor: default; -} - -.grid ul, -.tree ul { - position: relative; - margin-left: -14px; -} - -.grid ul ul, -.tree ul ul { - margin: 10px 0 0 6px; -} - -.tree ul:before { - position: absolute; - top: 0; - bottom: 0; - left: 0; - display: block; - width: 0; - border-left: 1px solid #ccc; - content: ""; -} - -.tree ul li:before { - position: absolute; - top: 12px; - left: 0; - display: block; - width: 12px; - height: 0; - border-top: 1px solid #ccc; - content: ""; -} - -.tree ul li.last:before, -.tree ul li:last-child:before { - bottom: 0; - height: auto; - background: #fff; -} -.grid li, -.tree li { - position: relative; - margin: 0 0 10px 0; - padding: 0 20px; - font-size: 14px; - line-height: 25px; -} - -.grid > li:first-child, -.tree > li:first-child { - font-size: 18px; -} - -.grid li .tree-category-title, -.tree li .tree-category-title { - margin: 0 0 10px -20px; - font-weight: normal; - font-size: 18px; -} - -.grid li .tree-category-title { - margin-bottom: 4px; -} - -.tree li .item-name-wrap { - margin: 0; -} - -.tree li .item-name-wrap .icon-views-logo { - margin-left: -3px; -} - -.tree li .item-name-wrap a { - display: inline-block; - text-decoration: none; - line-height: 16px; -} - -.tree li .contains-search-results > .item-name-wrap a { - color: #ccc; -} - -.tree li .icon-info-sign, -.tree li .icon-remove, -.tree li .item-desc { - display: none; -} - -.tree li .icon-remove, -.tree li .icon-info-sign { - opacity: .6; -} - -.tree li .icon-remove { - color: #b94a48; -} - -.tree li .icon-remove:hover, -.tree li .icon-info-sign:hover { - opacity: 1; -} - -.tree li .item-desc { - position: relative; - margin: 0; - padding-left: 22px; -} - -.tree ul ul li .item-desc { - padding-left: 0; -} - -.tree ul .icon-info-sign.active, -.tree ul .item-name-wrap:hover .icon-remove, -.tree ul .item-name-wrap:hover .icon-info-sign { - display: inline-block; - margin: 0 0 0 5px; - cursor: pointer; -} - -.tree li .tree-item-title i { - color: #999; -} - -.tree li .item-type-icon { - display: inline-block; - margin-right: 2px; - max-width: 16px; - vertical-align: baseline; -} - -.tree li i.icon-collapse-alt, -.tree li i.icon-expand-alt, -.tree li i.item-type-icon { - display: inline-block; - width: 16px; -} - -.tree li .icon-expand-alt, -.tree li .icon-collapse-alt { - opacity: .6; - cursor: pointer; -} - -.tree li .icon-expand-alt:hover, -.tree li .icon-collapse-alt:hover { - opacity: 1; -} - -.tree .selected { - font-weight: bold; -} - -.tree .item-preview { - display: none; - position: fixed; - margin: 0 0 0 40px; - box-shadow: 0 0 20px rgba(0,0,0,.3); -} -/* Hiererchical tree */ - -/* ---------- */ -/* Codemirror */ -/* ---------- */ -.code-editor { - clear: both; - margin: 0 0 15px 0; -} - -.code-editor-toolbar { - padding: 5px 2px 0 2px; - border: 1px solid #ccc; - border-width: 1px 1px 0 1px; - border-radius: 2px 2px 0 0; - background: #e5e5e5; - background: -moz-linear-gradient(top, #e5e5e5 0%, #f4f4f4 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e5e5e5), color-stop(100%,#f4f4f4)); - background: -webkit-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: -o-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: -ms-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: linear-gradient(to bottom, #e5e5e5 0%,#f4f4f4 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5e5e5', endColorstr='#f4f4f4',GradientType=0 ); -} - -.ddl-dialog .layout-css-editor .code-editor-toolbar { - height:20px; -} - -.ddl-dialog .wpv-ct-inline-edit .code-editor-toolbar { - height:33px; -} - -.ddl-dialog .layout-css-editor .CodeMirror { - border: solid 1px #ccc; - margin-left: 21px; /* .coremirror-bookmarks width */ -} - -.ddl-dialog .wpv-ct-inline-edit .CodeMirror { - border: solid 1px #ccc; - margin-left: 0px; -} - -.ddl-dialog .wpv-ct-inline-edit .quicktags-toolbar { - border: 1px solid #ccc; - border-width: 1px 1px 0 1px; - background: #f4f4f4; -} - -.ddl-form .code-editor-toolbar>ul>li { - float: left; - margin: 0 2px 5px 2px; - color: #666; - vertical-align: middle; - text-align: center; - cursor: pointer; -} -.ddl-form .code-editor-toolbar>ul:after { - clear: both; -} - - -/* Codemirror END */ - -/* --------------------- */ -/* Codemirror bookmarks */ -/* --------------------- */ -.codemirror-bookmarks { - position: relative; - margin: 0; - width: 20px; - height: 300px; - border: 1px solid #ccc; - border-width: 1px 0 1px 1px; - float: left; -} - -.codemirror-bookmarks li { - position: absolute; - right: 0; - left: 0; - display: block; - margin: 0; - height: 3px; - background: #0074a2; - text-indent: 100%; - white-space: nowrap; -} -.codemirror-bookmarks li.active, -.codemirror-bookmarks li:hover { - left: -4px; - background: #0074a2; - cursor: default; - transition: left 0.1s; -} - -.codemirror-bookmarks li:after { - position: absolute; - left: 30px; - display: block; - margin-top: -12px; - width: 0; - height: 0; - background: rgba(0,0,0,.8); - color: #fff; - content: attr(data-tooltip); - text-align: left; - text-indent: 0; - opacity: 0; -} - -.codemirror-bookmarks li:hover:after { - padding: 5px; - width: auto; - height: auto; - opacity: 1; - transition: opacity .5s; - z-index: 5; -} -/* Codemirror bookmarks END */ - -/* ----------------------------------- */ -/* Styles for new rop type selection */ -/* ----------------------------------- */ - -.presets-list.row-types li { - padding: 0; -} - -.presets-list figure { - margin: 0; - padding: 10px; -} - -.presets-list figure:hover { - background-color: #ededed; -} - -.presets-list figure.selected { - background-color: #ffda73; - border: solid 1px rgb(255, 188, 0); -} - -.presets-list img { - width: 100%; - margin: 0 auto; -} - -.presets-list figure + .radio { - margin: 0 5px 0 10px; - padding: 5px; - font-size: 13px; -} - - - - -/* ----- */ -/* TEMP */ -/* ----- */ -.ddl-dialog .widget-top .widget-title-action { - display: inline-block; - float: left; -} -.ddl-dialog-widgets .widget-content { - text-align: left; -} - -.ddl-dialog .js .widget .widget-top{ - cursor:pointer; -} -.ddl-dialog .widget{ - margin-bottom: 1px; - background: none repeat scroll 0 0 transparent; -} - -.ddl-dialog .selected-widget-action { - margin-top: 6px!important; -} - -.ddl-dialog .widget, -.ddl-dialog .widget .widget-top{ - border: none; - background:none; -} - -.widget-cell-controls { - float: right; - width: 74%; -} - -.widget-cell-controls p:first-child { - margin-top: 0; -} - -.ddl-dialog .post-content-page { - width: 100% !important; -} - -.ddl-dialog.ddl-dialog-video { - max-width: none; - width: auto; -} - -.widget-cell-controls label { - font-size: 14px; - line-height: 22px; -} - -/* TEMP END */ - - -/* Styles to override WP widgets inputs in Layouts dialogs */ - -.widget-cell-controls label, -.widget-cell-controls .checkbox, -.widget-cell-controls .radio { - display: inline-block; - vertical-align: middle; -} - -.widget-cell-controls .checkbox, -.widget-cell-controls .radio { - width: 16px; - margin-right: 3px; -} - -.widget-cell-controls small { - display: block; - margin: 5px 0 0; - font-size: 10px; - color: #999; -} - -.widget-cell-controls input[type=text] + br { - display: none; -} -/* widgets overriding END */ - -#ddl-select-element-box .icon-views { - margin-top: 3px; - vertical-align: -3px; - position : relative; - left : -4px; -} - -#ddl-select-element-box input::-ms-clear { - display: none; -} - -/* Child layout remove dialog */ -button.delete-child-layout-button{width:460px;} -span.alert-child-layout{ - border:none; - background-color: transparent; - color: #d00; - font-size:10px; - font-style: italic; -} - -.child-layout-remove, -.child-layout-delete { - margin-bottom: 22px; -} -/* Child layout remove dialog end*/ - -/* Change Layout Use Dialog (assignment dialog box)*/ - -.change-layout-use-section-title{} -.change-layout-use-section-title-outer{} -.change-layout-use-section-title-inner{margin-top:10px;font-weight:bold;margin-bottom:4px;} - -i.change-layout-use-section-title-icon-collapse{padding-left:6px;cursor:pointer;} -.change-layout-use-section-title{cursor:pointer;} -ul.change-layout-use-section{margin-top:6px;} -div.alert-no-loops, div.alert-no-post-content{background:transparent;border:none;color:inherit;padding-bottom: 0;padding-top:1px;} -div.alert-no-loops p, div.alert-no-post-content p{} -div.alert-no-loops i.remove-alert-message, div.alert-no-post-content i.remove-alert-message{position:absolute;top:2px;right:4px;color:#999;cursor:pointer;} -div.alert-no-loops i.remove-alert-message:hover, div.alert-no-post-content i.remove-alert-message:hover{color:#999;} -div.alert-no-loops, div.alert-no-post-content{line-height: 1.2;position:relative;} -.toolset_page_dd_layouts div.alert-no-loops, .toolset_page_dd_layouts div.alert-no-post-content{} -.save-archives-options-wrap{text-align: right;} -ul.post-types-list-in-layout-editor-alerted, ul.post-loops-list-in-layout-editor-alerted{border:1px solid;border-color: #fbeed5;background-color: #fcf8e3;} - -.change-layout-use-section li input.buttons-change-update{padding-right:10px!important;padding-left:10px!important;} -div.dialog-change-use-messages{display: inline-block; margin-right: 10px} -div.dialog-change-use-messages p{margin:0 0 0 0px;text-align:right;padding:6px 20px 6px 10px;} -div.dialog-change-use-messages p .toolset-alert-close{top:6px;} - -/*overrides for ui tabs styles*/ -.ddl-dialog .ui-widget{font-size:1em;} -.ddl-dialog .ui-widget-content{background:transparent;border:none;} -.ddl-dialog .ui-widget-header{border:none;background:transparent;border-bottom:1px solid #ccc;border-bottom-left-radius: 0px;border-bottom-right-radius: 0px;} -.ddl-dialog .ddl-dialog-content-main{border:none;background: transparent;padding-left:0px !important;padding-right:0px !important;} -.ddl-dialog .ui-tabs-nav li.ddl-tab-right {margin-right:0px;} -.ddl-dialog .ddl-dialog-content-main .ddl-form{padding:10px;margin-bottom:0;} -p.desc a.fieldset-inputs{color:#0074a2;} - -.individual-pages-wrap .ui-widget-content{background:transparent;border:none;} -.individual-pages-wrap .ui-widget-header{border:none;background:transparent;margin-bottom: 14px;padding-bottom: 0px;} -.individual-pages-wrap .ddl-individual-tab{border:none;border:1px solid #ccc;position: relative;top: -3px; background: white;border-radius: 3px;border-top-left-radius: 0px;overflow-x: hidden;} -.individual-pages-wrap .ui-tabs-nav li{padding-bottom:8px;} -.ddl-individual-tab div.ajax-loader{ bottom: 6px;position: relative;left: 45%;} - -.ddl-dialog .ui-slider{border:1px solid #ccc;border-radius: 0px;} - -.ddl-dialog .ddl-dialog-content{font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Open Sans", sans-serif;} -.ddl-dialog .ui-widget, .ddl-dialog .ui-widget input, .ddl-dialog .ui-widget select, .ddl-dialog .ui-widget textarea, .ddl-dialog .ui-widget button{font-family: "Open Sans",sans-serif;} -.ddl-dialog .ui-widget button.qt-fullscreen{font: 400 20px/1 dashicons;} -.ddl-dialog .ui-widget-header, .ui-widget-header *{font-weight: normal;} -.ddl-dialog .ui-widget-content a.fieldset-inputs{color:#0074a2;} - -/* Change Layout Use Dialog End*/ - - -/* Dialogs Forms END */ - -.individual-pages-list li { - display: inline-block; - margin-right: 20px; -} - -.individual-pages-list .icon-remove { - cursor: pointer; -} - -.individual-pages-list .icon-remove:hover { - color: #d54e21; -} - -.ddl-posts-check-list { - margin-top: 0px; -} - -.ddl-individual-tab { - max-height: 180px; - overflow: auto; -} - -.ddl-individual-quick-search { - margin-bottom: 5px; - width:50%; -} - -span.individual-quick-search-desc{color: #999;font-size: 10px;float:left;margin:-5px 0px 0px 2px;width:100%;clear:both;} - -/* RICH CONTENT CELL VISUAL EDITOR */ - -/* Comments cell preview */ -.ddl-comments-image{ - float:left; - width:40px; - height:40px; - background: url(../images/default_avatar.png) no-repeat; -} -.ddl-link-text{ - text-decoration: underline; - color:#0074a2; -} -/* Posts loop preview */ -.ddl-post-loop-item-preview{ - text-align: left; - padding-left:10px; - padding-right: 10px; - margin: 0; -} -.ddl-post-loop-item-preview h2{ - color:#0074a2; - font-size:14px; - cursor: pointer; - font-weight: bold; - margin-bottom:0; - line-height: 18px !important; - margin: 0 !important; -} -.ddl-post-image{ - float:left; - width:50px; - height:45px; - -} -.ddl-link-text-prev{ - float:left; - margin-left:10px; -} -.ddl-link-text-next{ - float:right; - margin-right: 10px; -} - -/* slider cell preview */ -.ddl-slider-slide-preview{ - min-height:50px; - position: relative; - margin-top:-20px !important; - margin-bottom:10px !important; -} -.ddl-slider-slide-preview h2{ - text-align: center; -} -.ddl-slider-slide-left{ - position: absolute; - top:30%; - left:0px; -} -.ddl-slider-slide-right{ - position: absolute; - top:30%; - right:0px; -} -.ddl-slider-slide-image{ - text-align: center; -} -.ddl-slider-slide-image i{ - font-size:100px !important; -} - -/* Imagebox preview */ -.ddl-imagebox-preview{ - min-height:50px; - position: relative; - margin-top:-20px !important; - margin-bottom:10px !important; - text-align: center; -} -.ddl-imagebox-preview h2{ - text-align: center; -} - -/* Video preview */ -.ddl-video-preview{ - min-height:50px; - position: relative; - margin-top:-20px !important; - margin-bottom:10px !important; - text-align: center; -} -.ddl-video-preview h2{ - text-align: center; -} - -/* Post content */ -.ddl-post-content-current-page-preview{ - text-align: left; -} - -/*Menu*/ -.ddl-menu-preview{ - text-align: center; -} - - -/* ------------------ */ -/* Grid of cell types */ -/* ------------------ */ - -.grid { - box-sizing: border-box; -} -.grid *, -.grid *:before, -.grid *:after { - box-sizing: inherit; -} -.grid > li:after { - content: ""; - display: table; - clear: both; -} - -ul.grid { - float: none; -} -.grid .grid-category { - margin-bottom: 20px; - border-bottom: 1px solid #b3b3b3; -} - -.grid-category-item.active { - position: relative; - background: #fff; - z-index: 1; -} -.grid-category-item.active:after, -.grid-category-item.active:before { - top: 100%; - left: 50%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -.grid-category-item.active:after { - border-color: rgba(255, 255, 255, 0); - border-top-color: #fff; - border-width: 10px; - margin-left: -10px; -} -.grid-category-item.active:before { - border-color: rgba(179, 179, 179, 0); - border-top-color: #b3b3b3; - border-width: 12px; - margin-left: -12px; -} - - -.item-details { - position: relative; -} - -.item-details:before { - content: ""; - display: block; - height: 12px; - /*border-top: 1px solid #b3b3b3;*/ -} - -.item-details .item-header:after, -.item-details .item-header:before { - content: ""; - position: absolute; - bottom: 100%; - width: 0; - height: 0; - border: solid transparent; - pointer-events: none; -} -.item-details .item-header:before { - margin-left: -12px; - border-width: 12px; - border-color: rgba(204, 204, 204, 0); - border-bottom-color: #ccc; -} -.item-details .item-header:after { - margin-left: -10px; - border-width: 10px; - border-color: rgba(255, 255, 255, 0); - border-bottom-color: #fff; -} - -.col1:after, -.col1:before, -.col1 .item-header:after, -.col1 .item-header:before { - left: 9%; -} -.col2:after, -.col2:before, -.col2 .item-header:after, -.col2 .item-header:before { - left: 29%; -} -.col3:after, -.col3:before, -.col3 .item-header:after, -.col3 .item-header:before { - left: 49%; -} -.col4:after, -.col4:before, -.col4 .item-header:after, -.col4 .item-header:before { - left: 70%; -} -.col5:after, -.col5:before, -.col5 .item-header:after, -.col5 .item-header:before { - left: 89%; -} - - -.grid-category-item { - width: 20%; - float: left; - position: relative; - padding-top:2px; - padding-bottom:2px; - padding-left:1px; -} -.grid-category-item:first-child{padding-left:2px;} -.grid .item-details { - margin-bottom: 15px; - clear: both; -} - -.grid .item-header, -.grid .item-description, -.grid .item-body { - color: #4C4C4C; - border: 1px solid #ccc; -} - -.item-details .item-header + .item-description, -.item-details .item-description + .item-body { - border-top: none; -} - -.grid .item-header { - position: relative; - height: 35px; -} - -.grid .item-header h4 { - padding-left: 10px; -} - -.grid .item-body, -.grid .item-description { - padding: 10px; -} - -.item-body p, -.item-description p { - margin: 0; -} -.item-body img { - margin-bottom: -5px; -} -.item-body .item-insert, -.item-description .item-insert { - display: inline-block; - font-size: 1.35em; - padding: 0 25px; - line-height: 50px; - font-style: italic; - background: #f05a28; - color: #fff; - position:absolute; - bottom: 17px; - right: 17px; - outline: 0; -} - -.class-views-content-grid-cell .item-insert, -.class-ddl-container .item-insert, -.class-cred-cell .item-insert { - bottom: 26px; -} -.class-post-loop-views-cell .item-insert, -.class-child-layout .item-insert, -.class-cell-content-template .item-insert, -.class-post-loop-views-cell .item-insert { - bottom: 25px; -} - -.class-comments-cell .item-insert { - bottom: 19px; -} - -.class-text-cell .item-insert { - bottom: 23px; -} - -.class-menu-cell .item-insert { - bottom: 20px; -} - -.item-body .item-insert .dashicons, -.item-description .item-insert .dashicons{ - margin-left: 5px; - line-height: 55px; -} -.item-body .item-insert:hover, -.item-body .item-insert:focus, -.item-description .item-insert:hover, -.item-description .item-insert:focus { - background: #d6410f; -} - -.item-description-no-preview { - min-height: 80px; -} - -.item-description-no-preview p { - width: 500px; -} - -.grid .item-header h4, -.grid .item-actions { - margin: 0; - font-size: 17px; - line-height: 35px; - font-weight: normal; - color: #4C4C4C; -} - -.item-header .item-actions { - position: absolute; - top: 0; - right: 0; - height: 35px; - margin-top: -1px; - color: #fff; - background:#4d4d4d; -} - -.item-header a { - text-decoration: none; - color: inherit; -} -.item-header .item-close { - background: #ccc; - line-height: 35px; - width: 35px; - height: 35px; -} -.item-header .item-close:hover, -.item-header .item-close:focus { - background: #aaa; -} -.preview .grid-category-item:not(.active) { - opacity: .6; -} - -.preview .grid-category-item:not(.active):hover { - opacity: .9; - transition: ease-in-out opacity .3s; -} - - -/* SVG icons grid AND CREATION DIALOG SPECIFIC*/ -.ddl-icon { - width:100%; - cursor:pointer; - max-width: 130px; -} -.ddl-cell-item-name{ - width:100%; - font-family:Verdana, Geneva, sans-serif; - color:#333; - - padding:0px 0px 10px 0px; - font-size:11px; - vertical-align: middle; - text-align: center; - max-width: 120px; - word-wrap: break-word; - line-height:12px; - display: table; - margin: 0 auto; -} -.item-name-subtitle{font-size:10px!important;font-family:Verdana, Geneva, sans-serif;} - -#wrapper-element-box-type .ddl-dialog-content{height:auto;/*max-height:600px;*/position:relative;} - -a.ddl-show-item-desc, a.ddl-show-item-desc{ - float:left; - text-decoration: none; - color:white; - height:auto; - width:130px; - position: relative; -} -.category-row{position: relative;} -.grid-category-item{} -.ddl-tree-category-items{padding:8px 0 0px 0;} -.ddl-move-icon-up{ - top:-30px; -} -.ddl-preview-cell-name{ - overflow:hidden; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Open Sans", sans-serif; - top:5px; - background:#cccccc; - word-wrap: break-word; - text-decoration: none; - position:relative; - color:white; - text-align: center; - margin:0; - padding:0px 0 0px 0; - font-size:11px; - z-index:999; - max-width:130px; - max-height:24px; -} -.ddl-move-box-down{top:8px;max-height:165px;} - -.ddl-max-height-150, a.ddl-max-height-150, .ddl-max-height-150:hover{ - max-height:150px;margin-bottom:10px; -} -.move-name-up{} -/* PREVIEW DIALOG IMAGE */ -/*.item-details img.item-preview{min-width:200px;height:200px;}*/ - -/* CELL PREVIEWS */ - -.ddl-post-content-current-page-preview { - text-align: center; -} - -.ddl-post-content-current-page-preview > img { - margin-top: -20px !important; - margin-bottom: -20px !important; -} - -/* Content template */ -.ddl-post-content-template-preview { - text-align: center; -} - -.ddl-post-content-template-preview > img { - margin-top: -5px !important; - margin-bottom: -30px !important; -} - -/* Views grid */ -.ddl-views-grid-preview { - text-align: center; -} - -.ddl-views-grid-preview > img { - margin-top: -5px !important; - margin-bottom: -10px !important; -} - -/*Menu*/ -.ddl-menu-preview{ - text-align: center; -} - -.ddl-menu-preview > img { - margin-top: -20px !important; - margin-bottom: -20px !important; -} - -/*Slider*/ -.ddl-slider-preview{ - text-align: center; -} - -.ddl-slider-preview > img { - margin-top: -20px !important; - margin-bottom: -20px !important; -} - -/*Video*/ -.ddl-video-preview{ - text-align: center; -} - -.ddl-video-preview > img { - margin-bottom: -20px !important; -} - -/*Image box*/ -.ddl-image-box-preview{ - text-align: center; -} - -.ddl-image-box-preview > img { - margin-top: -20px !important; - margin-bottom: -20px !important; -} -.ddl-image-box-preview-image{ - text-align: center; - display:block; - margin-top:5px; - margin-bottom:5px; - float:left; - position:relative; - width:100%; -} - -.ddl-image-box-preview > img { - -} - -/*Widget*/ -.ddl-widget-preview{ - text-align: center; -} - -.ddl-widget-preview > img { - margin-top: -20px !important; - margin-bottom: -20px !important; -} - -/*Widget*/ -.ddl-widget-area-preview{ - text-align: center; -} - -.ddl-widget-area-preview > img { - margin-top: -20px !important; - margin-bottom: -20px !important; -} - -/*Child Layout*/ -.ddl-child-layout-preview{ - text-align: center; -} - -.ddl-child-layout-preview > img { - margin-top: -20px !important; - margin-bottom: -20px !important; -} - -/*Comment*/ -.ddl-comments-preview{ - text-align: center; -} - -.ddl-comments-preview > img { - margin-top: -10px !important; -} - -/*CRED form*/ -.ddl-cred-preview{ - text-align: center; -} - -.ddl-cred-preview > img { - margin-bottom: -5px !important; -} - -/*post loop*/ -.ddl-post-loop-preview{ - text-align: center; -} - -.ddl-post-loop-preview > img { - margin-bottom: -10px !important; -} - -.cell-preview p:first-child { - margin-top:-5px; -} - -.ddl-parametric-search-preview { - text-align: center; -} - -/* FOOTER MESSAGE */ -.dialogs-error-footer .toolset-alert{ - margin: 0px 0px 0px 10px; - padding-bottom:6px; - padding-top:6px; -} -/* DIALOG ASSIGNED POSTS*/ -.individual-pages-assigned{position: relative;} -.show-all-posts-assigned-in-dialog{font-size:22px;float:right;position:absolute;top:-6px;right:0px;cursor:pointer;} - -/* DISABLE TEXT SELECTION IN CREATE DIALOG*/ -#wrapper-element-box-type, -#wrapper-element-box-type:focus{ - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - outline-style:none;/*IE*/ -} - -#wrapper-element-box-type a, #wrapper-element-box-type a:focus{box-shadow: none;} - -/*#wrapper-element-box-type h3, #wrapper-element-box-type div, #wrapper-element-box-type p, #wrapper-element-box-type span{ - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Open Sans", sans-serif; -}*/ -#wrapper-element-box-type h3.tree-toggle-element{ - font-family: "FontAwesome",sans-serif; -} -/* CREATE LAYOUT SEARCH */ -#ddl-select-element-box .ddl-dialog-header{} -#ddl-select-element-box .ddl-dialog-header h2{float:left;display:inline-block;margin:10px 0px 0px;padding:0px 0px 0px;} -.cells-list-grid-wrap{margin-top:32px;} -.ddl-create-dialog-search-wrap{float:right;padding-bottom: 0px;position:relative;right:10px;} -.ddl-create-dialog-search-wrap-inner{padding:6px 0 0 0;margin:0;position:relative;float:left;display:block;width:100%;} -.cells-tree-search{position:relative;right:11px;float:right;} -.ddl-create-dialog-search-wrap-inner i{font-family: 'FontAwesome';float:right;position:relative;font-size:15px;top:6px;right:14px;} -li.grid-category{} - -/* FORMATTING INSTUCTIONS SHORTCODES */ - -.ddl-form .wpv-editor-instructions-toggle { - display: block; - margin: 0; - padding: 0 28px 0 0; - height: 30px; - line-height: 30px; - border: solid 1px #ccc; - border-top: none; - font-weight: bold; - cursor: pointer; - background: #e5e5e5; - background: -moz-linear-gradient(top, #e5e5e5 0%, #f4f4f4 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e5e5e5), color-stop(100%,#f4f4f4)); - background: -webkit-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: -o-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: -ms-linear-gradient(top, #e5e5e5 0%,#f4f4f4 100%); - background: linear-gradient(to bottom, #e5e5e5 0%,#f4f4f4 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5e5e5', endColorstr='#f4f4f4',GradientType=0 ); -} -.ddl-form .wpv-toggle-toggler-icon { - display: inline-block; - float: left; - width: 28px; - margin-right: 10px; - text-align: center; - border-right: solid 1px #ccc; -} -.ddl-form .wpv-editor-instructions { - border: solid 1px #ccc; - border-top: none; - padding: 1px 28px 5px; - background: #f6f6f6; - max-height: 400px; - overflow-y: auto; -} - -.wpv-editor-instructions dl dt { - font-weight: bold; - margin-top: 0.5em; -} -.ddl-form .wpv-editor-instructions .widefat { - margin-bottom: 20px; -} -.ddl-form .wpv-editor-instructions h4 { - color: #efefef; - background: #999; - padding: 1px 5px; -} -.ddl-form .wpv-code { - font-family: Consolas,Monaco,monospace; -} -.ddl-form .wpv-shortcode { - color: #ed8027; -} -.ddl-form .wpv-html { - color: #170; -} -a.js-show-cell-dialog, a.js-show-cell-dialog:hover{text-decoration: none;} - -/*////////////////////// Content Template Cell ///////////////////////*/ -.ct-name-span{min-height:18px;min-width:100px;display: inline-block;cursor:text;} - -.js-individual-pages-assigned .hidden{ - visibility: hidden; -} -.tree-toggle-element:before{cursor:pointer;} -/*///////// OVERRIDES ////////////////*/ -a.ddl-help-link-link{font-size:12px;} -/*////// JQUERY.UI OVERRIDES ///////////////////////////////////*/ -.ddl-dialogs-container .ui-dialog-titlebar-close{font-size:14px;color:#444!important;top: 10px!important;} -.ddl-dialogs-container .ui-dialog-titlebar-close:before{ - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - content: "\f00d"; -} -.ddl-dialogs-container .ui-dialog-titlebar-close:hover{color:#00a0d2!important;} -.ddl-fields-description-wrap h4{margin-bottom:2px;padding-bottom: 0px;margin-top:0px;padding-top: 0px;} -p.ddl-fields-description{padding-top:2px;margin-top:0px;padding-bottom: 12px;font-size: 12px;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/js/views/abstract/ddl-abstract-dialog.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/js/views/abstract/ddl-abstract-dialog.js deleted file mode 100644 index c902bb1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/js/views/abstract/ddl-abstract-dialog.js +++ /dev/null @@ -1,34 +0,0 @@ -var DDLayout = DDLayout || {}; - -( function($) { - $.widget('DDLayout.ddldialog', $.ui.dialog, { - open: function() { - // Add beforeOpen event. - if ( this.isOpen() || false === this._trigger('beforeOpen') ) { - return; - } - - // Open the dialog. - this._super(); - // WebKit leaves focus in the TinyMCE editor unless we shift focus. - this.element.focus(); - this._trigger('refresh'); - }, - _allowInteraction: function( event ) { - return !!$( event.target ).is( ".toolset_select2-input" ) || this._super( event ); - }, - _create:function( ){ - this._super("_create"); - - this.element.bind('ddldialogbeforeopen', function(event){ - //console.log('ddldialogbeforeopen', event) - }) - }, - close:function(event){ - this._super('close'); - } - }); - - $.DDLayout.ddldialog.prototype.options.closeOnEscape = false; - -})(jQuery); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/js/views/abstract/dialog-view.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/js/views/abstract/dialog-view.js deleted file mode 100644 index 1207e2d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/js/views/abstract/dialog-view.js +++ /dev/null @@ -1,155 +0,0 @@ -var DDLayout = DDLayout || {}; - -DDLayout.DialogView = Backbone.View.extend({ - - initialize: function ( options ) { - var self = this, - settings = { - escape: /\{\{([^\}]+?)\}\}(?!\})/g, - evaluate: /<#([\s\S]+?)#>/g, - interpolate: /\{\{\{([\s\S]+?)\}\}\}/g - }, - template_settings = _.defaults({}, settings, _.templateSettings); - - _.defaults(options, { - title: "", - template_object: {}, - selector:'#ddl-default-edit', - buttons:[], - autoOpen: true, - show: true, - dialogClass: 'ddl-dialogs-container', - position: {my: "center top+40", at: "center top+40", of: window}, - modal: true, - width: 850, - height: "auto", - maxHeight: 1000, - maxWidth: 800, - minHeight: "auto", - minWidth: 600, - resizable: false, - draggable: false, - closeText:'', - }); - - _.bindAll(self, "render", 'open', 'create', 'close', 'beforeOpen', 'beforeClose', 'focus', 'refresh'); - - self.dialog_name = options && options.name ? options.name : 'default'; - - self.set_template_object( options.template_object ); - - self.set_title( options.title ); - self.template = _.template( jQuery( options.selector ).html(), template_settings ); - - self.listenTo(self.eventDispatcher, 'ddldialogopen'+'-'+self.dialog_name, self.open); - self.listenTo(self.eventDispatcher,'ddldialogcreate'+'-'+self.dialog_name, self.create); - self.listenTo(self.eventDispatcher,'ddldialogclose'+'-'+self.dialog_name, self.close); - self.listenTo(self.eventDispatcher,'ddldialogbeforeopen'+'-'+self.dialog_name, self.beforeOpen); - self.listenTo(self.eventDispatcher,'ddldialogbeforeclose'+'-'+self.dialog_name, self.beforeClose); - self.listenTo(self.eventDispatcher,'ddldialogfocus'+'-'+self.dialog_name, self.focus); - self.listenTo(self.eventDispatcher,'ddldialogrefresh'+'-'+self.dialog_name, self.refresh); - - self.render(options).el; - }, - render: function (options) { - var self = this; - - self.$el.html( self.template( self.get_template_object() ) ); - - self.init_dialog(options); - - return self; - }, - init_dialog:function(options){ - var self = this; - self.$el.ddldialog({ - title: self.get_title(), - autoOpen: options.autoOpen, - show: options.show, - dialogClass: options.dialogClass, - position: options.position, - modal: options.modal, - width: options.width, - height: options.height, - maxHeight: options.maxHeight, - maxWidth: options.maxWidth, - minHeight: options.minHeight, - minWidth: options.minWidth, - resizable: options.resizable, - draggable: options.draggable, - closeText:options.closeText, - buttons:options.buttons, - beforeOpen: function (event) { - self.eventDispatcher.trigger(event.type+'-'+self.dialog_name, event, this, self); - }, - beforeClose: function (event) { - self.eventDispatcher.trigger(event.type+'-'+self.dialog_name, event, this, self); - }, - close: function (event) { - self.eventDispatcher.trigger(event.type+'-'+self.dialog_name, event, this, self); - self.stopListening(self.eventDispatcher, 'ddldialogopen'+'-'+self.dialog_name, self.open); - self.stopListening(self.eventDispatcher,'ddldialogcreate'+'-'+self.dialog_name, self.create); - self.stopListening(self.eventDispatcher,'ddldialogclose'+'-'+self.dialog_name, self.close); - self.stopListening(self.eventDispatcher,'ddldialogbeforeopen'+'-'+self.dialog_name, self.beforeOpen); - self.stopListening(self.eventDispatcher,'ddldialogbeforeclose'+'-'+self.dialog_name, self.beforeClose); - self.stopListening(self.eventDispatcher,'ddldialogfocus'+'-'+self.dialog_name, self.focus); - self.stopListening(self.eventDispatcher,'ddldialogrefresh'+'-'+self.dialog_name, self.refresh); - }, - create: function (event) { - self.eventDispatcher.trigger(event.type+'-'+self.dialog_name, event, this, self); - }, - focus: function (event) { - self.eventDispatcher.trigger(event.type+'-'+self.dialog_name, event, this, self); - }, - refresh: function (event) { - self.eventDispatcher.trigger(event.type+'-'+self.dialog_name, event, this, self); - }, - open:function( event ){ - self.eventDispatcher.trigger(event.type+'-'+self.dialog_name, event, this, self); - } - }); - }, - open: function ( event, dom, view ) { - //console.log(event.type, arguments); - }, - beforeOpen: function ( event, dom, view ) { - //console.log(event.type, arguments); - }, - beforeClose: function (event, dom, view) { - //console.log(event.type, arguments); - }, - close: function ( event, dom, view ) { - //console.log(event.type, arguments); - }, - create: function ( event, dom, view ) { - //console.log(event.type, arguments); - - }, - focus: function ( event, dom, view ) { - // console.log(event.type, arguments); - - }, - refresh: function ( event, dom, view ) { - //console.log(event.type, arguments); - }, - get_template_object:function(){ - return this.template_object; - }, - set_template_object:function( object ){ - this.template_object = _.extend( {type:"", header:"", content:""}, object ); - }, - set_title:function( title ){ - this.title = title; - }, - get_title:function(){ - return this.title; - }, - dialog_close:function(){ - var self = this; - self.$el.ddldialog('close'); - }, - dialog_open:function(){ - var self = this; - self.$el.ddldialog('open'); - } -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/toolset.dialog-boxes.class.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/toolset.dialog-boxes.class.php deleted file mode 100644 index 12983e7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/dialogs/toolset.dialog-boxes.class.php +++ /dev/null @@ -1,123 +0,0 @@ -screens = apply_filters( 'toolset_dialog-boxes_screen_ids', $screens ); - add_filter( 'toolset_add_registered_styles', array( &$this, 'register_styles' ), 10, 1 ); - add_filter( 'toolset_add_registered_script', array( &$this, 'register_scripts' ), 10, 1 ); - } - - function init_screen_render() { - - if ( empty( $this->screens ) ) { - return; - } - - $screen = get_current_screen(); - - if ( ! in_array( $screen->id, $this->screens ) ) { - return; - } - - add_action( 'admin_print_scripts', array( &$this, 'enqueue_scripts'), 999 ); - add_action( 'admin_footer', array( &$this,'template')); - } - - function register_scripts( $scripts ) { - $scripts['ddl-abstract-dialog'] = new Toolset_Script( 'ddl-abstract-dialog', TOOLSET_COMMON_URL . '/utility/dialogs/js/views/abstract/ddl-abstract-dialog.js', array( 'jquery', 'wpdialogs', Toolset_Assets_Manager::SCRIPT_UTILS ), '0.1', false ); - $scripts[ self::SCRIPT_DIALOG_BOXES ] = new Toolset_Script( - self::SCRIPT_DIALOG_BOXES, - TOOLSET_COMMON_URL . '/utility/dialogs/js/views/abstract/dialog-view.js', - array('jquery', 'ddl-abstract-dialog', 'underscore', 'backbone'), - '0.1', - false - ); - - return $scripts; - } - - function register_styles( $styles ){ - return $styles; - } - - public function enqueue_scripts() { - do_action( 'toolset_enqueue_styles', - array( - 'ddl-dialogs-css', - 'ddl-dialogs-general-css', - 'ddl-dialogs-forms-css', - Toolset_Assets_Manager::STYLE_FONT_AWESOME, - ) - ); - - do_action( 'toolset_enqueue_scripts', apply_filters( 'ddl-dialog-boxes_enqueue_scripts', array( self::SCRIPT_DIALOG_BOXES ) ) ); - } - - public function template() { - ob_start();?> - - - - - 0); - }); - - - /** - * Indicate a beginning of an AJAX action. - * - * Make sure you also call finishAction() afterwards, no matter what the result is. - */ - self.beginAction = function() { - self.inProgressActionCount(self.inProgressActionCount() + 1); - }; - - - /** - * Indicate that an AJAX action was completed. - */ - self.finishAction = function() { - self.inProgressActionCount(self.inProgressActionCount() - 1); - }; - - - self.isSelectedForBulkAction = ko.observable(false); - - - /** - * This will be updated by the main ViewModel. - * - * @since 2.2 - */ - self.isBeingDisplayed = ko.observable(false); - - - /** - * When the item is not displayed in the listing table, we don't want it to be selected for a bulk action. - * - * @since 2.2 - */ - self.isBeingDisplayed.subscribe(function(newValue) { - if(false == newValue) { - self.isSelectedForBulkAction(false); - } - }); - - - /** - * Determine CSS class for the tr tag depending on field status. - * - * @since 2.0 - */ - self.trClass = ko.computed(function() { - // To be overridden - return ''; - }); - - - /** - * Simulates a link when displayNameLink exists - * - * @since 2.3 - */ - self.onDisplayNameClick = function() { - if (!_.isUndefined(model.editLink)) { - document.location = model.editLink; - } - } -}; diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/ListingPageController.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/ListingPageController.js deleted file mode 100644 index 4bb733a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/ListingPageController.js +++ /dev/null @@ -1,42 +0,0 @@ -var Toolset = Toolset || {}; - -Toolset.Gui = Toolset.Gui || {}; - -/** - * Generic listing page controller. - * - * See the AbstractPage controller for (much) more information. - * - * @constructor - * @since 2.2 - */ -Toolset.Gui.ListingPage = function() { - - var self = this; - - Toolset.Gui.AbstractPage.call(self); - - // Preserve the implementation in AbstractPage. - var parentInitMainViewModel = self.initMainViewModel; - - self.initMainViewModel = function() { - - parentInitMainViewModel(); - - // Focus the search field so that the user can start typing immediately. - self.getPageContent().find('.toolset-field-search').focus(); - - // Immediately apply the item per page setting without reloading the page. - jQuery('#toolset_fields_per_page').change(function() { - $this = jQuery(this); - var value = $this.val(); - if (value < 1) { - value = 1; - $this.val(value); - } - self.viewModel.itemsPerPage(value); - }); - - } - -}; diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/ListingViewModel.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/ListingViewModel.js deleted file mode 100644 index 2a95481..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/ListingViewModel.js +++ /dev/null @@ -1,535 +0,0 @@ -var Toolset = Toolset || {}; - -Toolset.Gui = Toolset.Gui || {}; - -/** - * Main (generic) ViewModel of the listing page. - * - * Holds the collection of item ViewModels, handles their sorting and filtering (search). - * - * @param {{[]}} itemModels - * @param {{sortBy:string,itemsPerPage:int}} defaults - * @param itemSearchFunction - * @constructor - * @since 2.2 - */ -Toolset.Gui.ListingViewModel = function(itemModels, defaults, itemSearchFunction) { - - var self = this; - - - self.isInitialized = false; - - - self.items = ko.observableArray(); - - - // ------------------------------------------------------------------------ - // Sorting functionality - // ------------------------------------------------------------------------ - - - self.onSort = function (propertyName) { - var newDirection = ( - sortHelper.currentSortBy() === propertyName - ? sortHelper.currentSortDirection() * -1 - : 1 // If it is not the current column it starts with ascending sorting. - ); - sortHelper.sortItems(propertyName, newDirection); - }; - - - /** - * Determine a current class for an column sorting indicator icon based on property name. - * - * @param {string} propertyName Name of property that the column uses for sorting. - * @returns {string} One or more CSS classes. - * @since 2.0 - */ - self.sortIconClass = function (propertyName, sortType) { - if ( 'undefined' === typeof sortType || ['alpha', 'numeric'].indexOf( sortType ) === -1 ) { - sortType = 'alpha'; - } - if (sortHelper.currentSortBy() === propertyName) { - if (1 === sortHelper.currentSortDirection()) { - return 'fa fa-sort-' + sortType + '-asc'; - } else { - return 'fa fa-sort-' + sortType + '-desc'; - } - } else { - return 'fa sort-icon-inactive fa-sort-' + sortType + '-asc'; - } - }; - - - /** - * Helper object that encapsulates the functionality related to sorting. - * - * @since 2.0 - */ - var sortHelper = new function () { - - var helper = this; - - /** - * Compare two models by current sort settings of the collection. - * - * Handle empty values as ones with the highest value (they will be at the end on ascending order). - * - * @param itemA - * @param itemB - * @returns {number} -1|0|1 - * @since 2.0 - */ - var comparator = function (itemA, itemB) { - - var a = itemA[helper.currentSortBy()]() || '', b = itemB[helper.currentSortBy()]() || ''; - var result = 0; - - a = a.toLowerCase(); - b = b.toLowerCase(); - - if (0 === a.length && 0 === b.length) { - result = 0; - } else if (0 === a.length) { - result = 1; - } else if (0 === b.length) { - result = -1; - } else { - result = (a === b ? 0 : (a > b ? 1 : -1)); - } - - return (result * helper.currentSortDirection()); - }; - - - /** Sort direction, 1 for ascending and -1 for descending. */ - helper.currentSortDirection = ko.observable(1); - - /** Property name. */ - helper.currentSortBy = ko.observable(defaults.sortBy); - - - helper.changeSortStrategy = function (propertyName, direction) { - - if ('asc' === direction) { - direction = 1; - } else if ('desc' === direction) { - direction = -1; - } else if (typeof(direction) === 'undefined') { - direction = helper.currentSortDirection(); - } - - helper.currentSortDirection(direction); - helper.currentSortBy(propertyName); - - }; - - - /** - * Completely handle item sorting. - * - * Performs the sorting only when initialization is actually finished to avoid resource wasting. - * - * @param {string} propertyName Name of the item property to sort by. The property must be an - * function that returns a string when called without a parameter (for example, a ko.observable). - * @param {int|string} direction 1|-1|'asc'|'desc' - * @since 2.0 - */ - helper.sortItems = function (propertyName, direction) { - helper.changeSortStrategy(propertyName, direction); - - if (self.isInitialized) { - self.items.sort(comparator); - } - }; - - }; - - /** - * Update sorted items - * - * It is necessary when a item propety is updated and - * the list is ordered by it - * - * @since 2.3 - */ - self.updateSort = function () { - sortHelper.sortItems(sortHelper.currentSortBy(), sortHelper.currentSortDirection()); - }; - - /** - * Returns current sort by property - * - * If a item is updated, sorting will be necessary if the property updated - * is the same that the 'sort by' property - * - * @since 2.3 - */ - self.getCurrentSortBy = sortHelper.currentSortBy; - - - // ------------------------------------------------------------------------ - // Searching and pagination functionality - // ------------------------------------------------------------------------ - - - self.searchString = ko.observable(''); - - - self.currentPage = ko.observable(1); - - - self.itemsPerPage = ko.observable(defaults.itemsPerPage); - - - self.totalPages = ko.pureComputed(function () { - var pageCount = Math.max(Math.ceil(self.itemCount() / self.itemsPerPage()), 1); - return ( jQuery.isNumeric(pageCount) ? pageCount : 1); - }); - - - /** - * Total count of items that can be displayed now (after filtering). - */ - self.itemCount = ko.pureComputed(function () { - return self.itemsFilteredBySearch().length; - }); - - - self.isFirstPage = ko.pureComputed(function () { - return ( 1 === self.currentPage() ); - }); - - self.isLastPage = ko.pureComputed(function () { - return (self.totalPages() === self.currentPage()); - }); - - - self.itemsFilteredBySearch = ko.pureComputed(function () { - var searchString = self.searchString(); - if (_.isEmpty(searchString)) { - - _.each(self.items(), function (item) { - item.isBeingDisplayed(true); - }); - - return self.items(); - - } else { - return _.filter(self.items(), function (item) { - - var isMatch = itemSearchFunction(item, searchString); - - item.isBeingDisplayed(isMatch); - return isMatch; - }); - } - }); - - - /** - * Safely get/set new current page number. - * - * @since 2.0 - */ - self.currentPageSafe = ko.computed({ - read: function () { - return self.currentPage(); - }, - write: function (page) { - page = parseInt(page); - if (page < 1) { - self.currentPage(1); - } else if (page > self.totalPages()) { - self.currentPage(self.totalPages()); - } else { - self.currentPage(page); - } - } - }); - - - /** - * Safely change current page. - * - * @param {string} page first|previous|next|last - * @since 2.0 - */ - self.gotoPage = function (page) { - switch (page) { - case 'first': - self.currentPageSafe(1); - break; - case 'previous': - self.currentPageSafe(self.currentPage() - 1); - break; - case 'next': - self.currentPageSafe(self.currentPage() + 1); - break; - case 'last': - self.currentPageSafe(self.totalPages()); - break; - } - }; - - - /** - * The array of actually visible items, after searching and pagination. - * - * @since 2.0 - */ - self.itemsToShow = ko.pureComputed(function () { - return _.first(_.rest(self.itemsFilteredBySearch(), self.itemsPerPage() * (self.currentPage() - 1)), self.itemsPerPage()) || []; - }); - - - /** - * When a search term changes, always show the first page, otherwise no results might be visible. - * - * @since m2m - */ - self.searchString.subscribe(function(searchString) { - if(searchString.length > 0) { - self.gotoPage('first'); - } - }); - - - // ------------------------------------------------------------------------ - // Item actions - // ------------------------------------------------------------------------ - - - /** - * Currently displayed message. - * - * Text can contain HTML code. Type can be 'info' or 'error' for different message styles. - */ - self.displayedMessage = ko.observable({text: '', type: 'info'}); - - - /** - * Determine how the message is being displayed at the moment. - * - * Allowed values are those of the threeModeVisibility knockout binding. - * - * @since 2.0 - */ - self.messageVisibilityMode = ko.observable('remove'); - - - /** - * Display a message. - * - * Overwrites previous message if there was one displayed. - * - * @param {string} text Message content. - * @param {string} type 'info'|'error' - */ - self.displayMessage = function (text, type) { - self.hideDisplayedMessage(); - self.displayedMessage({text: text, type: type}); - self.messageVisibilityMode('show'); - if ( type !== 'error' ) { - self.autoHideDislayedMessage( text ); - } - }; - - - /** - * Hide the message if it is displayed, but leave free space instead of it. - * - * If the message was completely hidden before, do nothing. - */ - self.hideDisplayedMessage = function () { - if ('show' === self.messageVisibilityMode()) { - self.messageVisibilityMode('hide'); - } - // Adjust message height to one line. - self.displayedMessage({text: 'A', type: 'info'}); - }; - - - /** - * Hide the message completely. - */ - self.removeDisplayedMessage = function () { - self.messageVisibilityMode('remove'); - }; - - - /** - * Auto hide dislayed message after a time depending on text long - * - * @param {string} text Text needed for timing calculation - * @since m2m - */ - self.autoHideDislayedMessage = function( text ) { - var miliseconds = Math.max( Math.min( text.length * 50, 2000 ), 7000 ); - setTimeout( self.removeDisplayedMessage, miliseconds ); - } - - - /** - * Determine CSS class for the message, based on it's type. - */ - self.messageNagClass = ko.pureComputed(function () { - switch (self.displayedMessage().type) { - case 'error': - return 'error'; - case 'info': - default: - return 'updated'; - } - }); - - - /** - * Number of AJAX actions currently in progress. - * - * Do not touch it directly, use beginAction() and finishAction() instead. - */ - self.inProgressActionCount = ko.observable(0); - - - /** - * Show a spinner if there is at least one AJAX action in progress. - */ - self.isSpinnerVisible = ko.pureComputed(function () { - return (self.inProgressActionCount() > 0); - }); - - - /** - * Indicate a beginning of an AJAX action. - * - * Make sure you also call finishAction() afterwards, no matter what the result is. - */ - self.beginAction = function (items) { - self.inProgressActionCount(self.inProgressActionCount() + 1); - _.each(items, function (item) { - item.beginAction(); - }); - }; - - - /** - * Indicate that an AJAX action was completed. - */ - self.finishAction = function (items) { - self.inProgressActionCount(self.inProgressActionCount() - 1); - _.each(items, function (item) { - item.finishAction(); - }); - }; - - - /** - * An object with methods to perform actions on items. - * - * Each action should an array of items, or a single item, as first parameter. - * - * @since 2.0 - */ - self.itemActions = {}; - - - // ------------------------------------------------------------------------ - // Bulk actions - // ------------------------------------------------------------------------ - - - //noinspection JSUnresolvedVariable - /** - * Array of objects describing available bulk actions. - * - * It will be used by knockout to populate the select input items dynamically. - * - * @returns {[{value:string,displayName:string,handler:function|undefined}]} - * @since 2.0 - */ - self.bulkActions = ko.observableArray([]); - - - self.selectedItems = ko.pureComputed(function () { - return _.filter(self.itemsToShow(), function (item) { - return item.isSelectedForBulkAction(); - }); - }); - - - self.selectedBulkAction = ko.observable('-1'); - - - self.isBulkActionAllowed = ko.pureComputed(function () { - return ('-1' !== self.selectedBulkAction() && self.selectedItems().length > 0); - }); - - - /** - * Find the selected bulk action by it's value and execute it's handler if possible. - * - * @since 2.0 - */ - self.onBulkAction = function () { - var action = _.findWhere(self.bulkActions(), {value: self.selectedBulkAction()}); - if (typeof(action) !== 'undefined' && _.has(action, 'handler') && _.isFunction(action.handler)) { - action.handler(self.selectedItems()); - } - }; - - - /** - * True if all visible rows are selected for a bulk action, false otherwise. - * When written to, the value will influence all visible rows. - * - * @since 2.0 - */ - self.allVisibleItemsSelection = ko.computed({ - read: function () { - if (0 === self.itemsToShow().length) { - return false; - } - return _.every(self.itemsToShow(), function (item) { - return item.isSelectedForBulkAction(); - }); - }, - write: function (value) { - _.each(self.itemsToShow(), function (item) { - item.isSelectedForBulkAction(value); - }) - } - }); - - - // ------------------------------------------------------------------------ - // Initialization - // ------------------------------------------------------------------------ - - - self.createItemViewModels = function (itemModels) { - // to be overridden - }; - - - self.init = function () { - - self.createItemViewModels(itemModels); - - ko.applyBindings(self); - - self.currentPage(1); - - // Now we can finally sort - self.isInitialized = true; - sortHelper.sortItems(sortHelper.currentSortBy(), sortHelper.currentSortDirection()); - }; - - /** - * Some functions are needed in 'child' ListViewModels - * for example sorting - * @since 2.3 - */ - return self; -}; diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/jquery/collapsible.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/jquery/collapsible.js deleted file mode 100644 index ba8738a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/jquery/collapsible.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Creates a collapsible mechanic by adding data-toolset-collapsible="parent-container" to the trigger. - * On click the toggleClass( 'toolset-collapsible-closed' ) is used on the "parent-container". - * - * Limitation: The trigger must be inside the parent. - * - * Example of use: - *

            - *

            Click this to collapse

            - *
            Another trigger if you want
            - *
            - * Content, which should be collapsed. - *
            - *
            - * - */ -function tooset_collapsible( $ ) { - $( 'body' ).on( 'click', '[data-toolset-collapsible]', function() { - var collapsibleContainer = $( this ).parents( $( this ).data( 'toolset-collapsible' ) ).first(); - - if( collapsibleContainer.length ) { - collapsibleContainer.toggleClass( 'toolset-collapsible-closed' ) - } else { - console.log( 'Collapsible container could not be found.' ); - } - } ); -} - -// make sure it's working like loaded at the end of document, even if it's wrongly loaded to the header -jQuery( document ).ready( function() { - tooset_collapsible( jQuery ); -} ); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/mixins/CreateDialog.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/mixins/CreateDialog.js deleted file mode 100644 index 61a2518..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/mixins/CreateDialog.js +++ /dev/null @@ -1,51 +0,0 @@ -var Toolset = Toolset || {}; -Toolset.Gui = Toolset.Gui || {}; -Toolset.Gui.Mixins = Toolset.Gui.Mixins || {}; - -/** - * Add a method for an easy and repeatable invocation of a Toolset dialog. - * - * Usage: - * - Initialize appropriate Toolset_Template_Dialog_Box instance when rendering the page in PHP. - * - Add this script as a dependency (handle is Toolset_Gui_Base::SCRIPT_GUI_MIXIN_CREATE_DIALOG) - * - Toolset.Gui.Mixins.KnockoutExtensions.call(self); - * - self.createDialog(); - * - * @constructor - * @since 2.5.11 - */ -Toolset.Gui.Mixins.CreateDialog = function() { - - var self = this; - - /** - * Create a Toolset dialog. - * - * For details, see https://git.onthegosystems.com/toolset/toolset-common/wikis/best-practices/dialogs. - * - * @param {string} dialogId Id of the HTML element holding the dialog template. - * @param {string} title Dialog title to be displayed - * @param {*} templateContext Context for the dialog (underscore) template. - * @param buttons Button definitions according to jQuery UI Dialogs. - * @param [options] Further options that will be passed directly. - * @returns {{DDLayout.DialogView}} A dialog object. - * @since 2.1 - */ - self.createDialog = function(dialogId, title, templateContext, buttons, options) { - - var dialogDuplicate = DDLayout.DialogView.extend({}); - - var processedOptions = _.defaults(options || {}, { - title: title, - selector: '#' + dialogId, - template_object: templateContext, - buttons: buttons, - width: 600 - }); - - var dialog = new dialogDuplicate(processedOptions); - - return dialog; - }; - -}; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/mixins/KnockoutExtensions.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/mixins/KnockoutExtensions.js deleted file mode 100644 index 645b9ef..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/js/mixins/KnockoutExtensions.js +++ /dev/null @@ -1,206 +0,0 @@ -var Toolset = Toolset || {}; -Toolset.Gui = Toolset.Gui || {}; -Toolset.Gui.Mixins = Toolset.Gui.Mixins || {}; - -/** - * Extend the knockout library with various binding handlers. - * - * Usage: - * - Add this script as a dependency (handle is Toolset_Gui_Base::SCRIPT_GUI_MIXIN_KNOCKOUT_EXTENSIONS) - * - Toolset.Gui.Mixins.KnockoutExtensions.call(self); - * - self.initKnockout(); - * - * @constructor - * @since 2.5.11 - */ -Toolset.Gui.Mixins.KnockoutExtensions = function() { - - var self = this; - - /** - * Initialize custom Knockout bindings and other modifications. - * - * @since 2.2 - */ - self.initKnockout = function () { - - var $ = jQuery; - - // Taken from http://knockoutjs.com/examples/animatedTransitions.html - // Here's a custom Knockout binding that makes elements shown/hidden via jQuery's fadeIn()/fadeOut() methods - ko.bindingHandlers.fadeVisible = { - init: function (element, valueAccessor) { - // Initially set the element to be instantly visible/hidden depending on the value - var value = valueAccessor(); - $(element).toggle(ko.unwrap(value)); // Use "unwrapObservable" so we can handle values that may or may not be observable - }, - update: function (element, valueAccessor) { - // Whenever the value subsequently changes, slowly fade the element in or out - var value = valueAccessor(); - ko.unwrap(value) ? $(element).fadeIn() : $(element).fadeOut(); - } - }; - - - var applyDisplayMode = function (displayMode, element, immediately) { - switch (displayMode) { - case 'show': - element.css('visibility', 'visible'); - if (immediately) { - element.show(); - } else { - element.slideDown().css('display', 'none').fadeIn(); - } - break; - case 'hide': - element.css('visibility', 'hidden'); - if (immediately) { - element.show(); - } else { - element.slideDown(); - } - break; - case 'remove': - if (immediately) { - element.hide(); - } else { - element.slideUp().fadeOut(); - } - element.css('visibility', 'hidden'); - break; - } - }; - - - /** - * Binding for displaying an element in three modes: - * - * - 'show' will simply display the element - * - 'hide' will hide it, but leave the free space for another message to be displayed soon - * - 'remove' will hide it completely - * - * Show/remove values use animations. - * - * @since 2.2 - */ - ko.bindingHandlers.threeModeVisibility = { - init: function (element, valueAccessor) { - var displayMode = ko.unwrap(valueAccessor()); - applyDisplayMode(displayMode, $(element), true); - }, - update: function (element, valueAccessor) { - var displayMode = ko.unwrap(valueAccessor()); - applyDisplayMode(displayMode, $(element), false); - } - }; - - - var disablePrimary = function (element, valueAccessor) { - var isDisabled = ko.unwrap(valueAccessor()); - if (isDisabled) { - $(element).prop('disabled', true).removeClass('button-primary'); - } else { - $(element).prop('disabled', false).addClass('button-primary'); - } - }; - - /** - * Disable primary button and update its class. - * - * @since 2.2 - */ - ko.bindingHandlers.disablePrimary = { - init: disablePrimary, - update: disablePrimary - }; - - - var redButton = function (element, valueAccessor) { - var isRed = ko.unwrap(valueAccessor()); - if (isRed) { - jQuery(element).addClass('toolset-red-button'); - } else { - jQuery(element).removeClass('toolset-red-button'); - } - }; - - - /** - * Add or remove a class that makes a button red. - * - * @since 2.0 - */ - ko.bindingHandlers.redButton = { - init: redButton, - update: redButton - }; - - - // Update textarea's value and scroll it to the bottom. - var valueScroll = function (element, valueAccessor) { - var value = ko.unwrap(valueAccessor()); - var textarea = $(element); - - textarea.val(value); - textarea.scrollTop(textarea[0].scrollHeight); - }; - - ko.bindingHandlers.valueScroll = { - init: valueScroll, - update: valueScroll - }; - - - /** - * Set the readonly attribute value. - * - * @type {{update: ko.bindingHandlers.readOnly.update}} - * @since m2m - */ - ko.bindingHandlers.readOnly = { - update: function (element, valueAccessor) { - var value = ko.utils.unwrapObservable(valueAccessor()); - if (value) { - element.setAttribute("readonly", true); - } else { - element.removeAttribute("readonly"); - } - } - }; - - - /** - * New computed type that allows to force the reading on the observable - * - * Check this {@link https://stackoverflow.com/questions/13769481/force-a-computed-property-function-to-run/29960082#29960082|Stackoveflow} example - * @since m2m - */ - ko.notifyingWritableComputed = function (options, context) { - var _notifyTrigger = ko.observable(0); - var originalRead = options.read; - var originalWrite = options.write; - - // intercept 'read' function provided in options - options.read = function () { - // read the dummy observable, which if updated will - // force subscribers to receive the new value - _notifyTrigger(); - return originalRead(); - }; - - // intercept 'write' function - options.write = function (v) { - // run logic provided by user - originalWrite(v); - - // force reevaluation of the notifyingWritableComputed - // after we have called the original write logic - _notifyTrigger(_notifyTrigger() + 1); - }; - - // just create computed as normal with all the standard parameters - return ko.computed(options, context); - } - }; - -}; \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/main.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/main.php deleted file mode 100644 index 9dd30d1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/main.php +++ /dev/null @@ -1,414 +0,0 @@ -init(); - } - - - private function __construct() { } - - private function __clone() { } - - - /** - * Initialize the GUI base. - * - * Triggers the Twig initialization. - * - * @since m2m - */ - public function init() { - if( $this->is_initialized ) { - return; - } - - $this->initialize_autoloader(); - $this->initialize_twig(); - $this->register_assets(); - - $this->is_initialized = true; - } - - - /** - * Get the absolute path to the GUI base directory. - * - * @param string $relpath A relative path to be appended. Must begin with a forward slash. - * @return string - * @since 2.2 - */ - private function get_gui_base_path( $relpath = '' ) { - return TOOLSET_COMMON_PATH . '/utility/gui-base' . $relpath; - } - - - /** - * Get the URL to the GUI base directory. - * - * @param string $relurl A relative path to be appended. Must begin with a forward slash. - * @return string - * @since 2.2 - */ - private function get_gui_base_url( $relurl = '' ) { - return TOOLSET_COMMON_URL . '/utility/gui-base' . $relurl; - } - - - /** - * Load Twig by registering its autoloader. - * - * This is a bit hacky way to do it, see the Toolset_Twig_Autoloader class for explanation. - * - * After calling this, Twig is guaranteed to be available from init:10 on. - * - * @since 2.2 - */ - private function initialize_twig() { - - // Backwards compatibility for PHP 5.2 - if ( ! defined( 'E_DEPRECATED' ) ) { - define( 'E_DEPRECATED', 8192 ); - } - - if ( ! defined( 'E_USER_DEPRECATED' ) ) { - define( 'E_USER_DEPRECATED', 16384 ); - } - - $was_init_fired = ( 0 != did_action( 'init' ) ); - - if( $was_init_fired ) { - // Hurry. - Toolset_Twig_Autoloader::register(); - } else { - // Wait until init because of the reasons described in the autoloader. - // - // Priority is set to 9 to make sure Twig is ready before standard initialization - it should not - // harm anything. - add_action( 'init', array( 'Toolset_Twig_Autoloader', 'register' ), 9 ); - } - } - - - private function initialize_autoloader() { - - $autoloader = Toolset_Common_Autoloader::get_instance(); - - $base_path = $this->get_gui_base_path(); - $gui_base_classmap = array( - 'Toolset_Twig_Dialog_Box_Factory' => "$base_path/twig_dialog_box_factory.php", - 'Toolset_Twig_Dialog_Box' => "$base_path/twig_dialog_box.php", - 'Toolset_Twig_Autoloader' => "$base_path/twig_autoloader.php", - 'Toolset_Twig_Extensions' => "$base_path/twig_extensions.php", - 'Toolset_Template_Dialog_Box' => "$base_path/template_dialog_box.php" - ); - - $autoloader->register_classmap( $gui_base_classmap ); - } - - - - /** - * Create a new Twig environment. - * - * Doesn't use caching. - * - * @param string[] $paths Associative array where keys are namespaces and elements are full paths to Twig templates. - * @param bool $add_toolset_namespace Define whether the namespace with generic Toolset templates should be - * automatically added. - * @param bool $add_toolset_extensions Define whether the Twig environment should get standard Toolset extensions. - * - * @return Twig_Environment - * @throws Twig_Error_Loader - * @since 2.2 - */ - public function create_twig_environment( $paths, $add_toolset_namespace = true, $add_toolset_extensions = true ) { - - $loader = new Twig_Loader_Filesystem(); - - foreach( $paths as $namespace => $path ) { - $loader->addPath( $path, $namespace ); - } - - if( $add_toolset_namespace ) { - $loader->addPath( $this->get_gui_base_path( '/twig-templates' ), 'toolset' ); - } - - $twig = new Twig_Environment( $loader ); - - if( $add_toolset_extensions ) { - $twig = $this->add_toolset_extensions_to_twig( $twig ); - } - - return $twig; - } - - - - /** Identifier of the generic page template. */ - const TEMPLATE_BASE = 'base'; - - - /** Identifier of the listing page template. */ - const TEMPLATE_LISTING = 'listing'; - - - /** - * Create a standardized base for a Twig context. - * - * @param string $template Valid template identifier. - * @param array $js_model_data A (possibly nested) associative array of strings that will be passed as - * a JSON modelData to the JS page controller. - * - * @return array An (incomplete) Twig context for given template. - * - * @since 2.2 - */ - public function get_twig_context_base( $template, $js_model_data ) { - - switch( $template ) { - case self::TEMPLATE_BASE: - return array( - 'js_model_data' => $this->encode_js_model_data( $js_model_data ), - 'assets' => array( - 'loaderOverlay' => TOOLSET_COMMON_URL . '/res/images/ajax-loader-overlay.gif' - ), - ); - - case self::TEMPLATE_LISTING: - - $base_context = $this->get_twig_context_base( self::TEMPLATE_BASE, $js_model_data ); - - $listing_context = array( - 'strings' => array( - 'misc' => array( - 'searchPlaceholder' => __( 'Search', 'wpcf' ), - 'noItemsFound' => __( 'No items found.', 'wpcf' ), - 'applyBulkAction' => __( 'Apply', 'wpcf' ), - 'items' => __( 'items', 'wpcf' ), - 'of' => __( 'of', 'wpcf' ), - ) - ), - 'bulkAction' => array( - 'select' => __( 'Bulk action', 'wpcf' ) - ) - ); - - return toolset_array_merge_recursive_distinct( - $base_context, - $listing_context - ); - - default: - return array(); - } - - } - - - /** - * Encode JS model data in a standard way so it can be passed to JS safely. - * - * @param array $js_model_data - * @return string base64-encoded string. - * @since 2.2 - */ - private function encode_js_model_data( $js_model_data ) { - return base64_encode( wp_json_encode( $js_model_data ) ); - } - - - /** - * Add standard Toolset extensions to a Twig environment. - * - * @param Twig_Environment $twig - * @return Twig_Environment - * @since 2.2 - */ - private function add_toolset_extensions_to_twig( $twig ) { - - $twig_extensions = Toolset_Twig_Extensions::get_instance(); - - $twig = $twig_extensions->extend_twig( $twig ); - - return $twig; - } - - - // Names of registered assets. - const SCRIPT_GUI_ABSTRACT_PAGE_CONTROLLER = 'toolset-gui-abstract-page-controller'; - const SCRIPT_GUI_LISTING_PAGE_CONTROLLER = 'toolset-gui-listing-page-controller'; - const SCRIPT_GUI_LISTING_VIEWMODEL = 'toolset-gui-listing-viewmodel'; - const SCRIPT_GUI_ITEM_VIEWMODEL = 'toolset-gui-item-viewmodel'; - const SCRIPT_GUI_JQUERY_COLLAPSIBLE = 'toolset-gui-jquery-collapsible'; - const SCRIPT_GUI_MIXIN_CREATE_DIALOG = 'toolset-gui-mixin-create-dialog'; - const SCRIPT_GUI_MIXIN_KNOCKOUT_EXTENSIONS = 'toolset-gui-mixin-knockout-extensions'; - - const STYLE_GUI_BASE = 'toolset-gui-base'; - - - /** - * Register Toolset GUI base assets via the Toolset_Assets_Manager. - * - * @since 2.2 - */ - private function register_assets() { - - /** @var Toolset_Assets_Manager $asset_manager */ - $asset_manager = Toolset_Assets_Manager::get_instance(); - - $asset_manager->register_script( - self::SCRIPT_GUI_MIXIN_CREATE_DIALOG, - $this->get_gui_base_url( '/js/mixins/CreateDialog.js' ), - array( - // This one will be registered and enqueued only if - // Toolset_DialogBoxes or Toolset_Twig_Dialog_Box is actually used: - //Toolset_DialogBoxes::SCRIPT_DIALOG_BOXES, - 'underscore', - 'backbone' - ), - TOOLSET_VERSION - ); - - $asset_manager->register_script( - self::SCRIPT_GUI_MIXIN_KNOCKOUT_EXTENSIONS, - self::get_gui_base_url( '/js/mixins/KnockoutExtensions.js' ), - array( - 'knockout', 'jquery' - ), - TOOLSET_VERSION - ); - - $asset_manager->register_script( - self::SCRIPT_GUI_ABSTRACT_PAGE_CONTROLLER, - $this->get_gui_base_url( '/js/AbstractPageController.js' ), - array( - 'jquery', 'backbone', 'underscore', - Toolset_Assets_Manager::SCRIPT_UTILS, - Toolset_Assets_Manager::SCRIPT_KNOCKOUT, - self::SCRIPT_GUI_MIXIN_CREATE_DIALOG, - self::SCRIPT_GUI_MIXIN_KNOCKOUT_EXTENSIONS, - ), - TOOLSET_VERSION - ); - - - $asset_manager->register_script( - self::SCRIPT_GUI_LISTING_PAGE_CONTROLLER, - $this->get_gui_base_url( '/js/ListingPageController.js' ), - array( - self::SCRIPT_GUI_ABSTRACT_PAGE_CONTROLLER, - self::SCRIPT_GUI_LISTING_VIEWMODEL - ), - TOOLSET_VERSION - ); - - - $asset_manager->register_script( - self::SCRIPT_GUI_LISTING_VIEWMODEL, - $this->get_gui_base_url( '/js/ListingViewModel.js' ), - array( - 'jquery', 'backbone', 'underscore', - Toolset_Assets_Manager::SCRIPT_UTILS, - Toolset_Assets_Manager::SCRIPT_KNOCKOUT, - self::SCRIPT_GUI_ITEM_VIEWMODEL - ), - TOOLSET_VERSION - ); - - - $asset_manager->register_script( - self::SCRIPT_GUI_ITEM_VIEWMODEL, - $this->get_gui_base_url( '/js/ItemViewModel.js' ), - array( - 'jquery', 'backbone', 'underscore', - Toolset_Assets_Manager::SCRIPT_KNOCKOUT, - Toolset_Assets_Manager::SCRIPT_UTILS, - ), - TOOLSET_VERSION - ); - - $asset_manager->register_script( - self::SCRIPT_GUI_JQUERY_COLLAPSIBLE, - $this->get_gui_base_url( '/js/jquery/collapsible.js' ), - array( - 'jquery' - ), - TOOLSET_VERSION - ); - - $asset_manager->register_style( - self::STYLE_GUI_BASE, - $this->get_gui_base_url( '/toolset-gui-base.css' ), - array(), - TOOLSET_VERSION - ); - - - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/template_dialog_box.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/template_dialog_box.php deleted file mode 100644 index 5e2bb4f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/template_dialog_box.php +++ /dev/null @@ -1,103 +0,0 @@ -id ) ); - - $this->dialog_id = $dialog_id; - $this->template = $template; - $this->renderer = $renderer_di ?: Toolset_Renderer::get_instance(); - $this->context = toolset_ensarr( $context ); - } - - - /** - * Initialize the dialog box. This needs to be called before admin_enqueue_scripts. - */ - public function initialize() { - $this->late_register_assets(); - $this->init_screen_render(); - } - - - /** - * Manually register dialog assets in Toolset_Assets_Manager because by now we have already missed the - * toolset_add_registered_styles and toolset_add_registered_scripts filters (but there is still enough time - * to enqueue). - */ - protected function late_register_assets() { - $asset_manager = Toolset_Assets_Manager::get_instance(); - - $scripts = $this->register_scripts( array() ); - foreach( $scripts as $script ) { - $asset_manager->add_script( $script ); - } - } - - - /** - * Render a predefined Twig template. - * - * @since 2.0 - * @throws Twig_Error_Loader In case of incorrect Twig configuration. - * @throws Twig_Error_Runtime In case of incorrect Twig configuration. - * @throws Twig_Error_Syntax In case of incorrect Twig configuration. - */ - public function template() { - printf( - '', - esc_attr( $this->dialog_id ), - $this->renderer->render( $this->template, $this->context, false ) - ); - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/toolset-gui-base.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/toolset-gui-base.css deleted file mode 100644 index 379e0ab..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/toolset-gui-base.css +++ /dev/null @@ -1,271 +0,0 @@ -/* - Toolset GUI base styles. - - Used for the generic and listing pages. - - @since 2.2 -*/ - -#toolset-page-content .sort-icon-inactive { - color: #ccc !important; -} - -#toolset-page-content table.wp-list-table td.manage-column > a.sort-column { - cursor: pointer; -} - -#toolset-page-content a.a-without-href { - cursor: pointer; - text-decoration: underline; -} - -/* - Table row styling -*/ -#toolset-page-content .row-actions > span > a { - cursor: pointer; -} - -/* should be moved to toolset-global.css */ -.clearfix:before, -.clearfix:after { - display: table; - content: " "; -} -.clearfix:after { - clear: both; -} - -body[class*="toolset_page"] a, -.toolset-listing-wrapper a { - cursor: pointer; -} - -/* Red buttons. To be combined with button-primary. */ -.wp-core-ui .toolset-danger-button { - background: #aa0000; - border-color: #900000 #650000 #650000; - -webkit-box-shadow: 0 1px 0 #650000; - box-shadow: 0 1px 0 #650000; - color: #fff; - text-decoration: none; - text-shadow: 0 -1px 1px #900000, 1px 0 1px #900000, 0 1px 1px #900000, -1px 0 1px #900000; -} -.wp-core-ui .toolset-danger-button:hover, -.wp-core-ui .toolset-danger-button:focus { - background: #c30101; - border-color: #650000; - color: #fff; -} - - -.wp-core-ui .button-primary-toolset { - background: #F05A28;; - border-color: #d84326; - -webkit-box-shadow: 0 1px 0 #d84326; - box-shadow: 0 1px 0 #d84326; - color: #fff; - text-decoration: none; - text-shadow: 0 -1px 1px #d84326, 1px 0 1px #d84326, 0 1px 1px #d84326, -1px 0 1px #d84326; -} - -.wp-core-ui .button-primary-toolset:hover, -.wp-core-ui .button-primary-toolset:focus, -.wp-core-ui .button-primary-toolset:active { - background: #d6410f; - border-color: #ab340c; - -webkit-box-shadow: 0 1px 0 #ab340c; - box-shadow: 0 1px 0 #ab340c; - color: #fff; -} - -.wp-core-ui .button-primary-toolset:active { - -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, .5), 0 1px 0 #ab340c; - box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, .5), 0 1px 0 #ab340c; -} - -.wp-core-ui .button-primary-toolset[disabled], -.wp-core-ui .button-primary-toolset:disabled, -.wp-core-ui .button-primary-toolset.disabled { - opacity: .65; -} - - - -/*/should be moved to toolset-global.css*/ - - -#toolset-page-content .toolset-page-spinner { - height: 400px; - position: relative; -} - -#toolset-page-content .toolset-page-spinner > img { - overflow: auto; - margin: auto; - position: absolute; - top: 0; left: 0; bottom: 0; right: 0; -} - - -/* Handle too long dialog titles. */ -.ui-dialog-title { - text-overflow: ellipsis; - white-space: nowrap; - display: block; - overflow: hidden; -} - -/* Red buttons. To be combined with button-primary. */ -.toolset-red-button { - background-color: #FF4444 !important; - border-color: #DE2020 !important; - box-shadow: #DE2020 0 1px 0 0 !important; - - text-shadow: 0 -1px 1px red, 1px 0 1px red, 0 1px 1px red, -1px 0 1px red !important; -} - -/* Button in a row */ -.toolset-button-in-row + .toolset-button-in-row { - margin-left: 8px; -} - - -/* Override styling from basic.css in Types back to default. */ -body.wp-admin button.ui-corner-all.toolset-button-in-dialog { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -/* - For table that contains labels and inputs in two columns. - - Adjustments to make it look like legacy Types tables. -*/ -table.toolset-field-table tbody td:first-child { - text-align: right; - vertical-align: middle; - min-width: 200px; - width: 20%; -} - -/* - Input - */ -.toolset-input-inline { - margin-bottom: 5px; -} - -.toolset-input-inline:after { - content: ''; - display: block; - clear: both; -} - -.toolset-input-inline label { - box-sizing: border-box; - width: 25%; /* fallback old browsers */ - width: calc(0% + 150px); - float: left; - padding-right: 10px; -} - -.toolset-input-inline > div { - box-sizing: border-box; - width: 75%; /* fallback old browsers */ - width: calc(100% - 150px); - float: right; -} - -.toolset-input-inline > div > input[type=text], -.toolset-input-inline > div > textarea { - margin: 1px; - width: 100%; -} - -/* - Toolset Postbox, basically same style as WordPress postbox - (For the case you need the same style, but different functionality, e.g. Field Groups) - */ -.toolset-postbox { - position: relative; - min-width: 255px; - border: 1px solid #e5e5e5; - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - background: #fff; - margin-bottom: 20px; - padding: 0; - line-height: 1; - width: 99%; /* fallback old browsers */ - width: calc( 100% - 5px ); -} - -.toolset-postbox h3.toolset-postbox-title { - font-size: 14px; - padding: 8px 12px; - margin: 0; - line-height: 1.4; - border-bottom: 1px solid #eee; -} - -.toolset-postbox .toolset-collapsible-handle { - display: block; - float: right; - width: 36px; - height: 36px; - margin: 0; - padding: 0; - border: 0; - background: none; - cursor: pointer; -} - -.toolset-postbox .toolset-collapsible-handle:before { - right: 12px; - font: 400 20px/1 dashicons; - speak: none; - display: inline-block; - padding: 8px 10px; - top: 0; - position: relative; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - text-decoration: none !important; - content: '\f142' -} - -.toolset-postbox.toolset-collapsible-closed .toolset-collapsible-handle:before { - content: '\f140'; -} - -.toolset-postbox .toolset-collapsible-inside { - padding: 0; - margin: 0; - border: 0; - box-shadow: none; -} - - -/* - Toolset Collapsable - */ -.toolset-collapsible-inside { - display: block; -} - -.toolset-collapsible-closed .toolset-collapsible-inside { - display: none; -} - -/** - * Listing first columns - */ -.wp-list-table td > span[data-bind*="displayName"] { - color: #0073aa; - cursor: pointer; -} -.wp-list-table td > span[data-bind*="displayName"]:hover { - color: #00a0d2; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/base.twig b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/base.twig deleted file mode 100644 index 2f28a6e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/base.twig +++ /dev/null @@ -1,17 +0,0 @@ -{# - Base template for Toolset admin pages. - - @since 2.2 -#} - -
            - {% block heading %} -

            {% block title %}{% endblock %}

            - {% endblock %} - -
            {% block content %}{% endblock %}
            - - {% block footer %} - - {% endblock %} -
            \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/forms.twig b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/forms.twig deleted file mode 100644 index 3363a06..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/forms.twig +++ /dev/null @@ -1,156 +0,0 @@ -{# - Various macros for easier rendering of input forms. - - Usage: - {% import "@toolset/forms.twig" as forms %} - {{ - forms.twoColumnRow( - forms.label(__( 'Name plural', 'wpcf' ), true), - forms.textInput('value: displayName') - ) - }} - - @since m2m -#} - - -{% macro textInput(dataBinding, class, value, label, isRequired, name, id, placeholder, type) %} - - {% if label is not empty %} - {{ _self.label(label, isRequired, name, _self.textInput(name, id, value, class, placeholder, '', isRequired)) }} - {% else %} - - {% endif %} -{% endmacro %} - -{# - Render select field with all options - - Usage: - {% import "@toolset/forms.twig" as forms %} - {% - set optionsArray = { - 0:{ 'value' : 'relationship1', 'selected' : true, 'title' : 'Relationship 1' }, - 1:{ 'value' : 'relationship2', 'title' : 'Relationship 2'}, - 2:{ 'value' : 'relationship3', 'title' : 'Relationship 3', 'disabled' : true} - } - %} - {{ - forms.twoColumnRow( - forms.label(__( 'Select', 'wpcf' ), true), - forms.selectInput('value: displayName', 'myclass', optionsArray, true, 'selector_name', '') - ) - }} - - - @since m2m -#} - -{% macro selectInput(dataBinding, class, options, IsRequired, name, id ) %} - {% set requiredInput = ( IsRequired ? 'required' : '' ) %} - - -{% endmacro %} - - -{% macro radio( dataBinding, value, label, name, class )%} - -{% endmacro %} - - -{% macro checkbox(dataBinding, value, label, name, class) %} - -{% endmacro %} - - -{% macro label(labelCaption, isRequired, for, content) %} - -{% endmacro %} - -{# - If it's necessary to control row visiblity you can set visibilityBinding - - example: - {{ - forms.twoColumnRow( - forms.label(__( 'Label', 'toolset' ), true), - forms.textInput('value: example', '', '', '', example, 'example', 'example', ''), - "exampleRowVisiblity" - ) - }} - - to control visibility use something like this: - - self.exampleRowVisiblity = ko.observable( false ); // hide row - or - self.exampleRowVisiblity = ko.observable( true ); // show row -#} -{% macro twoColumnRow(labelColumn, fieldColumn, visibilityBinding) %} - - - {{ labelColumn }} - - - {{ fieldColumn }} - - -{% endmacro %} - - -{% macro button(dataBinding, label, type = 'secondary', isLarge = false) %} - {% set typeToClass = { - secondary: 'button-seconday', - primary: 'button-primary', - red: 'button-primary toolset-red-button' - } %} - - {% set largeClass = ( isLarge ? 'button-large' : '' ) %} - - -{% endmacro %} - - -{% macro spinner(visibilityCondition) %} - -{% endmacro %} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/listing.twig b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/listing.twig deleted file mode 100644 index fdd9488..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/listing.twig +++ /dev/null @@ -1,176 +0,0 @@ -{# - Generic listing page template for Toolset. - - To be used with conjunction with the ListingPageController and ListingViewModel. - - For rendering column headers, there is a macro at the bottom of the template. - - @since 2.2 -#} - -{% extends "@toolset/base.twig" %} - -{% block title %}{{ strings.misc.pageTitle }}{% endblock %} - -{% block content %} - - {% block adminNotice %} -
            -

            - -
            - {% endblock %} - - {% block loaderSpinner %} -
            - -
            - {% endblock %} - - {% block actualContentWrapper %} - - - {% endblock %} - -{% endblock %} - -{% macro columnHeader(displayName, isSortable, slug, classNames, sortType = 'alpha', tdDataBind = '') %} - {% if isSortable == true %} - - - {{ displayName }} - - - - {% else %} - - {{ displayName }} - - {% endif %} -{% endmacro %} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/listing_pagination.twig b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/listing_pagination.twig deleted file mode 100644 index 02bf3d2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/listing_pagination.twig +++ /dev/null @@ -1,32 +0,0 @@ -{# - Pagination, WordPress-style. - - Used as a part of the listing.twig template. No need to touch this directly. - - @since 2.2 -#} -
            -
            - {{ strings.misc.items }} - - - {# enabled and disabled versions of both buttons #} - {# Wrapping the observable within a function avoids to be executed during rendering #} - « - - « - - - - - {{ strings.misc.of }} - - - {# enabled and disabled versions of both buttons #} - - » - - » - -
            -
            diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/pseudo_metabox_container.twig b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/pseudo_metabox_container.twig deleted file mode 100644 index 24d2138..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig-templates/pseudo_metabox_container.twig +++ /dev/null @@ -1,34 +0,0 @@ -{# - Pseudo metabox container. - - Allows us to render metaboxes properly on pages that originally don't support it. - - Usage: - Add your metaboxes via add_meta_box(). You can use different Twig templates for - each of them. - - Then, simply include this template: - {% include '@toolset/pseudo_metabox_container.twig' %} - - @since m2m -#} - -{# Everything that's not toolset-prefixed absolutely must be here, otherwise the styling breaks completely. #} -
            -
            - {# - Note that postbox containers must be numbered from the right side to the left, - otherwise the styling is not applied properly. It was a couple of fun hours figuring this out. - #} -
            - {% block postboxesDefault %} - {{ do_meta_boxes() }} - {% endblock %} -
            -
            - {% block postboxesSide %} - {{ do_meta_boxes( 'side' ) }} - {% endblock %} -
            -
            -
            diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_autoloader.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_autoloader.php deleted file mode 100644 index 84f673e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_autoloader.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * @since 2.2 - * @since 2.5.6 Autoloader bails out when it's possible to load the Twig_Environment class. - */ -class Toolset_Twig_Autoloader { - - /** - * Registers Types_Twig_Autoloader as an SPL autoloader if Twig_Autoloader isn't already registered. - * - * @param bool $prepend Whether to prepend the autoloader or not. - */ - public static function register( $prepend = false ) { - $autoloaders = spl_autoload_functions(); - foreach ( $autoloaders as $autoloader ) { - - // Resign if we detect Twig_Autoloader - if ( is_array( $autoloader ) - && 2 == count( $autoloader ) - && is_string( $autoloader[0] ) - && 'Twig_Autoloader' == $autoloader[0] - && is_string( $autoloader[1] ) - && 'autoload' == $autoloader[1] - ) { - return; - } - } - - // Also resign if it's simply possible to load a Twig Environment class already. - // That probably means a composer autoloader is managing this. - if( class_exists( 'Twig_Environment', true ) ) { - return; - } - - if ( PHP_VERSION_ID < 50300 ) { - spl_autoload_register( array( __CLASS__, 'autoload' ) ); - } else { - spl_autoload_register( array( __CLASS__, 'autoload' ), true, $prepend ); - } - - } - - - /** - * Handles autoloading of classes. - * - * @param string $class A class name. - */ - public static function autoload( $class ) { - if ( 0 !== strpos( $class, 'Twig' ) ) { - return; - } - - // Modified path to Twig in Toolset. - $file = TOOLSET_COMMON_PATH . '/lib/' . str_replace( array( '_', "\0" ), array( '/', '' ), $class . '.php' ); - - if ( is_file( $file ) ) { - /** @noinspection PhpIncludeInspection */ - require $file; - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_dialog_box.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_dialog_box.php deleted file mode 100644 index 7040f3e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_dialog_box.php +++ /dev/null @@ -1,102 +0,0 @@ -id ) ); - - $this->dialog_id = $dialog_id; - $this->twig = $twig; - $this->context = $context; - $this->template_name = $template_name; - - if( $late_register_assets ) { - $this->late_register_assets(); - } - - // We're going to render on the page we're creating this instance. - $this->init_screen_render(); - } - - - /** - * Render a predefined Twig template. - * - * @since 2.0 - * @throws Twig_Error_Loader When the template cannot be found - * @throws Twig_Error_Syntax When an error occurred during compilation - * @throws Twig_Error_Runtime - */ - public function template() { - printf( - '', - esc_attr( $this->dialog_id ), - $this->twig->render( $this->template_name, $this->context ) - ); - } - - - /** - * Manually register dialog assets in Toolset_Assets_Manager because by now we have already missed the - * toolset_add_registered_styles and toolset_add_registered_scripts filters (but there is still enough time - * to enqueue). - * - * @since 2.0 - */ - protected function late_register_assets() { - /* - * Toolset_DialogBoxes::register_styles() no longer exists - * https://git.onthegosystems.com/toolset/toolset-common/commit/cb176128ac8382cebbad46a39848b4c76fdcc7a7 - * - // Get script and styles from parent methods, and register them manually. - $styles = $this->register_styles( array() ); - foreach( $styles as $style ) { - Types_Asset_Manager::get_instance()->register_toolset_style( $style ); - } - */ - - $asset_manager = Toolset_Assets_Manager::get_instance(); - - $scripts = $this->register_scripts( array() ); - foreach( $scripts as $script ) { - $asset_manager->add_script( $script ); - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_dialog_box_factory.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_dialog_box_factory.php deleted file mode 100644 index c23d077..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_dialog_box_factory.php +++ /dev/null @@ -1,42 +0,0 @@ -create() instead. - */ - public function get_twig_dialog_box( $dialog_id, $twig, $context, $template_name, $late_register_assets = true ) { - return new Toolset_Twig_Dialog_Box( $dialog_id, $twig, $context, $template_name, $late_register_assets ); - } - - /** - * Gets a Twig dialog box instance - * - * @param string $dialog_id Unique ID (at least within the page) used to reference the dialog in JS. - * @param Twig_Environment $twig_environment Prepared Twig environment. - * @param array $context Twig context for the dialog template. - * @param string $template_name Twig template name that will be recognized by the provided environment. - * @param bool $late_register_assets Whether to run late_register_assets() or not. - * - * @return Toolset_Twig_Dialog_Box - * @since 2.3 - */ - public function create( $dialog_id, Twig_Environment $twig_environment, $context, $template_name, $late_register_assets = true ) { - return new Toolset_Twig_Dialog_Box( $dialog_id, $twig_environment, $context, $template_name, $late_register_assets ); - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_extensions.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_extensions.php deleted file mode 100644 index 407202c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/gui-base/twig_extensions.php +++ /dev/null @@ -1,64 +0,0 @@ -addFunction( '__', new Twig_SimpleFunction( '__', array( $this, 'translate' ) ) ); - $twig->addFunction( 'do_meta_boxes', new Twig_SimpleFunction( 'do_meta_boxes', array( $this, 'do_meta_boxes' ) ) ); - $twig->addFunction( 'unique_name', new Twig_SimpleFunction( 'unique_name', array( $this, 'unique_name' ) ) ); - $twig->addFunction( 'printf', new Twig_SimpleFunction( 'printf', 'printf' ) ); - $twig->addFunction( 'sprintf', new Twig_SimpleFunction( 'sprintf', 'sprintf' ) ); - $twig->addFunction( 'apply_filters', new Twig_SimpleFunction( 'apply_filters', 'apply_filters' ) ); - - return $twig; - } - - - public function translate( $text, $domain = 'types' ) { - return __( $text, $domain ); - } - - - public function do_meta_boxes( $context = 'normal', $object = '') { - do_meta_boxes( get_current_screen(), $context, $object ); - } - - - public function unique_name( $prefix = 'toolset_element_' ) { - $id = ++$this->last_unique_id; - - return $prefix . $id; - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/css/toolset-help-videos-retro.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/css/toolset-help-videos-retro.css deleted file mode 100644 index de55a89..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/css/toolset-help-videos-retro.css +++ /dev/null @@ -1,138 +0,0 @@ -.toolset-wrap{ - position:relative; -} -.toolset-videos-wrapper{ - clear: both; - margin: 10px 0 0 0; - width: 820px; - float:left; -} -.toolset-video-box-wrap{ - position: relative; - display:block; - /*width:100%;*/ - height:100%; - float:left; - clear:both; - overflow:hidden; - margin-top:20px; - margin-bottom:20px; -} -.toolset-wrap .toolset-video-box-wrap{overflow:visible;} - -.toolset-box-video { - position: relative; - top: 10px; - overflow: hidden; -} - -.toolset-box-container { - margin-bottom: 0px; -} - -.toolset-box-container:empty { - margin: 0; -} -.toolset-box-content{margin-bottom:2px;} -.remove-video{float:right;} -.remove-video-icon{font-size:16px;margin-right:2px;} -.remove-video-icon:hover{color:#0073aa;} -.toolset-box-footer{ - position: relative; - width:100%; - display: block; - overflow: hidden; - padding:4px 0px 0px 0px; -} -.toolset-box-header{ - position: relative; - width:100%; - display: block; - overflow: hidden; - padding:0px 0px 4px 0px; -} -.remove-video{cursor:pointer;} -.button.remove-video{margin:0px 0px 0px 4px;} -.remove-video-icon{position:relative;bottom:-1px;font-size:16px;} -.video-box-title{ - margin-bottom:0px; - padding-bottom:0px; - margin-top:0px; - padding-top:0px; - font-weight:normal; - font-size:13px; -} -.video-box-title-open{ - margin-bottom:0px; - padding-bottom:0px; - margin-top:0px; - padding-top:0px; - position:relative; - top:30px; - color:white; - z-index:8888; - font-family: 'FontAwesome'!important; - font-style: normal!important; - float:left; - margin-left:30px; - font-size:24px; - display:block; -} -.video-box-title-open i{ - font-family: 'FontAwesome'!important; - font-style: normal!important; -} -span.mejs-offscreen{display:none!important;} -.video-title-alone{cursor:pointer;} -/**** LIST *****/ -.js-video-list{ - color:#0073aa; - cursor:pointer; -} -.toolset-video-icon{ - font-size:14px; - margin-left:6px; -} -/*** OVERLAY ****/ -/*OVERLAY*/ -/* ------- */ -/* Overlay */ -/* ------- */ -.toolset-box-container .loader-overlay { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 3; - background: #000; - text-align: center; - opacity: .4; - width:100%; - height:100%; - float:left; -} -.toolset-box-container .loader-overlay-high-z { - z-index: 8888; -} - -.toolset-box-container .preloader { - position:absolute; - z-index: 100; - top:50%; - left:48%; - /*display: inline-block;*/ - margin: -32px 0 0 -32px; - width: 64px; - height: 64px; - background: url('../images/ajax-loader-overlay2.gif') center center no-repeat; - font-family: 'FontAwesome'!important; - font-style: normal!important; -} -.toolset-box-container .preloader i.fa.fa-play-circle{ - font-family: 'FontAwesome'!important; - font-style: normal!important; - font-size:7em; - cursor:pointer; -} -.toolset-box-container .preloader i.fa.fa-play-circle:hover{color:white;opacity: 1;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/css/toolset-help-videos.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/css/toolset-help-videos.css deleted file mode 100644 index 48ed39f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/css/toolset-help-videos.css +++ /dev/null @@ -1,139 +0,0 @@ -.toolset-wrap{ - position:relative; -} -.toolset-videos-wrapper{ - clear: both; - margin: 10px 0 0 0; - width: 820px; - float:left; -} -.toolset-video-box-wrap{ - position: relative; - display:block; - /*width:100%;*/ - height:100%; - float:left; - clear:both; - overflow:hidden; - margin-top:20px; - margin-bottom:20px; -} -.toolset-wrap .toolset-video-box-wrap{overflow:visible;} - -.toolset-box-video { - position: relative; - top: 10px; - overflow: hidden; -} -.toolset-box-video div.mejs-overlay-play{display:none!important;} /** let's make sure that the overlay is hidden even if original JS has $overlay.show(); **/ - -.toolset-box-container { - margin-bottom: 0px; -} - -.toolset-box-container:empty { - margin: 0; -} -.toolset-box-content{margin-bottom:2px;} -.remove-video{float:right;} -.remove-video-icon{font-size:16px;margin-right:2px;} -.remove-video-icon:hover{color:#0073aa;} -.toolset-box-footer{ - position: relative; - width:100%; - display: block; - overflow: hidden; - padding:4px 0px 0px 0px; -} -.toolset-box-header{ - position: relative; - width:100%; - display: block; - overflow: hidden; - padding:0px 0px 4px 0px; -} -.remove-video{cursor:pointer;} -.button.remove-video{margin:0px 0px 0px 4px;} -.remove-video-icon{position:relative;bottom:-1px;font-size:16px;} -.video-box-title{ - margin-bottom:0px; - padding-bottom:0px; - margin-top:0px; - padding-top:0px; - font-weight:normal; - font-size:13px; -} -.video-box-title-open{ - margin-bottom:0px; - padding-bottom:0px; - margin-top:0px; - padding-top:0px; - position:relative; - top:30px; - color:white; - z-index:8888; - font-family: 'FontAwesome'!important; - font-style: normal!important; - float:left; - margin-left:30px; - font-size:24px; - display:block; -} -.video-box-title-open i{ - font-family: 'FontAwesome'!important; - font-style: normal!important; -} -span.mejs-offscreen{display:none!important;} -.video-title-alone{cursor:pointer;} -/**** LIST *****/ -.js-video-list{ - color:#0073aa; - cursor:pointer; -} -.toolset-video-icon{ - font-size:14px; - margin-left:6px; -} -/*** OVERLAY ****/ -/*OVERLAY*/ -/* ------- */ -/* Overlay */ -/* ------- */ -.toolset-box-container .loader-overlay { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 3; - background: #000; - text-align: center; - opacity: .4; - width:100%; - height:100%; - float:left; -} -.toolset-box-container .loader-overlay-high-z { - z-index: 8888; -} - -.toolset-box-container .preloader { - position:absolute; - z-index: 100; - top:50%; - left:48%; - /*display: inline-block;*/ - margin: -32px 0 0 -32px; - width: 64px; - height: 64px; - background: url('../images/ajax-loader-overlay2.gif') center center no-repeat; - font-family: 'FontAwesome'!important; - font-style: normal!important; -} -.toolset-box-container .preloader i.fa.fa-play-circle{ - font-family: 'FontAwesome'!important; - font-style: normal!important; - font-size:7em; - cursor:pointer; -} -.toolset-box-container .preloader i.fa.fa-play-circle:hover{color:white;opacity: 1;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/images/ajax-loader-overlay.gif b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/images/ajax-loader-overlay.gif deleted file mode 100644 index d84f653..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/images/ajax-loader-overlay.gif and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/images/ajax-loader-overlay2.gif b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/images/ajax-loader-overlay2.gif deleted file mode 100644 index 6dbc965..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/images/ajax-loader-overlay2.gif and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/js/toolset-help-videos-retro.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/js/toolset-help-videos-retro.js deleted file mode 100644 index 7a446a5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/js/toolset-help-videos-retro.js +++ /dev/null @@ -1,374 +0,0 @@ -var WP_Toolset = WPV_Toolset || {}; - -WP_Toolset.HelpVideos = {}; - -if( typeof _ !== 'undefined' && _.templateSettings ) -{ - _.templateSettings = { - escape: /\{\{([^\}]+?)\}\}(?!\})/g, - evaluate: /<#([\s\S]+?)#>/g, - interpolate: /\{\{\{([\s\S]+?)\}\}\}/g - }; -} - -WP_Toolset.HelpVideosFactory = function ($) { - var self = this, - videos = WP_ToolsetVideoSettings.video_instances, - current = WP_ToolsetVideoSettings.current, - seen = WP_ToolsetVideoSettings.seen, - collection, - append_done = false, - triggered_manually = false, - collection_view = null; - - self.init = function () { - return self.show_video(current); - }; - - self.get_seen = function(){ - return seen; - } - - self.populate_collection = function(){ - collection = new WP_Toolset.HelpVideosCollection(); - _.each(videos, function(v){ - collection.add( new WP_Toolset.HelpVideo( v ) ); - }); - return collection; - }; - - self.get_videos = function(){ - return collection; - }; - - self.create_on_the_fly = function(element,append_to){ - if( append_done === false ){ - var el = self.create_element(element); - jQuery(append_to).append(el); - append_done = true; - } - }; - - self.handle_list = function(){ - var models = self.populate_collection(); - collection_view = new WP_Toolset.HelpVideosListView({model:models}); - jQuery( '.js-toolset-videos-wrapper' ).append( jQuery(WP_ToolsetVideoSettings.VIDEOS_LIST_TITLE), collection_view.$el ); - }; - - self.show_video = function( video ){ - if ( videos.hasOwnProperty(video) ) { - - if( adminpage !== WP_ToolsetVideoSettings.detached_page && videos[video].hasOwnProperty('append_to') && videos[video].append_to !== '' ){ - self.create_on_the_fly( videos[video].element ? videos[video].element : WP_ToolsetVideoSettings.GENERIC_ELEMENT, videos[video].append_to ); - } - - var model = WP_Toolset.HelpVideos.hasOwnProperty(video) ? WP_Toolset.HelpVideos[video] : new WP_Toolset.HelpVideo(videos[video]), - view = new WP_Toolset.HelpVideoView({ - el: videos[video].element ? videos[video].element : WP_ToolsetVideoSettings.GENERIC_ELEMENT, - model: model - }); - - if( adminpage !== WP_ToolsetVideoSettings.detached_page && self.get_seen() === 'seen' && triggered_manually === false ){ - view.$el.hide(); - view.manual_trigger(); - triggered_manually = true; - } - - jQuery('.js-toolset-videos-wrapper').width( model.get('width') ).height( model.get('height') ); - - WP_Toolset.HelpVideos[video] = model; - - return WP_Toolset.HelpVideos[video]; - } - - return null; - }; - - self.show_new_video = function( model ){ - self.remove_list(); - jQuery('.js-toolset-videos-wrapper').append( self.create_element( model.get('element') ) ); - self.show_video( model.get('name') ); - }; - - self.create_element = function( selector ){ - var sel = selector.substring(1); - return jQuery('
            ') - }; - - self.remove_list = function(){ - jQuery('.js-videos-list-title').remove(); - collection_view.remove(); - }; - - self.init(); -}; - -WP_Toolset.HelpVideo = Backbone.Model.extend({ - defaults: { - title:'', - name: '', - url: '', - element: '', - screens: [], - width:'600px', - height:'400px' - } -}); - -WP_Toolset.HelpVideosCollection = Backbone.Collection.extend({ - model:WP_Toolset.HelpVideo, - current:null -}); - - -WP_Toolset.HelpVideoView = Backbone.View.extend({ - DELAY:200, - initialize: function (options) { - var self = this; - self.template_selector = '#toolset-video-template'; - self.template = _.template(jQuery(self.template_selector).html()); - self.deatch_url = WP_ToolsetVideoSettings.detach_url; - self.render(options).el; - }, - render: function (options) { - var self = this; - self.$el.html(self.template(self.model.toJSON())); - self.wrap = jQuery('.js-toolset-box-container', self.$el); - self.handle_detach(); - self.wrap.loaderOverlay('show', { - class:'loader-overlay-high-z', - css : { - "opacity" : "0.65", - height : self.model.get('height') - } - } - ); - self.hidden_wrap = jQuery('.js-video-player-box', self.$el); - self.remove_button = jQuery('.js-remove-video', self.$el); - self.handle_video(); - self.remove_video(); - return self; - }, - handle_detach:function(){ - var self = this, $button = jQuery('.js-detach-video', self.$el); - if( adminpage === WP_ToolsetVideoSettings.detached_page ){ - $button.hide(); - } else { - $button.on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - self.remove_button.trigger('click'); - window.open( self.deatch_url ); - }); - } - }, - handle_video:function(){ - var self = this; - var video = jQuery('.js-video-player'); - if( video.length === 0 ) return; // if no player instances in DOM then do nothing - self.player = new MediaElementPlayer( video, { - alwaysShowHours: false, - width:self.model.get('width'), - height:self.model.get('height'), - success: function (mediaElement, domObject) { - mediaElement.addEventListener('loadeddata', function(e) { - mediaElement.pause(); - self.hidden_wrap.fadeIn(self.DELAY, function(event){ - self.setPlay( mediaElement ); - - }); - }, false); - - mediaElement.addEventListener('ended', function(e) { - self.setPlay( mediaElement, true ); - }, false); - mediaElement.addEventListener('play', function(e) { - jQuery('.mejs-mediaelement').loaderOverlay('hide'); - }, false); - }, - // fires when a problem is detected - error: function () { - - } - } ); - }, - setPlay:function( mediaElement, after_ended ){ - var play = jQuery(''), - $title = jQuery('.js-video-box-title-open').eq(0).detach().clone(); - - jQuery('.mejs-mediaelement').loaderOverlay('show', { - class:'loader-overlay-high-z', - css : { - "opacity" : "0.7", - 'height': jQuery('.mejs-mediaelement').height() - 30 + 'px' - } - }); - - - jQuery('.js-video-box-title-open').remove(); - jQuery('.toolset-box-container .loader-overlay').append($title); - - jQuery('.toolset-box-container .preloader').css({ - 'background':'none' - }).append(play); - - jQuery('.js-toolset-play-video').on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - jQuery('.mejs-mediaelement').loaderOverlay('hide',{onRemove:function(){ - - mediaElement.play(); - - }}); - }); - - this.wrap.loaderOverlay('hide',{onRemove:function(){ - }, fadeOutSpeed:200}); - }, - remove_video:function(){ - var self = this; - self.remove_button.on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - self.$el.hide(400, function(){ - if( adminpage === WP_ToolsetVideoSettings.detached_page ){ - WP_Toolset.HelpVideos.main.handle_list(); - } else { - self.insert_title_view(); - } - self.remove(); - }); - }); - }, - manual_trigger:function(){ - var self = this; - self.remove_button.trigger('click'); - }, - insert_title_view:function(){ - var self = this, - index = self.$el.index(), - parent = self.$el.parent(), - element = self.model.get('element') ? self.model.get('element').substring(1) : WP_ToolsetVideoSettings.GENERIC_ELEMENT, - new_me = new WP_Toolset.HelpVideoListView({ - model:self.model, - template_selector:'#toolset-video-header-template', - tagName:'div', - classes:element, - id:element - }); - - parent.insertAtIndex(index, new_me.$el); - return new_me; - } -}); - -WP_Toolset.HelpVideoListView = Backbone.View.extend({ - initialize:function(options){ - var self = this; - self.tagName = options.tagName; - self.$el.addClass(options.classes + ' video-title-alone'); - if( options.hasOwnProperty('id') ){ - self.$el.prop('id', options.id); - } - self.template_selector = options.template_selector; - self.template = _.template(jQuery(self.template_selector).html()); - self.render( options ).el - return self; - }, - render:function( options ){ - var self = this; - self.$el.html(self.template(self.model.toJSON())); - self.show(); - return self; - }, - show:function(){ - var self = this; - self.$el.on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - if( adminpage === WP_ToolsetVideoSettings.detached_page ) { - WP_Toolset.HelpVideos.main.show_new_video(self.model); - } else { - self.insert_video_view(); - } - }); - }, - insert_video_view:function(){ - var self = this, - index = self.$el.index(), - parent = self.$el.parent(); - - self.$el.empty(); - parent.insertAtIndex( index, self.$el.clone() ); - self.remove(); - WP_Toolset.HelpVideos.main.show_video( self.model.get('name') ); - } -}); - -WP_Toolset.HelpVideosListView = Backbone.View.extend({ - el:'.js-videos-list', - tagName: 'ul', - initialize:function(options){ - var self = this; - self.$el = self.create_element(); - self.el = self.$el[0]; - self.render(options).el; - return self; - }, - render:function( option ){ - - var self = this, - options = _.extend({}, option); - - self.$el.empty(); - - self.fragment = document.createDocumentFragment(); - - self.appendModelElement( options ); - - self.$el.append( self.fragment ); - - return self; - }, - appendModelElement:function( option ){ - var self = this, view, el, options = option; - - self.model.each(function(model){ - - try{ - - options = { - model:model - } - - view = new WP_Toolset.HelpVideoListView({ - model:model, - template_selector:'#toolset-video-list-template', - tagName:'li', - classes:'js-video-list toolset-video-list' - }); - - el = view.el; - - self.fragment.appendChild( el ); - - } - catch( e ) - { - console.error( e.message ); - } - }, self) - - return this; - }, - create_element:function(){ - return jQuery('
              '); - } -}); - -(function ($) { - $(function () { - WP_Toolset.HelpVideos.main = {}; - WP_Toolset.HelpVideosFactory.call(WP_Toolset.HelpVideos.main, $); - }); -}(jQuery)); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/js/toolset-help-videos.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/js/toolset-help-videos.js deleted file mode 100644 index f8ea4e5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/res/js/toolset-help-videos.js +++ /dev/null @@ -1,374 +0,0 @@ -var WP_Toolset = WPV_Toolset || {}; - -WP_Toolset.HelpVideos = {}; - -if( typeof _ !== 'undefined' && _.templateSettings ) -{ - _.templateSettings = { - escape: /\{\{([^\}]+?)\}\}(?!\})/g, - evaluate: /<#([\s\S]+?)#>/g, - interpolate: /\{\{\{([\s\S]+?)\}\}\}/g - }; -} - -WP_Toolset.HelpVideosFactory = function ($) { - var self = this, - videos = WP_ToolsetVideoSettings.video_instances, - current = WP_ToolsetVideoSettings.current, - seen = WP_ToolsetVideoSettings.seen, - collection, - append_done = false, - triggered_manually = false, - collection_view = null; - - self.init = function () { - return self.show_video(current); - }; - - self.get_seen = function(){ - return seen; - } - - self.populate_collection = function(){ - collection = new WP_Toolset.HelpVideosCollection(); - _.each(videos, function(v){ - collection.add( new WP_Toolset.HelpVideo( v ) ); - }); - return collection; - }; - - self.get_videos = function(){ - return collection; - }; - - self.create_on_the_fly = function(element,append_to){ - if( append_done === false ){ - var el = self.create_element(element); - jQuery(append_to).append(el); - append_done = true; - } - }; - - self.handle_list = function(){ - var models = self.populate_collection(); - collection_view = new WP_Toolset.HelpVideosListView({model:models}); - jQuery( '.js-toolset-videos-wrapper' ).append( jQuery(WP_ToolsetVideoSettings.VIDEOS_LIST_TITLE), collection_view.$el ); - }; - - self.show_video = function( video ){ - if ( videos.hasOwnProperty(video) ) { - - if( adminpage !== WP_ToolsetVideoSettings.detached_page && videos[video].hasOwnProperty('append_to') && videos[video].append_to !== '' ){ - self.create_on_the_fly( videos[video].element ? videos[video].element : WP_ToolsetVideoSettings.GENERIC_ELEMENT, videos[video].append_to ); - } - - var model = WP_Toolset.HelpVideos.hasOwnProperty(video) ? WP_Toolset.HelpVideos[video] : new WP_Toolset.HelpVideo(videos[video]), - view = new WP_Toolset.HelpVideoView({ - el: videos[video].element ? videos[video].element : WP_ToolsetVideoSettings.GENERIC_ELEMENT, - model: model - }); - - if( adminpage !== WP_ToolsetVideoSettings.detached_page && self.get_seen() === 'seen' && triggered_manually === false ){ - view.$el.hide(); - view.manual_trigger(); - triggered_manually = true; - } - - jQuery('.js-toolset-videos-wrapper').width( model.get('width') ).height( model.get('height') ); - - WP_Toolset.HelpVideos[video] = model; - - return WP_Toolset.HelpVideos[video]; - } - - return null; - }; - - self.show_new_video = function( model ){ - self.remove_list(); - jQuery('.js-toolset-videos-wrapper').append( self.create_element( model.get('element') ) ); - self.show_video( model.get('name') ); - }; - - self.create_element = function( selector ){ - var sel = selector.substring(1); - return jQuery('
              ') - }; - - self.remove_list = function(){ - jQuery('.js-videos-list-title').remove(); - collection_view.remove(); - }; - - self.init(); -}; - -WP_Toolset.HelpVideo = Backbone.Model.extend({ - defaults: { - title:'', - name: '', - url: '', - element: '', - screens: [], - width:'600px', - height:'400px' - } -}); - -WP_Toolset.HelpVideosCollection = Backbone.Collection.extend({ - model:WP_Toolset.HelpVideo, - current:null -}); - - -WP_Toolset.HelpVideoView = Backbone.View.extend({ - DELAY:200, - initialize: function (options) { - var self = this; - self.template_selector = '#toolset-video-template'; - self.template = _.template(jQuery(self.template_selector).html()); - self.deatch_url = WP_ToolsetVideoSettings.detach_url; - self.render(options).el; - }, - render: function (options) { - var self = this; - self.$el.html(self.template(self.model.toJSON())); - self.wrap = jQuery('.js-toolset-box-container', self.$el); - self.handle_detach(); - self.wrap.loaderOverlay('show', { - class:'loader-overlay-high-z', - css : { - "opacity" : "0.65", - height : self.model.get('height') - } - } - ); - self.hidden_wrap = jQuery('.js-video-player-box', self.$el); - self.remove_button = jQuery('.js-remove-video', self.$el); - self.handle_video(); - self.remove_video(); - return self; - }, - handle_detach:function(){ - var self = this, $button = jQuery('.js-detach-video', self.$el); - if( adminpage === WP_ToolsetVideoSettings.detached_page ){ - $button.hide(); - } else { - $button.on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - self.remove_button.trigger('click'); - window.open( self.deatch_url ); - }); - } - }, - handle_video:function(){ - var self = this; - var video = jQuery('.js-video-player'); - if( video.length === 0 ) return; // if no player instances in DOM then do nothing - self.player = new MediaElementPlayer( video[0], { - alwaysShowHours: false, - width:self.model.get('width'), - height:self.model.get('height'), - success: function (mediaElement, domObject, instance) { - var playerContainer = instance.getElement(instance.container); - var startPlayer = function(e) { - mediaElement.pause(); - self.hidden_wrap.fadeIn(self.DELAY, function(event){ - self.setPlay( mediaElement ); - e.target.removeEventListener( 'controlsshown', startPlayer, false ); - }); - }; - playerContainer.addEventListener('controlsshown', startPlayer, false); - - mediaElement.addEventListener('ended', function(e) { - self.setPlay( mediaElement, true ); - }, false); - mediaElement.addEventListener('play', function(e) { - jQuery('.mejs-mediaelement').loaderOverlay('hide'); - }, false); - }, - // fires when a problem is detected - error: function () { - console.log( 'error', arguments ); - } - } ); - }, - setPlay:function( mediaElement, after_ended ){ - var play = jQuery(''), - $title = jQuery('.js-video-box-title-open').eq(0).detach().clone(); - - jQuery('.mejs-mediaelement').loaderOverlay('show', { - class:'loader-overlay-high-z', - css : { - "opacity" : "0.7", - 'height': jQuery('.mejs-mediaelement').height() - 30 + 'px' - } - }); - - - jQuery('.js-video-box-title-open').remove(); - jQuery('.toolset-box-container .loader-overlay').append($title); - - jQuery('.toolset-box-container .preloader').css({ - 'background':'none' - }).append(play); - - jQuery('.js-toolset-play-video').on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - jQuery('.mejs-mediaelement').loaderOverlay('hide',{onRemove:function(){ - mediaElement.play(); - }}); - }); - - this.wrap.loaderOverlay('hide',{onRemove:function(){ - }, fadeOutSpeed:200}); - }, - remove_video:function(){ - var self = this; - self.remove_button.on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - self.$el.hide(400, function(){ - if( adminpage === WP_ToolsetVideoSettings.detached_page ){ - WP_Toolset.HelpVideos.main.handle_list(); - } else { - self.insert_title_view(); - } - self.remove(); - }); - }); - }, - manual_trigger:function(){ - var self = this; - self.remove_button.trigger('click'); - }, - insert_title_view:function(){ - var self = this, - index = self.$el.index(), - parent = self.$el.parent(), - element = self.model.get('element') ? self.model.get('element').substring(1) : WP_ToolsetVideoSettings.GENERIC_ELEMENT, - new_me = new WP_Toolset.HelpVideoListView({ - model:self.model, - template_selector:'#toolset-video-header-template', - tagName:'div', - classes:element, - id:element - }); - - parent.insertAtIndex(index, new_me.$el); - return new_me; - } -}); - -WP_Toolset.HelpVideoListView = Backbone.View.extend({ - initialize:function(options){ - var self = this; - self.tagName = options.tagName; - self.$el.addClass(options.classes + ' video-title-alone'); - if( options.hasOwnProperty('id') ){ - self.$el.prop('id', options.id); - } - self.template_selector = options.template_selector; - self.template = _.template(jQuery(self.template_selector).html()); - self.render( options ).el - return self; - }, - render:function( options ){ - var self = this; - self.$el.html(self.template(self.model.toJSON())); - self.show(); - return self; - }, - show:function(){ - var self = this; - self.$el.on('click', function(event){ - event.stopImmediatePropagation(); - event.preventDefault(); - if( adminpage === WP_ToolsetVideoSettings.detached_page ) { - WP_Toolset.HelpVideos.main.show_new_video(self.model); - } else { - self.insert_video_view(); - } - }); - }, - insert_video_view:function(){ - var self = this, - index = self.$el.index(), - parent = self.$el.parent(); - - self.$el.empty(); - parent.insertAtIndex( index, self.$el.clone() ); - self.remove(); - WP_Toolset.HelpVideos.main.show_video( self.model.get('name') ); - } -}); - -WP_Toolset.HelpVideosListView = Backbone.View.extend({ - el:'.js-videos-list', - tagName: 'ul', - initialize:function(options){ - var self = this; - self.$el = self.create_element(); - self.el = self.$el[0]; - self.render(options).el; - return self; - }, - render:function( option ){ - - var self = this, - options = _.extend({}, option); - - self.$el.empty(); - - self.fragment = document.createDocumentFragment(); - - self.appendModelElement( options ); - - self.$el.append( self.fragment ); - - return self; - }, - appendModelElement:function( option ){ - var self = this, view, el, options = option; - - self.model.each(function(model){ - - try{ - - options = { - model:model - } - - view = new WP_Toolset.HelpVideoListView({ - model:model, - template_selector:'#toolset-video-list-template', - tagName:'li', - classes:'js-video-list toolset-video-list' - }); - - el = view.el; - - self.fragment.appendChild( el ); - - } - catch( e ) - { - console.error( e.message ); - } - }, self) - - return this; - }, - create_element:function(){ - return jQuery('
                '); - } -}); - -(function ($) { - $(function () { - WP_Toolset.HelpVideos.main = {}; - WP_Toolset.HelpVideosFactory.call(WP_Toolset.HelpVideos.main, $); - }); -}(jQuery)); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/templates/help-video.tpl.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/templates/help-video.tpl.php deleted file mode 100644 index e977bde..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/templates/help-video.tpl.php +++ /dev/null @@ -1,38 +0,0 @@ - - - - - \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/templates/tutorial-video-page.tpl.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/templates/tutorial-video-page.tpl.php deleted file mode 100644 index e9be05f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/templates/tutorial-video-page.tpl.php +++ /dev/null @@ -1,6 +0,0 @@ -
                -
                -
                -
                -
                -
                \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/toolset-help-videos.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/toolset-help-videos.php deleted file mode 100644 index 22bb6c1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/help-videos/toolset-help-videos.php +++ /dev/null @@ -1,242 +0,0 @@ - $argument) { - $this->{$property} = $argument; - } - } - - add_filter('toolset_video_instances', array(&$this, 'push_tooolset_video_instances'), 10, 1); - add_filter('toolset_add_registered_script', array(&$this, 'add_register_scripts')); - add_filter('toolset_add_registered_styles', array(&$this, 'add_register_styles')); - add_action('admin_print_scripts', array(&$this, 'admin_enqueue_scripts')); - add_action('admin_footer', array(&$this, 'load_template')); - add_action( 'admin_footer', array(&$this, 'add_user_meta'), 999 ); - } - - public function add_user_meta(){ - if( self::$current == null || $this->name != self::$current ) return; - add_user_meta( $this->get_current_user_id(), self::$current, 'seen', true ); - } - - private function get_current_user_id(){ - global $current_user; - $current_user = wp_get_current_user(); - $user_id = $current_user->ID; - return $user_id; - } - - private function is_wp_older_than_4_dot_9(){ - $current = get_bloginfo('version'); - return version_compare( $current, '4.9-RC1' ) === -1; - } - - public function add_register_scripts($scripts) - { - if( $this->is_wp_older_than_4_dot_9() ){ - $scripts['toolset-help-video'] = new Toolset_Script('toolset-help-video', TOOLSET_COMMON_URL . '/utility/help-videos/res/js/toolset-help-videos-retro.js', array('jquery', 'underscore', 'backbone', 'wp-mediaelement', 'toolset-utils'), '1.0', true); - } else { - $scripts['toolset-help-video'] = new Toolset_Script('toolset-help-video', TOOLSET_COMMON_URL . '/utility/help-videos/res/js/toolset-help-videos.js', array('jquery', 'underscore', 'backbone', 'wp-mediaelement', 'toolset-utils'), '1.0', true); - } - - return $scripts; - } - - public function add_register_styles($styles) - { - if( $this->is_wp_older_than_4_dot_9() ) { - $styles['toolset-help-video'] = new Toolset_Style( 'toolset-help-video', TOOLSET_COMMON_URL . '/utility/help-videos/res/css/toolset-help-videos-retro.css' ); - } else { - $styles['toolset-help-video'] = new Toolset_Style( 'toolset-help-video', TOOLSET_COMMON_URL . '/utility/help-videos/res/css/toolset-help-videos.css' ); - } - - return $styles; - } - - public function admin_enqueue_scripts() - { - if ( - !is_admin() - || !function_exists('get_current_screen') - ) { - return; - } - - $screen = get_current_screen(); - - $this->screens[] = Toolset_VideoDetachedPage::get_screen(); - - if (!empty($this->screens) && !in_array($screen->id, $this->screens)) { - return; - } - - $instances = apply_filters('toolset_video_instances', self::$instances); - $current = apply_filters('toolset_current_video', self::$current); - - if (isset($instances[$current]) === false) return; - - do_action('toolset_enqueue_scripts', array( - 'toolset-help-video' - )); - do_action('toolset_enqueue_styles', array( - 'wp-mediaelement', - 'font-awesome', - 'toolset-help-video' - )); - - do_action('toolset_localize_script', 'toolset-help-video', 'WP_ToolsetVideoSettings', array( - 'video_instances' => $instances, - 'current' => $current, - 'seen' => get_user_meta( $this->get_current_user_id(), self::$current, true ), - 'detached_page' => Toolset_VideoDetachedPage::get_screen(), - 'detach_url' => admin_url(sprintf('admin.php?page=toolset_video_tutorials&toolset_help_video=%s', $instances[$current]['name'])), - 'GENERIC_ELEMENT' => self::GENERIC_ELEMENT, - 'VIDEOS_LIST_TITLE' => sprintf(__('%sVideo Tutorials%s', 'toolset-common'), '

                ', '

                ') - )); - } - - public function push_tooolset_video_instances($instances) - { - - self::$instances[$this->name] = array( - 'name' => $this->name, - 'url' => $this->url, - 'element' => $this->element, - 'screens' => $this->screens, - 'width' => $this->width, - 'height' => $this->height, - 'title' => $this->title, - 'append_to' => $this->append_to - ); - - return self::$instances; - } - - public function load_template() - { - include_once TOOLSET_COMMON_PATH . '/utility/help-videos/templates/help-video.tpl.php'; - } - - public static function get_current() - { - return isset(self::$instances[self::$current]) ? self::$instances[self::$current] : null; - } - } - - abstract class Toolset_HelpVideosFactoryAbstract - { - - const WIDTH = '820px'; - const HEIGHT = '506px'; - protected $videos = array(); - - protected function __construct() - { - $this->process_videos(); - } - - final public static function getInstance() - { - static $instances = array(); - $called_class = get_called_class(); - if ( !isset($instances[$called_class]) && class_exists($called_class) ) { - $instances[$called_class] = new $called_class(); - } - return isset( $instances[$called_class] ) ? $instances[$called_class] : null; - } - - protected abstract function define_toolset_videos(); - - protected function process_videos() - { - - $videos = $this->define_toolset_videos(); - - if (!$videos || empty($videos)) return; - - foreach ($videos as $video) { - - $video = wp_parse_args( - $video, - array('width' => self::WIDTH, 'height' => self::HEIGHT) - ); - - $this->videos[] = new Toolset_HelpVideo( - $video - ); - } - return $this->videos; - } - } - - class Toolset_VideoDetachedPage - { - private static $instance; - const SLUG = 'toolset_video_tutorials'; - const SCREEN = 'admin_page_toolset_video_tutorials'; - - protected function __construct() - { - if ( is_admin() && function_exists('add_submenu_page') ) { - add_submenu_page(null, __('Video Tutorial'), '', 'manage_options', self::SLUG, array(&$this, 'load_template')); - } - } - - final public static function getInstance() - { - if (!self::$instance) { - self::$instance = new Toolset_VideoDetachedPage(); - } - - return self::$instance; - } - - function load_template() - { - $current = Toolset_HelpVideo::get_current(); - - if (null === $current) { - printf(__('%sNo videos to play%s'), '

                ', '

                '); - } else { - $element = isset($current['element']) ? trim($current['element'], '.,#') : Toolset_HelpVideo::GENERIC_ELEMENT; - require_once TOOLSET_COMMON_PATH . '/utility/help-videos/templates/tutorial-video-page.tpl.php'; - } - - } - - public static function get_screen() - { - return self::SCREEN; - } - } - - add_action( 'admin_menu', array( 'Toolset_VideoDetachedPage', 'getInstance' ), 99 ); - - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/keyboard.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/keyboard.js deleted file mode 100644 index 7d011d6..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/keyboard.js +++ /dev/null @@ -1,961 +0,0 @@ -/** - * Title: KeyboardJS - * Version: v0.4.1 - * Description: KeyboardJS is a flexible and easy to use keyboard binding - * library. - * Author: Robert Hurst. - * - * Copyright 2011, Robert William Hurst - * Licenced under the BSD License. - * See https://raw.github.com/RobertWHurst/KeyboardJS/master/license.txt - */ -(function(context, factory) { - - //INDEXOF POLLYFILL - [].indexOf||(Array.prototype.indexOf=function(a,b,c){for(c=this.length,b=(c+~~b)%c;b"]], - ['shift + /', ["questionmark", "?"]] - ] - }; - //a-z and A-Z - for (aI = 65; aI <= 90; aI += 1) { - usLocale.map[aI] = String.fromCharCode(aI + 32); - usLocale.macros.push(['shift + ' + String.fromCharCode(aI + 32) + ', capslock + ' + String.fromCharCode(aI + 32), [String.fromCharCode(aI)]]); - } - registerLocale('us', usLocale); - getSetLocale('us'); - - - ////////// - // INIT // - ////////// - - //enable the library - enable(); - - - ///////// - // API // - ///////// - - //assemble the library and return it - KeyboardJS.enable = enable; - KeyboardJS.disable = disable; - KeyboardJS.activeKeys = getActiveKeys; - KeyboardJS.releaseKey = removeActiveKey; - KeyboardJS.pressKey = addActiveKey; - KeyboardJS.on = createBinding; - KeyboardJS.clear = removeBindingByKeyCombo; - KeyboardJS.clear.key = removeBindingByKeyName; - KeyboardJS.locale = getSetLocale; - KeyboardJS.locale.register = registerLocale; - KeyboardJS.macro = createMacro; - KeyboardJS.macro.remove = removeMacro; - KeyboardJS.key = {}; - KeyboardJS.key.name = getKeyName; - KeyboardJS.key.code = getKeyCode; - KeyboardJS.combo = {}; - KeyboardJS.combo.active = isSatisfiedCombo; - KeyboardJS.combo.parse = parseKeyCombo; - KeyboardJS.combo.stringify = stringifyKeyCombo; - return KeyboardJS; - - - ////////////////////// - // INSTANCE METHODS // - ////////////////////// - - /** - * Enables KeyboardJS - */ - function enable() { - if(targetWindow.addEventListener) { - targetWindow.document.addEventListener('keydown', keydown, false); - targetWindow.document.addEventListener('keyup', keyup, false); - targetWindow.addEventListener('blur', reset, false); - targetWindow.addEventListener('webkitfullscreenchange', reset, false); - targetWindow.addEventListener('mozfullscreenchange', reset, false); - } else if(targetWindow.attachEvent) { - targetWindow.document.attachEvent('onkeydown', keydown); - targetWindow.document.attachEvent('onkeyup', keyup); - targetWindow.attachEvent('onblur', reset); - } - } - - /** - * Exits all active bindings and disables KeyboardJS - */ - function disable() { - reset(); - if(targetWindow.removeEventListener) { - targetWindow.document.removeEventListener('keydown', keydown, false); - targetWindow.document.removeEventListener('keyup', keyup, false); - targetWindow.removeEventListener('blur', reset, false); - targetWindow.removeEventListener('webkitfullscreenchange', reset, false); - targetWindow.removeEventListener('mozfullscreenchange', reset, false); - } else if(targetWindow.detachEvent) { - targetWindow.document.detachEvent('onkeydown', keydown); - targetWindow.document.detachEvent('onkeyup', keyup); - targetWindow.detachEvent('onblur', reset); - } - } - - - //////////////////// - // EVENT HANDLERS // - //////////////////// - - /** - * Exits all active bindings. Optionally passes an event to all binding - * handlers. - * @param {KeyboardEvent} event [Optional] - */ - function reset(event) { - activeKeys = []; - pruneMacros(); - pruneBindings(event); - } - - /** - * Key down event handler. - * @param {KeyboardEvent} event - */ - function keydown(event) { - var keyNames, keyName, kI; - keyNames = getKeyName(event.keyCode); - if(keyNames.length < 1) { return; } - event.isRepeat = false; - for(kI = 0; kI < keyNames.length; kI += 1) { - keyName = keyNames[kI]; - if (getActiveKeys().indexOf(keyName) != -1) - event.isRepeat = true; - addActiveKey(keyName); - } - executeMacros(); - executeBindings(event); - } - - /** - * Key up event handler. - * @param {KeyboardEvent} event - */ - function keyup(event) { - var keyNames, kI; - keyNames = getKeyName(event.keyCode); - if(keyNames.length < 1) { return; } - for(kI = 0; kI < keyNames.length; kI += 1) { - removeActiveKey(keyNames[kI]); - } - pruneMacros(); - pruneBindings(event); - } - - /** - * Accepts a key code and returns the key names defined by the current - * locale. - * @param {Number} keyCode - * @return {Array} keyNames An array of key names defined for the key - * code as defined by the current locale. - */ - function getKeyName(keyCode) { - return map[keyCode] || []; - } - - /** - * Accepts a key name and returns the key code defined by the current - * locale. - * @param {Number} keyName - * @return {Number|false} - */ - function getKeyCode(keyName) { - var keyCode; - for(keyCode in map) { - if(!map.hasOwnProperty(keyCode)) { continue; } - if(map[keyCode].indexOf(keyName) > -1) { return keyCode; } - } - return false; - } - - - //////////// - // MACROS // - //////////// - - /** - * Accepts a key combo and an array of key names to inject once the key - * combo is satisfied. - * @param {String} combo - * @param {Array} injectedKeys - */ - function createMacro(combo, injectedKeys) { - if(typeof combo !== 'string' && (typeof combo !== 'object' || typeof combo.push !== 'function')) { - throw new Error("Cannot create macro. The combo must be a string or array."); - } - if(typeof injectedKeys !== 'object' || typeof injectedKeys.push !== 'function') { - throw new Error("Cannot create macro. The injectedKeys must be an array."); - } - macros.push([combo, injectedKeys]); - } - - /** - * Accepts a key combo and clears any and all macros bound to that key - * combo. - * @param {String} combo - */ - function removeMacro(combo) { - var macro; - if(typeof combo !== 'string' && (typeof combo !== 'object' || typeof combo.push !== 'function')) { throw new Error("Cannot remove macro. The combo must be a string or array."); } - for(mI = 0; mI < macros.length; mI += 1) { - macro = macros[mI]; - if(compareCombos(combo, macro[0])) { - removeActiveKey(macro[1]); - macros.splice(mI, 1); - break; - } - } - } - - /** - * Executes macros against the active keys. Each macro's key combo is - * checked and if found to be satisfied, the macro's key names are injected - * into active keys. - */ - function executeMacros() { - var mI, combo, kI; - for(mI = 0; mI < macros.length; mI += 1) { - combo = parseKeyCombo(macros[mI][0]); - if(activeMacros.indexOf(macros[mI]) === -1 && isSatisfiedCombo(combo)) { - activeMacros.push(macros[mI]); - for(kI = 0; kI < macros[mI][1].length; kI += 1) { - addActiveKey(macros[mI][1][kI]); - } - } - } - } - - /** - * Prunes active macros. Checks each active macro's key combo and if found - * to no longer to be satisfied, each of the macro's key names are removed - * from active keys. - */ - function pruneMacros() { - var mI, combo, kI; - for(mI = 0; mI < activeMacros.length; mI += 1) { - combo = parseKeyCombo(activeMacros[mI][0]); - if(isSatisfiedCombo(combo) === false) { - for(kI = 0; kI < activeMacros[mI][1].length; kI += 1) { - removeActiveKey(activeMacros[mI][1][kI]); - } - activeMacros.splice(mI, 1); - mI -= 1; - } - } - } - - - ////////////// - // BINDINGS // - ////////////// - - /** - * Creates a binding object, and, if provided, binds a key down hander and - * a key up handler. Returns a binding object that emits keyup and - * keydown events. - * @param {String} keyCombo - * @param {Function} keyDownCallback [Optional] - * @param {Function} keyUpCallback [Optional] - * @return {Object} binding - */ - function createBinding(keyCombo, keyDownCallback, keyUpCallback) { - var api = {}, binding, subBindings = [], bindingApi = {}, kI, - subCombo; - - //break the combo down into a combo array - if(typeof keyCombo === 'string') { - keyCombo = parseKeyCombo(keyCombo); - } - - //bind each sub combo contained within the combo string - for(kI = 0; kI < keyCombo.length; kI += 1) { - binding = {}; - - //stringify the combo again - subCombo = stringifyKeyCombo([keyCombo[kI]]); - - //validate the sub combo - if(typeof subCombo !== 'string') { throw new Error('Failed to bind key combo. The key combo must be string.'); } - - //create the binding - binding.keyCombo = subCombo; - binding.keyDownCallback = []; - binding.keyUpCallback = []; - - //inject the key down and key up callbacks if given - if(keyDownCallback) { binding.keyDownCallback.push(keyDownCallback); } - if(keyUpCallback) { binding.keyUpCallback.push(keyUpCallback); } - - //stash the new binding - bindings.push(binding); - subBindings.push(binding); - } - - //build the binding api - api.clear = clear; - api.on = on; - return api; - - /** - * Clears the binding - */ - function clear() { - var bI; - for(bI = 0; bI < subBindings.length; bI += 1) { - bindings.splice(bindings.indexOf(subBindings[bI]), 1); - } - } - - /** - * Accepts an event name. and any number of callbacks. When the event is - * emitted, all callbacks are executed. Available events are key up and - * key down. - * @param {String} eventName - * @return {Object} subBinding - */ - function on(eventName ) { - var api = {}, callbacks, cI, bI; - - //validate event name - if(typeof eventName !== 'string') { throw new Error('Cannot bind callback. The event name must be a string.'); } - if(eventName !== 'keyup' && eventName !== 'keydown') { throw new Error('Cannot bind callback. The event name must be a "keyup" or "keydown".'); } - - //gather the callbacks - callbacks = Array.prototype.slice.apply(arguments, [1]); - - //stash each the new binding - for(cI = 0; cI < callbacks.length; cI += 1) { - if(typeof callbacks[cI] === 'function') { - if(eventName === 'keyup') { - for(bI = 0; bI < subBindings.length; bI += 1) { - subBindings[bI].keyUpCallback.push(callbacks[cI]); - } - } else if(eventName === 'keydown') { - for(bI = 0; bI < subBindings.length; bI += 1) { - subBindings[bI].keyDownCallback.push(callbacks[cI]); - } - } - } - } - - //construct and return the sub binding api - api.clear = clear; - return api; - - /** - * Clears the binding - */ - function clear() { - var cI, bI; - for(cI = 0; cI < callbacks.length; cI += 1) { - if(typeof callbacks[cI] === 'function') { - if(eventName === 'keyup') { - for(bI = 0; bI < subBindings.length; bI += 1) { - subBindings[bI].keyUpCallback.splice(subBindings[bI].keyUpCallback.indexOf(callbacks[cI]), 1); - } - } else { - for(bI = 0; bI < subBindings.length; bI += 1) { - subBindings[bI].keyDownCallback.splice(subBindings[bI].keyDownCallback.indexOf(callbacks[cI]), 1); - } - } - } - } - } - } - } - - /** - * Clears all binding attached to a given key combo. Key name order does not - * matter as long as the key combos equate. - * @param {String} keyCombo - */ - function removeBindingByKeyCombo(keyCombo) { - var bI, binding, keyName; - for(bI = 0; bI < bindings.length; bI += 1) { - binding = bindings[bI]; - if(compareCombos(keyCombo, binding.keyCombo)) { - bindings.splice(bI, 1); bI -= 1; - } - } - } - - /** - * Clears all binding attached to key combos containing a given key name. - * @param {String} keyName - */ - function removeBindingByKeyName(keyName) { - var bI, kI, binding; - if(keyName) { - for(bI = 0; bI < bindings.length; bI += 1) { - binding = bindings[bI]; - for(kI = 0; kI < binding.keyCombo.length; kI += 1) { - if(binding.keyCombo[kI].indexOf(keyName) > -1) { - bindings.splice(bI, 1); bI -= 1; - break; - } - } - } - } else { - bindings = []; - } - } - - /** - * Executes bindings that are active. Only allows the keys to be used once - * as to prevent binding overlap. - * @param {KeyboardEvent} event The keyboard event. - */ - function executeBindings(event) { - var bI, sBI, binding, bindingKeys, remainingKeys, cI, killEventBubble, kI, bindingKeysSatisfied, - index, sortedBindings = [], bindingWeight; - - remainingKeys = [].concat(activeKeys); - for(bI = 0; bI < bindings.length; bI += 1) { - bindingWeight = extractComboKeys(bindings[bI].keyCombo).length; - if(!sortedBindings[bindingWeight]) { sortedBindings[bindingWeight] = []; } - sortedBindings[bindingWeight].push(bindings[bI]); - } - for(sBI = sortedBindings.length - 1; sBI >= 0; sBI -= 1) { - if(!sortedBindings[sBI]) { continue; } - for(bI = 0; bI < sortedBindings[sBI].length; bI += 1) { - binding = sortedBindings[sBI][bI]; - bindingKeys = extractComboKeys(binding.keyCombo); - bindingKeysSatisfied = true; - for(kI = 0; kI < bindingKeys.length; kI += 1) { - if(remainingKeys.indexOf(bindingKeys[kI]) === -1) { - bindingKeysSatisfied = false; - break; - } - } - if(bindingKeysSatisfied && isSatisfiedCombo(binding.keyCombo)) { - activeBindings.push(binding); - for(kI = 0; kI < bindingKeys.length; kI += 1) { - index = remainingKeys.indexOf(bindingKeys[kI]); - if(index > -1) { - remainingKeys.splice(index, 1); - kI -= 1; - } - } - for(cI = 0; cI < binding.keyDownCallback.length; cI += 1) { - if (binding.keyDownCallback[cI](event, getActiveKeys(), binding.keyCombo) === false) { - killEventBubble = true; - } - } - if(killEventBubble === true) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - /** - * Removes bindings that are no longer satisfied by the active keys. Also - * fires the key up callbacks. - * @param {KeyboardEvent} event - */ - function pruneBindings(event) { - var bI, cI, binding, killEventBubble; - for(bI = 0; bI < activeBindings.length; bI += 1) { - binding = activeBindings[bI]; - if(isSatisfiedCombo(binding.keyCombo) === false) { - for(cI = 0; cI < binding.keyUpCallback.length; cI += 1) { - if (binding.keyUpCallback[cI](event, getActiveKeys(), binding.keyCombo) === false) { - killEventBubble = true; - } - } - if(killEventBubble === true) { - event.preventDefault(); - event.stopPropagation(); - } - activeBindings.splice(bI, 1); - bI -= 1; - } - } - } - - - /////////////////// - // COMBO STRINGS // - /////////////////// - - /** - * Compares two key combos returning true when they are functionally - * equivalent. - * @param {String} keyComboArrayA keyCombo A key combo string or array. - * @param {String} keyComboArrayB keyCombo A key combo string or array. - * @return {Boolean} - */ - function compareCombos(keyComboArrayA, keyComboArrayB) { - var cI, sI, kI; - keyComboArrayA = parseKeyCombo(keyComboArrayA); - keyComboArrayB = parseKeyCombo(keyComboArrayB); - if(keyComboArrayA.length !== keyComboArrayB.length) { return false; } - for(cI = 0; cI < keyComboArrayA.length; cI += 1) { - if(keyComboArrayA[cI].length !== keyComboArrayB[cI].length) { return false; } - for(sI = 0; sI < keyComboArrayA[cI].length; sI += 1) { - if(keyComboArrayA[cI][sI].length !== keyComboArrayB[cI][sI].length) { return false; } - for(kI = 0; kI < keyComboArrayA[cI][sI].length; kI += 1) { - if(keyComboArrayB[cI][sI].indexOf(keyComboArrayA[cI][sI][kI]) === -1) { return false; } - } - } - } - return true; - } - - /** - * Checks to see if a key combo string or key array is satisfied by the - * currently active keys. It does not take into account spent keys. - * @param {String} keyCombo A key combo string or array. - * @return {Boolean} - */ - function isSatisfiedCombo(keyCombo) { - var cI, sI, stage, kI, stageOffset = 0, index, comboMatches; - keyCombo = parseKeyCombo(keyCombo); - for(cI = 0; cI < keyCombo.length; cI += 1) { - comboMatches = true; - stageOffset = 0; - for(sI = 0; sI < keyCombo[cI].length; sI += 1) { - stage = [].concat(keyCombo[cI][sI]); - for(kI = stageOffset; kI < activeKeys.length; kI += 1) { - index = stage.indexOf(activeKeys[kI]); - if(index > -1) { - stage.splice(index, 1); - stageOffset = kI; - } - } - if(stage.length !== 0) { comboMatches = false; break; } - } - if(comboMatches) { return true; } - } - return false; - } - - /** - * Accepts a key combo array or string and returns a flat array containing all keys referenced by - * the key combo. - * @param {String} keyCombo A key combo string or array. - * @return {Array} - */ - function extractComboKeys(keyCombo) { - var cI, sI, kI, keys = []; - keyCombo = parseKeyCombo(keyCombo); - for(cI = 0; cI < keyCombo.length; cI += 1) { - for(sI = 0; sI < keyCombo[cI].length; sI += 1) { - keys = keys.concat(keyCombo[cI][sI]); - } - } - return keys; - } - - /** - * Parses a key combo string into a 3 dimensional array. - * - Level 1 - sub combos. - * - Level 2 - combo stages. A stage is a set of key name pairs that must - * be satisfied in the order they are defined. - * - Level 3 - each key name to the stage. - * @param {String|Array} keyCombo A key combo string. - * @return {Array} - */ - function parseKeyCombo(keyCombo) { - var s = keyCombo, i = 0, op = 0, ws = false, nc = false, combos = [], combo = [], stage = [], key = ''; - - if(typeof keyCombo === 'object' && typeof keyCombo.push === 'function') { return keyCombo; } - if(typeof keyCombo !== 'string') { throw new Error('Cannot parse "keyCombo" because its type is "' + (typeof keyCombo) + '". It must be a "string".'); } - - //remove leading whitespace - while(s.charAt(i) === ' ') { i += 1; } - while(true) { - if(s.charAt(i) === ' ') { - //white space & next combo op - while(s.charAt(i) === ' ') { i += 1; } - ws = true; - } else if(s.charAt(i) === ',') { - if(op || nc) { throw new Error('Failed to parse key combo. Unexpected , at character index ' + i + '.'); } - nc = true; - i += 1; - } else if(s.charAt(i) === '+') { - //next key - if(key.length) { stage.push(key); key = ''; } - if(op || nc) { throw new Error('Failed to parse key combo. Unexpected + at character index ' + i + '.'); } - op = true; - i += 1; - } else if(s.charAt(i) === '>') { - //next stage op - if(key.length) { stage.push(key); key = ''; } - if(stage.length) { combo.push(stage); stage = []; } - if(op || nc) { throw new Error('Failed to parse key combo. Unexpected > at character index ' + i + '.'); } - op = true; - i += 1; - } else if(i < s.length - 1 && s.charAt(i) === '!' && (s.charAt(i + 1) === '>' || s.charAt(i + 1) === ',' || s.charAt(i + 1) === '+')) { - key += s.charAt(i + 1); - op = false; - ws = false; - nc = false; - i += 2; - } else if(i < s.length && s.charAt(i) !== '+' && s.charAt(i) !== '>' && s.charAt(i) !== ',' && s.charAt(i) !== ' ') { - //end combo - if(op === false && ws === true || nc === true) { - if(key.length) { stage.push(key); key = ''; } - if(stage.length) { combo.push(stage); stage = []; } - if(combo.length) { combos.push(combo); combo = []; } - } - op = false; - ws = false; - nc = false; - //key - while(i < s.length && s.charAt(i) !== '+' && s.charAt(i) !== '>' && s.charAt(i) !== ',' && s.charAt(i) !== ' ') { - key += s.charAt(i); - i += 1; - } - } else { - //unknown char - i += 1; - continue; - } - //end of combos string - if(i >= s.length) { - if(key.length) { stage.push(key); key = ''; } - if(stage.length) { combo.push(stage); stage = []; } - if(combo.length) { combos.push(combo); combo = []; } - break; - } - } - return combos; - } - - /** - * Stringifys a key combo. - * @param {Array|String} keyComboArray A key combo array. If a key - * combo string is given it will be returned. - * @return {String} - */ - function stringifyKeyCombo(keyComboArray) { - var cI, ccI, output = []; - if(typeof keyComboArray === 'string') { return keyComboArray; } - if(typeof keyComboArray !== 'object' || typeof keyComboArray.push !== 'function') { throw new Error('Cannot stringify key combo.'); } - for(cI = 0; cI < keyComboArray.length; cI += 1) { - output[cI] = []; - for(ccI = 0; ccI < keyComboArray[cI].length; ccI += 1) { - output[cI][ccI] = keyComboArray[cI][ccI].join(' + '); - } - output[cI] = output[cI].join(' > '); - } - return output.join(' '); - } - - - ///////////////// - // ACTIVE KEYS // - ///////////////// - - /** - * Returns the a copy of the active keys array. - * @return {Array} - */ - function getActiveKeys() { - return [].concat(activeKeys); - } - - /** - * Adds a key to the active keys array, but only if it has not already been - * added. - * @param {String} keyName The key name string. - */ - function addActiveKey(keyName) { - if(keyName.match(/\s/)) { throw new Error('Cannot add key name ' + keyName + ' to active keys because it contains whitespace.'); } - if(activeKeys.indexOf(keyName) > -1) { return; } - activeKeys.push(keyName); - } - - /** - * Removes a key from the active keys array. - * @param {String} keyNames The key name string. - */ - function removeActiveKey(keyName) { - var keyCode = getKeyCode(keyName); - if(keyCode === '91' || keyCode === '92') { activeKeys = []; } //remove all key on release of super. - else { activeKeys.splice(activeKeys.indexOf(keyName), 1); } - } - - - ///////////// - // LOCALES // - ///////////// - - /** - * Registers a new locale. This is useful if you would like to add support for a new keyboard layout. It could also be useful for - * alternative key names. For example if you program games you could create a locale for your key mappings. Instead of key 65 mapped - * to 'a' you could map it to 'jump'. - * @param {String} localeName The name of the new locale. - * @param {Object} localeMap The locale map. - */ - function registerLocale(localeName, localeMap) { - - //validate arguments - if(typeof localeName !== 'string') { throw new Error('Cannot register new locale. The locale name must be a string.'); } - if(typeof localeMap !== 'object') { throw new Error('Cannot register ' + localeName + ' locale. The locale map must be an object.'); } - if(typeof localeMap.map !== 'object') { throw new Error('Cannot register ' + localeName + ' locale. The locale map is invalid.'); } - - //stash the locale - if(!localeMap.macros) { localeMap.macros = []; } - locales[localeName] = localeMap; - } - - /** - * Swaps the current locale. - * @param {String} localeName The locale to activate. - * @return {Object} - */ - function getSetLocale(localeName) { - - //if a new locale is given then set it - if(localeName) { - if(typeof localeName !== 'string') { throw new Error('Cannot set locale. The locale name must be a string.'); } - if(!locales[localeName]) { throw new Error('Cannot set locale to ' + localeName + ' because it does not exist. If you would like to submit a ' + localeName + ' locale map for KeyboardJS please submit it at https://github.com/RobertWHurst/KeyboardJS/issues.'); } - - //set the current map and macros - map = locales[localeName].map; - macros = locales[localeName].macros; - - //set the current locale - locale = localeName; - } - - //return the current locale - return locale; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/keyboard.min.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/keyboard.min.js deleted file mode 100644 index 6e81ca7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/keyboard.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(e,b){[].indexOf||(Array.prototype.indexOf=function(g,f,h){for(h=this.length,f=(h+~~f)%h;f"]],["shift + /",["questionmark","?"]]]};for(v=65;v<=90;v+=1){m.map[v]=String.fromCharCode(v+32);m.macros.push(["shift + "+String.fromCharCode(v+32)+", capslock + "+String.fromCharCode(v+32),[String.fromCharCode(v)]])}C("us",m);g("us");f();i.enable=f;i.disable=d;i.activeKeys=L;i.releaseKey=k;i.pressKey=J;i.on=t;i.clear=A;i.clear.key=c;i.locale=g;i.locale.register=C;i.macro=G;i.macro.remove=h;i.key={};i.key.name=I;i.key.code=z;i.combo={};i.combo.active=a;i.combo.parse=q;i.combo.stringify=y;return i;function f(){if(H.addEventListener){H.document.addEventListener("keydown",p,false);H.document.addEventListener("keyup",F,false);H.addEventListener("blur",E,false);H.addEventListener("webkitfullscreenchange",E,false);H.addEventListener("mozfullscreenchange",E,false)}else{if(H.attachEvent){H.document.attachEvent("onkeydown",p);H.document.attachEvent("onkeyup",F);H.attachEvent("onblur",E)}}}function d(){E();if(H.removeEventListener){H.document.removeEventListener("keydown",p,false);H.document.removeEventListener("keyup",F,false);H.removeEventListener("blur",E,false);H.removeEventListener("webkitfullscreenchange",E,false);H.removeEventListener("mozfullscreenchange",E,false)}else{if(H.detachEvent){H.document.detachEvent("onkeydown",p);H.document.detachEvent("onkeyup",F);H.detachEvent("onblur",E)}}}function E(N){l=[];r();j(N)}function p(O){var Q,N,P;Q=I(O.keyCode);if(Q.length<1){return}O.isRepeat=false;for(P=0;P-1){return O}}return false}function G(O,N){if(typeof O!=="string"&&(typeof O!=="object"||typeof O.push!=="function")){throw new Error("Cannot create macro. The combo must be a string or array.")}if(typeof N!=="object"||typeof N.push!=="function"){throw new Error("Cannot create macro. The injectedKeys must be an array.")}B.push([O,N])}function h(O){var N;if(typeof O!=="string"&&(typeof O!=="object"||typeof O.push!=="function")){throw new Error("Cannot remove macro. The combo must be a string or array.")}for(mI=0;mI-1){K.splice(N,1);N-=1;break}}}}else{K=[]}}function b(O){var V,X,U,N,Z,Q,R,T,Y,S,P=[],W;Z=[].concat(l);for(V=0;V=0;X-=1){if(!P[X]){continue}for(V=0;V-1){Z.splice(S,1);T-=1}}for(Q=0;Q-1){Q.splice(P,1);S=T}}if(Q.length!==0){N=false;break}}if(N){return true}}return false}function x(R){var O,N,Q,P=[];R=q(R);for(O=0;O"){if(U.length){R.push(U);U=""}if(R.length){N.push(R);R=[]}if(Q||O){throw new Error("Failed to parse key combo. Unexpected > at character index "+P+".")}Q=true;P+=1}else{if(P"||V.charAt(P+1)===","||V.charAt(P+1)==="+")){U+=V.charAt(P+1);Q=false;S=false;O=false;P+=2}else{if(P"&&V.charAt(P)!==","&&V.charAt(P)!==" "){if(Q===false&&S===true||O===true){if(U.length){R.push(U);U=""}if(R.length){N.push(R);R=[]}if(N.length){W.push(N);N=[]}}Q=false;S=false;O=false;while(P"&&V.charAt(P)!==","&&V.charAt(P)!==" "){U+=V.charAt(P);P+=1}}else{P+=1;continue}}}}}}if(P>=V.length){if(U.length){R.push(U);U=""}if(R.length){N.push(R);R=[]}if(N.length){W.push(N);N=[]}break}}return W}function y(N){var Q,P,O=[];if(typeof N==="string"){return N}if(typeof N!=="object"||typeof N.push!=="function"){throw new Error("Cannot stringify key combo.")}for(Q=0;Q ")}return O.join(" ")}function L(){return[].concat(l)}function J(N){if(N.match(/\s/)){throw new Error("Cannot add key name "+N+" to active keys because it contains whitespace.")}if(l.indexOf(N)>-1){return}l.push(N)}function k(N){var O=z(N);if(O==="91"||O==="92"){l=[]}else{l.splice(l.indexOf(N),1)}}function C(O,N){if(typeof O!=="string"){throw new Error("Cannot register new locale. The locale name must be a string.")}if(typeof N!=="object"){throw new Error("Cannot register "+O+" locale. The locale map must be an object.")}if(typeof N.map!=="object"){throw new Error("Cannot register "+O+" locale. The locale map is invalid.")}if(!N.macros){N.macros=[]}w[O]=N}function g(N){if(N){if(typeof N!=="string"){throw new Error("Cannot set locale. The locale name must be a string.")}if(!w[N]){throw new Error("Cannot set locale to "+N+" because it does not exist. If you would like to submit a "+N+" locale map for KeyboardJS please submit it at https://github.com/RobertWHurst/KeyboardJS/issues.")}u=w[N].map;B=w[N].macros;o=N}return o}}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/utils.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/utils.js deleted file mode 100644 index a6f3881..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/utils.js +++ /dev/null @@ -1,1620 +0,0 @@ -/** - * @author Riccardo Strobbia - * @version 1.4 - * @revision 18/01/2016 17:08 - */ -//Backbone.Model Overrides - -window.Toolset = window.Toolset || {}; - -//Backbone.View Overrides -if (Backbone && Backbone.View) { - Backbone.View.prototype.eventDispatcher = _.extend({}, Backbone.Events); -} - - -if (typeof WPV_Toolset == 'undefined') { - var WPV_Toolset = {}; - WPV_Toolset.message = {}; - WPV_Toolset.message.container = null; -} - -if (typeof WPV_Toolset.Utils == 'undefined') WPV_Toolset.Utils = {}; - -WPV_Toolset.Utils.eventDispatcher = _.extend({}, Backbone.Events); - -WPV_Toolset.Utils.restoreEventPropagation = function (event) { - if (jQuery.browser.mozilla) { - return event; - } - if (event.isImmediatePropagationStopped() === false && event.isPropagationStopped() === false) { - return event; - } - - if (typeof event.originalEvent === undefined) { - return event; - } - - var refEvent = event.originalEvent; - - try { - refEvent.cancelBubble = false; - refEvent.defaultPrevented = false; - refEvent.returnValue = true; - refEvent.timeStamp = ( new Date() ).getTime(); - } catch (e) { - // console.log(e.message ); - return event; - } - - - if (event.target.dispatchEvent) { - - try { - event.target.dispatchEvent(refEvent); - } catch (e) { - - return; - } - } else if (event.target.fireEvent) { - - event.target.fireEvent(refEvent); - } - - return refEvent; -}; - -WPV_Toolset.Utils.do_ajax_post = function (params, callback_object) { - jQuery.post(ajaxurl, params, function (response) { - - if ((typeof(response) !== 'undefined') && response !== null && ( response.message || response.Data || response.data )) { - - if (callback_object && callback_object.success && typeof callback_object.success == 'function') - callback_object.success.call(this, response, params); - WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_success_' + params.action, response, params); - } - else if ((typeof(response) !== 'undefined') && response !== null && response.error) { - - if (callback_object && callback_object.error && typeof callback_object.error == 'function') - callback_object.error.call(this, response, params); - WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_error_' + params.action, response, params); - } - }, 'json') - .fail(function (jqXHR, textStatus, errorThrown) { - console.log('Ajax call failed', textStatus, errorThrown) - if (callback_object && callback_object.fail && typeof callback_object.fail == 'function') - callback_object.fail.call(this, errorThrown); - WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_fail_' + params.action, textStatus, errorThrown, params); - }) - .always(function () { - //console.log( arguments ); - if (callback_object && callback_object.always && typeof callback_object.always == 'function') - callback_object.always.call(this, arguments); - WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_complete_' + params.action, arguments, params); - }); -}; - -;(function ($, window, document, undefined) { - - // Create the defaults once - var pluginName = "wpvToolsetMessage", - dataPlugin = "plugin_" + pluginName, - defaults = { - text: "Enter a customized text to be displayed", - type: '', - inline: false, - position: "after", - header: false, - headerText: false, - close: false, - use_this: true, - fadeIn: 100, - fadeOut: 100, - stay: false, - onClose: false, - onOpen: false, - onDestroy: false, - dontShowAgain: null, - dontShowAgainText: '', - args: [], - referTo: null, - offestX: -20, - offsetY: 0, - classname: '', - stay_for: 1200, // Ignored when 'msPerCharacter is given. - msPerCharacter: 50 // Ignered when 'stay_for' is given. This value is multiplied by the number of defaults.text characters count. - }, - has_stay = false, - is_open = false, - prev = null, - prev_text = ''; - - // The actual plugin constructor - function Plugin(element, options) { - var self = this; - - self.container = $(element); - - self.prms = $.extend({}, defaults, options); - self._defaults = defaults; - self._name = pluginName; - - self.box = null; - self.header = null; - self.remove = null; - self.tag = self.prms.inline ? 'span' : 'p'; - self.bool = false; - - if (typeof (options.stay_for) === 'undefined' && typeof(self.prms.msPerCharacter) === 'number') { // If stay_for parameter wasn't passes when the plugin wass called AND msPerCharacter has correct type - self.prms.stay_for = self.prms.text.length * self.prms.msPerCharacter; - } - - } - - Plugin.prototype = { - init: function () { - var self = this; - - if (self.container.data('has_message')) { - self.destroy(); - } - - if (self.container.children().length > 0) { - self.container.children().each(function (i) { - if ($(this).text() == self.prms.text) { - self.bool = true; - } - }); - } - - if (self.bool) return; - - if (has_stay) { - if (prev) { - var rem = prev; - prev = null; - has_stay = false; - is_open = false; - rem.fadeTo(0, 0, function () { - rem.remove(); - rem = null; - }); - } - } - - if (self.prms.header && self.prms.headerText) { - self.box = $('
                '); - self.header = $('

                '); - self.box.append(self.header); - self.header.text(self.prms.headerText); - self.box.append('<' + self.tag + '>'); - self.box.find(self.tag).html(self.prms.text); - } - else { - self.box = $('<' + self.tag + ' class="toolset-alert toolset-alert-' + self.prms.type + ' ' + self.prms.classname + '" />'); - self.box.html(self.prms.text); - } - - if (self.prms.dontShowAgain && typeof self.prms.dontShowAgain === 'function' && self.prms.dontShowAgainText !== '') { - self.$dontContainer = $('') - self.$dont_show = $(''); - self.$dont_label = $(''); - self.$dont_label.text(self.prms.dontShowAgainText); - self.$dontContainer.append(self.$dont_show, self.$dont_label); - self.box.append(self.$dontContainer); - - self.prms.dontShowAgain.call(self.$dont_show, self, self.prms.args); - } - - if (self.prms.close) { - self.remove = $(''); - self.box.append(self.remove); - self.remove.on('click', function (event) { - self.wpvMessageRemove(); - }); - } - - - //if( is_open ) self.wpvMessageRemove(); - if (self.prms.position == 'before') { - self.container.prepend(self.box); - } else { - self.container.append(self.box); - } - self.container.data('has_message', true); - self.box.hide(); - - if (null !== self.prms.referTo) { - self.box.css({ - "position": "absolute", - "z-index": 10000, - "top": self.prms.referTo.position().top + self.prms.offestY + "px", - "left": self.prms.referTo.position().left + self.prms.referTo.width() + self.prms.offestX + "px" - }); - } - - self.container.data('message-box', self.box); - - self.box.fadeTo(null != prev ? 0 : self.prms.fadeIn, 1, function () { - $(this).trigger('wpv-message-open'); - prev = $(this); - prev_text = self.prms.text; - is_open = true; - if (self.prms.onOpen && typeof self.prms.onOpen == 'function') { - self.prms.onOpen.apply(self, self.prms.args); - } - if (self.prms.stay) { - has_stay = true; - } - else { - var remove_message = _.bind(self.wpvMessageRemove, self); - _.delay(remove_message, self.prms.stay_for); - //self.wpvMessageRemove(); - } - }); - - return self; - }, - wpvMessageRemove: function () { - - var self = this; - - if (self.box || self.container.data('message-box')) { - var box = self.box || self.container.data('message-box'); - - box.fadeTo(self.prms.fadeOut, 0, function () { - $(this).trigger('wpv-message-remove'); - is_open = false; - prev = null; - prev_text = ''; - has_stay = false; - if (self.prms.onClose && typeof self.prms.onClose == 'function') { - self.prms.onClose.apply(self, self.prms.args); - } - - $(this).remove(); - self.container.data('has_message', false); - self.container.data('message-box', null); - self.box = null; - }); - } - - return self; - }, - destroy: function () { - $(this).trigger('wpv-message-remove'); - this.container.empty(); - if (this.prms.onDestroy && typeof this.prms.onDestroy == 'function') { - this.prms.onDestroy.apply(this, this.prms.args); - } - this.box = null; - this.container.data('message-box', null); - this.container.data('has_message', false); - }, - has_message: function () { - return this.container.data('has_message'); - } - }; - - - $.fn[pluginName] = function (arg) { - - return this.each(function () { - var args, instance; - - if (!( $(this).data(dataPlugin) instanceof Plugin )) { - // if no instance, create one - $(this).data(dataPlugin, new Plugin($(this), arg)); - } - // do not use this one if you want the plugin to be a singleton bound to the DOM element - else { - // if instance delete reference and do another one - $(this).data(dataPlugin, null); - $(this).data(dataPlugin, new Plugin($(this), arg)); - } - - instance = $(this).data(dataPlugin); - - instance.element = $(this); - - // call Plugin.init( arg ) - if (typeof arg === 'undefined' || typeof arg === 'object') { - - if (typeof instance['init'] === 'function') { - instance.init(arg); - } - - // checks that the requested public method exists - } else if (typeof arg === 'string' && typeof instance[arg] === 'function') { - - // copy arguments & remove function name - args = Array.prototype.slice.call(arguments, 1); - - // call the method - return instance[arg].apply(instance, args); - - } else { - - $.error('Method ' + arg + ' does not exist on jQuery.' + pluginName); - - } - }); - }; -})(jQuery, window, document); - -jQuery(function ($) { - $.each($('.js-show-toolset-message:not(.js-show-toolset-message-inited)'), function () { - $(this) - .addClass('js-show-toolset-message-inited') - .show() - .wpvToolsetHelp(); - }); -}); - -if (typeof jQuery.fn.wpvToolsetHelp === 'undefined') { - - /* Help messages */ - (function ($) { - - $.fn.wpvToolsetHelp = function (options) { - - var thiz = this; - - var $container = this; - var prms = $.extend({ - content: ( thiz.contents().length !== 0 ) ? thiz.contents() : "Enter a customized text to be displayed", - tutorialButtonText: ( typeof(thiz.data('tutorial-button-text')) !== 'undefined' ) ? thiz.data('tutorial-button-text') : null, - tutorialButtonURL: ( typeof(thiz.data('tutorial-button-url')) !== 'undefined' ) ? thiz.data('tutorial-button-url') : null, - linkText: ( typeof(thiz.data('link-text')) !== 'undefined' ) ? thiz.data('link-text') : null, - linkURL: ( typeof(thiz.data('link-url')) !== 'undefined' ) ? thiz.data('link-url') : null, - footer: ( typeof(thiz.data('footer')) !== 'undefined' ) ? thiz.data('footer') : false, - classname: ( typeof(thiz.data('classname')) !== 'undefined' ) ? thiz.data('classname') : '', - close: ( typeof(thiz.data('close')) !== 'undefined' ) ? thiz.data('close') : true, - hidden: ( typeof(thiz.data('hidden')) !== 'undefined' ) ? thiz.data('hidden') : false, - onClose: false, - args: [] - }, options); - - if ($.type(prms.content) === 'string') { - prms.content = $('

                ' + prms.content + '

                '); - } - - var $box = $('
                '); - - var $footer = $(''); - - if (prms.footer === true) { - $footer.appendTo($box); - } - - prms.content.appendTo($box.find('.toolset-help-content')); - - this.wpvHelpRemove = function () { - if ($box) - $box.fadeOut('fast', function () { - // $(this).remove(); - if (prms.onClose && typeof prms.onClose === 'function') { - prms.onClose.apply($container, prms.args); - } - }); - return this; - }; - - if ((prms.tutorialButtonText && prms.tutorialButtonURL) || (prms.linkText && prms.linkURL)) { - var $toolbar = $('

                '); - $toolbar.appendTo($box.find('.toolset-help-content')); - if (prms.tutorialButtonText && prms.tutorialButtonURL) { - $('' + prms.tutorialButtonText + '').appendTo($toolbar); - } - if (prms.linkText && prms.linkURL) { - $('' + prms.linkText + '').appendTo($toolbar); - } - } - - if (prms.close === true) { - $('').appendTo($box); - } - - // bind close event to all close buttons - var $closeButtons = $box.find('.js-toolset-help-close'); - if ($closeButtons.length !== 0) { - $closeButtons.on('click', function () { - $container.wpvHelpRemove(); - }); - } - - $box.appendTo($container).hide(); - if ($container.hasClass('js-show-toolset-message')) { - $box.unwrap(); - } - if (prms.hidden === false) { - $box.fadeIn('fast'); - } - - return this; - }; - - })(jQuery); - -} - -(function ($) { - $.fn.insertAtIndex = function (index, selector) { - var opts = $.extend({ - index: 0, - selector: '
                ' - }, {index: index, selector: selector}); - return this.each(function () { - var p = $(this); - var i = ($.isNumeric(opts.index) ? parseInt(opts.index, 10) : 0); - if (i <= 0) - p.prepend(opts.selector); - else if (i > p.children().length - 1) - p.append(opts.selector); - else - p.children().eq(i).before(opts.selector); - }); - }; -})(jQuery); - -(function ($) { - - $.fn.loaderOverlay = function (action, options) - // action: 'show'|'hide' attributes are optional. - // options: fadeInSpeed, fadeOutSpeed, displayOverlay, class. attributes are optional - { - - var defaults = { - fadeInSpeed: 'fast', - fadeOutSpeed: 'fast', - displayLoader: true, - css: { - "opacity": "0.4" - }, - class: null - }; - - var prms = $.extend(defaults, options); - var $overlayContainer = this; - var $overlayEl = $('
                '); - - var showOverlay = function () { - if (!$overlayContainer.data('has-overlay')) { - $overlayEl - .appendTo($overlayContainer) - .css(prms.css) - .hide() - .fadeIn(prms.fadeInSpeed, function () { - $overlayContainer.data('has-overlay', true); - $overlayContainer.data('overlay-el', $overlayEl); - if (_.isObject(options) && typeof options.onOpen === 'function') { - options.onOpen.call(this, arguments); - } - }); - } - }; - - var hideOverlay = function () { - if ($overlayContainer.data('has-overlay')) { - $overlayContainer.data('overlay-el') - .fadeOut(prms.fadeOutSpeed, function () { - $overlayEl.detach().remove(); - $overlayContainer.data('has-overlay', false); - if (options && typeof options.onRemove === 'function') { - options.onRemove.call(this, arguments); - } - }); - } - }; - - if (prms.class !== null) { - $overlayEl.addClass(prms.class); - } - if (prms.displayLoader) { - $('
                ').appendTo($overlayEl); - } - - if (typeof(action) !== 'undefined') { // When 'action' parameter is given - - if (action === 'show') { - showOverlay(); - } - else if (action === 'hide') { - hideOverlay(); - } - - } - else { // when the method is called without 'action' parameter - - if ($overlayContainer.data('has-overlay')) { // hide overlay if it's displayed - hideOverlay(); - } - else { // show overlay if not - showOverlay(); - } - - } - - return this; - }; - -})(jQuery); - -(function ($) { - /* - Basic usage: - $element.ddlWpPointer(); // will show a pointer if it's hidden OR hide a pointer if it's shown - - 1. $element have to be valid jQuery selector - 2. data-toolipt-header HTML attribute is required to display the header - 3. data-tooltip-content HTML attribute is required to display the content - - Customization: - $element.ddlWpPointer('action', // action: 'show' | 'hide' - { - content: $element // $element have to be valid jQuery selector content element should contain H3 for the header and P for the content. Example:

                Header

                Content

                - edge: 'left' // 'left' | 'right' | 'top' | 'bottom' - align: 'center' // 'center' | 'right' | 'left' - offset: 'x y' // example: '0 15' - }) - - */ - $.fn.ddlWpPointer = function (action, options) { - var $el = this; - - //$.jStorage.flush(); - - var defaults = { - headerText: function () { - var header = $el.data('tooltip-header'); - if (header) { - return header; - } - else { - return 'use data-tooltip-header="header text" attribute to create a header'; - } - }, - contentText: function () { - var content = $el.data('tooltip-content'); - if (content) { - return content; - } - else { - return 'use data-tooltip-content="content text" attribute to create a content'; - } - }, - content: function () { // returns string by default (data-tooltip-header and data-tooltip-content attibutes), but can be overridden by jQuery obj - return '

                ' + defaults.headerText() + '

                ' + defaults.contentText() + '

                '; - }, - edge: 'left', - align: 'center', - offset: '0 0', - stay_hidden: false - }; - - var prms = $.extend(defaults, options); - - var showPointer = function () { - - if (!$el.data('has-wppointer')) { - - if( typeof prms.onOpen === 'function' ){ - prms.onOpen.call( this, arguments ); - } - - $el - .pointer({ - content: function () { - return prms.content; - }, - pointerClass: 'wp-toolset-pointer wp-toolset-layouts-pointer', - position: { - edge: prms.edge, - align: prms.align, - offset: prms.offset - }, - close: function () { - - $el.data('has-wppointer', false); - $el.trigger('help_tooltip_closes', options); - } - }) - .pointer('open'); - - $el.data('has-wppointer', true); - - if( typeof prms.onComplete === 'function' ){ - prms.onComplete.call( this, arguments ); - } - - } - }; - - var hidePointer = function () { - - if ($el.data('has-wppointer')) { - - if( typeof prms.onClose === 'function' ){ - prms.onClose.call( this, arguments ); - } - - $el.pointer('close'); - $el.data('has-wppointer', false); - - } - }; - - if (typeof(action) !== 'undefined') { // When 'action' parameter is given - - if (action === 'show' && prms.stay_hidden !== true) { - showPointer(); - } - else if (action === 'hide') { - hidePointer(); - } - - } - else { // when the method is called without 'action' parameter - - if ($el.data('has-wppointer')) { // hide pointer if it's displayed - hidePointer(); - } - else if (prms.stay_hidden !== true) { // show it if not - showPointer(); - } - - } - - return this; - }; - -})(jQuery); - -WPV_Toolset.Utils.Loader = function () { - //fake comment - var self = this; - - self.loading = false; - self.el = null; - - self.loader = jQuery('
                '); - - self.loadShow = function (el, after) { - self.el = el; - self.loading = true; - - if (typeof after === 'undefined') { - self.loader.prependTo(self.el).css('visibility', 'visible').show(); - } - else { - self.loader.insertAfter(self.el).css('visibility', 'visible').show(); - } - - return self.loader; - }; - self.loadHide = function () { - var $completeFlag = jQuery('') - - _.each(self.loader[0].attributes, function (attribute) { - if (attribute.name === 'style') { - $completeFlag.attr(attribute.name, attribute.value); - } - }); - - var adjustPosition = function( positionName, position ) { - position = parseInt(position); - - if (position < 0) { - $completeFlag.css(positionName, ''); - } else { - position += 8; - $completeFlag.css(positionName, position.toString() + 'px'); - } - }; - - adjustPosition( 'left', self.loader.css('left') ); - adjustPosition( 'right', self.loader.css('right') ); - - self.loader = $completeFlag.replaceAll(self.loader).css({ - color: 'green', - fontSize: '22px' - }); - - self.loader.fadeOut(1800, function () { - self.loader = jQuery('
                ').replaceAll( jQuery(this) ); - self.loading = false; - self.loader.remove(); - jQuery(this).remove(); - }); - - return self.loader; - }; -}; - -if (typeof _ != 'undefined') { - WPV_Toolset.Utils.flatten = function (x, result, prefix) { - if (_.isObject(x)) { - _.each(x, function (v, k) { - WPV_Toolset.Utils.flatten(v, result, prefix ? prefix + '_' + k : k) - }) - } else { - result[prefix] = x - } - return result - }; - WPV_Toolset.Utils.flatten_filter_by_key = function (x, result, prefix, filter) { - var res = [], - find = WPV_Toolset.Utils.flatten(x, result, prefix); - - if (!filter) return _.values(find); - - _.each(find, function (element, index, list) { - if (index.indexOf(prefix ? prefix + '_' + filter : filter) !== -1 || filter === index) - res.push(element); - }); - - return res; - } - WPV_Toolset.Utils.containsObject = function (obj, list) { - var res = _.find(list, function (val) { - return _.isEqual(obj, val); - }); - return (_.isObject(res)) ? true : false; - }; -} -; - - -(function ($) { - $.fn.textWidth = function () { - var text = this.html() || this.text() || this.val(); - return ( $.textWidth(text) ); - }; - $.textWidth = function (text) { - var div = $('#textWidth'); - if (div.length === 0) - div = $('').appendTo($('body')); - div.html(text); - return (div.width()); - }; -})(jQuery); - -//Courtesy from http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery -WPV_Toolset.Utils.escapeHtml = function (str) { - if (typeof(str) == "string") { - try { - var newStr = ""; - var nextCode = 0; - for (var i = 0; i < str.length; i++) { - nextCode = str.charCodeAt(i); - if (nextCode > 0 && nextCode < 128) { - newStr += "&#" + nextCode + ";"; - } - else { - newStr += "?"; - } - } - return newStr; - } - catch (err) { - } - } - else { - return str; - } -}; - -WPV_Toolset.Utils.editor_decode64 = function (input) { - var output = "", - chr1, chr2, chr3 = "", - enc1, enc2, enc3, enc4 = "", - i = 0, - keyStr = "ABCDEFGHIJKLMNOP" + - "QRSTUVWXYZabcdef" + - "ghijklmnopqrstuv" + - "wxyz0123456789+/" + - "="; - - // remove all characters that are not A-Z, a-z, 0-9, +, /, or = - var base64test = /[^A-Za-z0-9\+\/\=]/g; - if (base64test.exec(input)) { - alert("There were invalid base64 characters in the input text.\n" + - "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" + - "Expect errors in decoding."); - } - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - - do { - enc1 = keyStr.indexOf(input.charAt(i++)); - enc2 = keyStr.indexOf(input.charAt(i++)); - enc3 = keyStr.indexOf(input.charAt(i++)); - enc4 = keyStr.indexOf(input.charAt(i++)); - - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - - output = output + String.fromCharCode(chr1); - - if (enc3 != 64) { - output = output + String.fromCharCode(chr2); - } - if (enc4 != 64) { - output = output + String.fromCharCode(chr3); - } - - chr1 = chr2 = chr3 = ""; - enc1 = enc2 = enc3 = enc4 = ""; - - } while (i < input.length); - - return WPV_Toolset.Utils.editor_utf8_decode(output); -}; - -WPV_Toolset.Utils.editor_utf8_decode = function (utftext) { - var string = ""; - var i = 0; - var c = c1 = c2 = 0; - - while (i < utftext.length) { - - c = utftext.charCodeAt(i); - - if (c < 128) { - string += String.fromCharCode(c); - i++; - } - else if ((c > 191) && (c < 224)) { - c2 = utftext.charCodeAt(i + 1); - string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - i += 2; - } - else { - c2 = utftext.charCodeAt(i + 1); - c3 = utftext.charCodeAt(i + 2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - i += 3; - } - - } - - return string; -}; - -// convert unicode character to its corresponding numeric entity -WPV_Toolset.Utils.fixedCharCodeAt = function (str, idx) { - // ex. fixedCharCodeAt ('\uD800\uDC00', 0); // 65536 - // ex. fixedCharCodeAt ('\uD800\uDC00', 1); // 65536 - idx = idx || 0; - var code = str.charCodeAt(idx); - var hi, low; - if (0xD800 <= code && code <= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters) - hi = code; - low = str.charCodeAt(idx + 1); - if (isNaN(low)) { - throw 'High surrogate not followed by low surrogate in fixedCharCodeAt()'; - } - return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000; - } - if (0xDC00 <= code && code <= 0xDFFF) { // Low surrogate - // We return false to allow loops to skip this iteration since should have already handled high surrogate above in the previous iteration - return false; - /*hi = str.charCodeAt(idx-1); - low = code; - return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;*/ - } - return code; -}; - -WPV_Toolset.replace_unicode_characters = function (string) { - // remove accents, swap ñ for n, etc - var from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;", - to = "aaaaaeeeeeiiiiooooouuuunc------"; - for (var i = 0, l = from.length; i < l; i++) { - string = string.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); - } - - var unicode = '!£$%&()=?^|#§'; - - for (var i = 0; i < unicode.length; i++) { - string = string.replace(new RegExp(unicode.charAt(i).regexEscape(), 'g'), WPV_Toolset.Utils.fixedCharCodeAt(unicode.charAt(i))); - } - - return string; -}; - -// escapes regex characters for use in regex constructor -String.prototype.regexEscape = function regexEscape() { - return this.replace(/[\.\?\+\*\^\$\|\(\{\[\]\\)]/g, '\\$&'); -}; - -// THE TOOLTIP // -; -(function ($, window, document, undefined) { - - // Create the defaults once - var pluginName = "toolsetTooltip", - dataPlugin = "plugin_" + pluginName, - undefined, - defaults = { - top: undefined, - text: '', - close: null, - open: null, - additionalClass: '' - }; - - // The actual plugin constructor - function Plugin(element, options) { - - this.$element = element; - this.settings = $.extend({}, defaults, options); - this._defaults = defaults; - this._name = pluginName; - this._remove_tooltip = null; - } - - // Avoid Plugin.prototype conflicts - $.extend(Plugin.prototype, { - init: function () { - var self = this; - this.$element.on('mouseenter', function (event) { - event.stopImmediatePropagation(); - self.show(event); - jQuery(event.target).trigger('tooltip_show', event); - }); - this.$element.on('mouseleave', function (event) { - event.stopImmediatePropagation(); - self.hide(event); - jQuery(event.target).trigger('tooltip_hide', event); - }); - }, - show: function (event) { - var self = this, - $tooltip = $('
                '), - offset = self.$element.offset(), - offset_top = typeof self.settings.top === 'undefined' ? 20 : self.settings.top; - - if (this.settings.additionalClass) { - $tooltip.addClass(this.settings.additionalClass); - } - - self._remove_tooltip = $tooltip; - - $tooltip - .appendTo('body') - .text(this.settings.text || self.$element.data('tooltip-text')) - .css({ - 'top': offset.top - $tooltip.height() - offset_top, - 'left': offset.left - ($tooltip.outerWidth() / 2) + (self.$element.outerWidth() / 2), - 'zIndex': '9999999' - }) - .fadeIn(100); - - // Probably $elem doesn't is removed before 'click' event takes place - // So we need to call _manageCellTooltip( $elem, 'hide') somewhere... but i don't know where ;) - - self.$element.on('mousedown', function () { - - if (self._remove_tooltip) { - self._remove_tooltip.remove(); - self._remove_tooltip = null; - } - }); - - if (self.settings.open !== null && self.settings.open instanceof Function) { - self.settings.open.call(self); - } - - return $tooltip; - }, - hide: function (event) { - var self = this; - - if (self._remove_tooltip) { - if (self.settings.close !== null && self.settings.close instanceof Function) { - self.settings.close.call(self); - } - self._remove_tooltip.remove(); - self._remove_tooltip = null; - } - } - }); - - $.fn[pluginName] = function (arg) { - - return this.each(function () { - var args, instance; - - if (!( $(this).data(dataPlugin) instanceof Plugin )) { - // if no instance, create one - $(this).data(dataPlugin, new Plugin($(this), arg)); - } - - instance = $(this).data(dataPlugin); - instance.element = $(this); - - // call Plugin.init( arg ) - if (typeof arg === 'undefined' || typeof arg === 'object') { - - if (typeof instance['init'] === 'function') { - instance.init(arg); - } - - // checks that the requested public method exists - } else if (typeof arg === 'string' && typeof instance[arg] === 'function') { - - // copy arguments & remove function name - args = Array.prototype.slice.call(arguments, 1); - - // call the method - return instance[arg].apply(instance, args); - - } else { - - $.error('Method ' + arg + ' does not exist on jQuery.' + pluginName); - - } - }); - }; - -})(jQuery, window, document); - -;(function ($, window, document, undefined) { - /* - - highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !! - - Highlights arbitrary terms. - - - - MIT license. - - Johann Burkard - - - - */ - var defaults = { - className: 'highlighted' - }, - options = {}; - - jQuery.fn.highlight = function (pat, option) { - - options = jQuery.extend(options, defaults, option) - - function innerHighlight(node, pat) { - var skip = 0; - - if (node.nodeType == 3) { - var pos = node.data.toUpperCase().indexOf(pat); - if (pos >= 0) { - var spannode = document.createElement('span'); - spannode.className = options.className; - var middlebit = node.splitText(pos); - var endbit = middlebit.splitText(pat.length); - var middleclone = middlebit.cloneNode(true); - spannode.appendChild(middleclone); - middlebit.parentNode.replaceChild(spannode, middlebit); - skip = 1; - } - } - else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) { - for (var i = 0; i < node.childNodes.length; ++i) { - i += innerHighlight(node.childNodes[i], pat); - } - } - return skip; - } - - return this.each(function () { - innerHighlight(this, pat.toUpperCase()); - }); - }; - - jQuery.fn.removeHighlight = function () { - function newNormalize(node) { - for (var i = 0, children = node.childNodes, nodeCount = children.length; i < nodeCount; i++) { - var child = children[i]; - if (child.nodeType == 1) { - newNormalize(child); - continue; - } - if (child.nodeType != 3) { - continue; - } - var next = child.nextSibling; - if (next == null || next.nodeType != 3) { - continue; - } - var combined_text = child.nodeValue + next.nodeValue; - new_node = node.ownerDocument.createTextNode(combined_text); - node.insertBefore(new_node, child); - node.removeChild(child); - node.removeChild(next); - i--; - nodeCount--; - } - } - - return this.find("span." + options.className).each(function () { - var thisParent = this.parentNode; - thisParent.replaceChild(this.firstChild, this); - newNormalize(thisParent); - }).end(); - }; - -}(jQuery, window, document)); - -var waitForFinalEvent = (function () { - var timers = {}; - return function (callback, ms, uniqueId) { - if (!uniqueId) { - uniqueId = "Don't call this twice without a uniqueId"; - } - if (timers[uniqueId]) { - clearTimeout(timers[uniqueId]); - } - - timers[uniqueId] = setTimeout(callback, ms); - }; -})(); - - -WPV_Toolset.Utils._strip_scripts = function (data) { - - if (!data) return ''; - - if (_.isString(data) === false) return ''; - - data = data.replace(/</g, "|-lt-|"); - data = data.replace(/>/g, "|-gt-|"); - data = data.replace(/&(\w+);/g, "&$1;"); // Preserve entities (rafael.v) - - var out = data.replace(/<.*?script.*?>.*?<\/.*?script.*?>/igm, ""); - out = out.replace(/</g, "<"); - out = out.replace(/>/g, ">"); - out = out.replace(/&(\w+);/g, "&$1;"); // Preserve entities (rafael.v) - out = out.replace(/\|-lt-\|/g, '<'); - out = out.replace(/\|-gt-\|/g, '>'); - return out; -}; - -if (!String.prototype.trim) { - (function () { - // Make sure we trim BOM and NBSP - var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; - String.prototype.trim = function () { - return this.replace(rtrim, ''); - }; - })(); -} - - -/** - * Strip known tags and escape the rest of the string. - * - * Warning! Since underscore.js 1.2.2 the _.escape() method got dumber and - * now it double-escapes HTML entities (read: https://github.com/jashkenas/underscore/issues/350). - * If you want to avoid double-escaping, you can do it by: - * - * WPV_Toolset.Utils._strip_tags_and_preserve_text(_.unescape(text)) - * - * Note: Although the "_" prefix suggests this function is private, it's also used elsewhere. - * - * @param {string} text - * @returns {string} - * @since unknown - */ -WPV_Toolset.Utils._strip_tags_and_preserve_text = function (text) { - var rex = /<\/?(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|noframes|noscript|object|ol|optgroup|option|output|p|param|plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|spacer|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b[^<>]*>/ig - return _.escape(text.replace(rex, "")).trim(); -}; - - -/** - * Setup the behaviour of browser when user tries to leave the page. - * - * When user tries to leave the page, check if confirmation is needed, and if so, displays a confirmation message and - * runs custom action. - * - * WARNING: http://stackoverflow.com/a/37782307 - * - * @param {function} checkIfConfirmationNeededCallback Should return true if confirmation should be shown (e.g. unsaved data). - * @param {function|null} onBeforeUnloadCallback Will be called before showing the confirmation. - * @param {string} confirmationMessage Confirmation message that should be shown by the browser. - * @since unknown - */ -WPV_Toolset.Utils.setConfirmUnload = function (checkIfConfirmationNeededCallback, onBeforeUnloadCallback, confirmationMessage) { - window.onbeforeunload = function (e) { - if (checkIfConfirmationNeededCallback()) { - - if(_.isFunction(onBeforeUnloadCallback)) { - onBeforeUnloadCallback(); - } - - // For IE and Firefox prior to version 4 - if (e) { - e.returnValue = confirmationMessage; - } - return confirmationMessage; - } - }; -}; - -if (typeof _ !== 'undefined' && typeof _.capitalize === 'undefined') { - _.mixin({ - capitalize: function (string) { - return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase(); - } - }); -} - - -WPV_Toolset.Utils.has_shortcode = function (string) { - var search = /\[(\[?)(\w*?\-*?\w*?)*?(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*(?:\[(?!\/\2\])[^\[]*)*)(\[\/\2\]))?)(\]?)/g; - return decodeURIComponent(string).search(search) !== -1; -}; - - -/** - * Courtesy from: https://gist.github.com/alexey-bass/1115557 - * @param left - * @param right - * @returns int - */ -WPV_Toolset.Utils.versionCompare = function (left, right) { - if (typeof left + typeof right != 'stringstring') - return false; - - var a = left.split('.') - , b = right.split('.') - , i = 0, len = Math.max(a.length, b.length); - - for (; i < len; i++) { - if ((a[i] && !b[i] && parseInt(a[i]) > 0) || (parseInt(a[i]) > parseInt(b[i]))) { - return 1; - } else if ((b[i] && !a[i] && parseInt(b[i]) > 0) || (parseInt(a[i]) < parseInt(b[i]))) { - return -1; - } - } - - return 0; -}; - - -/** - * Get a query argument value from a URL. - * - * @param {string} name Argument name. - * @param {string} [url] Source URL. Optional. If missing, current page URL will be used. - * @returns {string|null} - * @since 2.1 - * @link http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript - */ -WPV_Toolset.Utils.getParameterByName = function (name, url) { - - if (!url) { - url = window.location.href; - } - - name = name.replace(/[\[\]]/g, "\\$&"); - - var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)", "i"); - - var results = regex.exec(url); - - if (!results) { - return null; - } - - if (!results[2]) { - return ''; - } - - return decodeURIComponent(results[2].replace(/\+/g, " ")); -}; - - -/** - * Add, update or remove query string argument. - * - * @param {string} key Argument name. - * @param {string} [value] Argument value. Not supplying a value will remove the parameter, supplying one will - * add/update the argument. - * @param {string} [url] If no URL is supplied, it will be grabbed from window.location - * @returns {string} - * @link http://stackoverflow.com/a/11654596/3191395 - */ -WPV_Toolset.Utils.updateUrlQuery = function (key, value, url) { - if (!url) { - url = window.location.href; - } - var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi"); - var hash; - - if (re.test(url)) { - if (typeof value !== 'undefined' && value !== null) { - return url.replace(re, '$1' + key + "=" + value + '$2$3'); - } else { - hash = url.split('#'); - url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, ''); - if (typeof hash[1] !== 'undefined' && hash[1] !== null) { - url += '#' + hash[1]; - } - return url; - } - } else { - if (typeof value !== 'undefined' && value !== null) { - var separator = url.indexOf('?') !== -1 ? '&' : '?'; - hash = url.split('#'); - url = hash[0] + separator + key + '=' + value; - if (typeof hash[1] !== 'undefined' && hash[1] !== null) { - url += '#' + hash[1]; - } - return url; - } else { - return url; - } - } -}; - - -/** - * Tools for manipulating spinners in a native WP way. - * - * If WP changes the behaviour, we'll need only to update this object. - * - * @type {{create: WPV_Toolset.Utils.Spinner.create, show: WPV_Toolset.Utils.Spinner.show, hide: WPV_Toolset.Utils.Spinner.hide, find: WPV_Toolset.Utils.Spinner.find}} - */ -WPV_Toolset.Utils.Spinner = { - create: function () { - return jQuery(''); - }, - show: function (spinner, show) { - if (typeof(show) === 'undefined') { - show = true; - } - - if (!show) { - WPV_Toolset.Utils.Spinner.hide(spinner); - return; - } - - spinner.addClass('is-active'); - }, - hide: function (spinner) { - spinner.removeClass('is-active'); - }, - find: function (parentElement) { - return parentElement.find('.spinner'); - } -}; - - -/** - * AJAX call helper. - * - * WIP, to be merged with WPV_Toolset.Utils.do_ajax_post(). - * - * @type {{parseResponse: WPV_Toolset.Utils.Ajax.parseResponse, call: WPV_Toolset.Utils.Ajax.call}} - * @since 2.1 - */ -WPV_Toolset.Utils.Ajax = { - - /** - * Ensure that response is always an object with the success property. - * - * If it's not, return a dummy object indicating a failure. - * - * @param response {*} Response from the AJAX call. - * @returns {{success: boolean}} Sanitized response. - * - * @since 2.1 - */ - parseResponse: function (response) { - if (typeof(response.success) === 'undefined') { - console.log("parseResponse: no success value", response); - return {success: false}; - } else { - return response; - } - }, - - - /** - * Perform an AJAX call on field definitions. - * - * @param {*} data AJAX call parameters. Needs to include 'action' and 'wpnonce'. - * @param {function} successCallback Callback to be used after AJAX call is completed. It will get two parameters, - * the complete AJAX response and the 'data' element for convenience. - * @param {function} [failCallback] Analogous to successCallback for the case of failure. If missing, - * successCallback will be used instead. - * - * @since 2.1 - */ - call: function (data, successCallback, failCallback) { - - if (typeof(failCallback) === 'undefined') { - failCallback = successCallback; - } - - jQuery.post({ - async: true, - url: ajaxurl, - data: data, - - success: function (originalResponse) { - var response = WPV_Toolset.Utils.Ajax.parseResponse(originalResponse); - - if (response.success) { - successCallback(response, response.data || {}); - } else { - failCallback(response, response.data || {}); - } - }, - - error: function (ajaxContext) { - console.log('Error:', ajaxContext.responseText); - failCallback({success: false, data: {}}, {}); - } - }); - - } - -}; - - -WPV_Toolset.Utils._template = function (template, data, settings) { - var options = _.defaults({}, settings, _.templateSettings), - _template = null; - - if (WPV_Toolset.Utils.versionCompare(_.VERSION, '1.7') >= 0) { - _template = _.template(template, options); - return _template(data); - } else { - return _.template(template, data, options); - } -}; - -// override dialog whenever toolset is active and take possession -/** - * @todo This should not be here: - * dialogs with specific classnames should get it directly. - * We should not be pre-setting all jQuery UI dialogs dialogClass setting, - * we are not good players here. - */ -if (jQuery && jQuery.ui && jQuery.ui.dialog) { - jQuery.extend(jQuery.ui.dialog.prototype.options, { - dialogClass: 'toolset-ui-dialog' - }); -} - - -if (typeof Toolset.add_qt_editor_buttons !== 'function') { - Toolset.add_qt_editor_buttons = function (qt_instance, editor_instance) { - var activeUrlEditor, html; - QTags._buttonsInit(); - var editorInstance = {}; - editorInstance[qt_instance.id] = editor_instance; - - for (var button_name in qt_instance.theButtons) { - if (qt_instance.theButtons.hasOwnProperty(button_name)) { - qt_instance.theButtons[button_name].old_callback = qt_instance.theButtons[button_name].callback; - if (qt_instance.theButtons[button_name].id == 'img') { - qt_instance.theButtons[button_name].callback = function (element, canvas, ed) { - var t = this, - id = jQuery(canvas).attr('id'), - selection = editorInstance[id].getSelection(), - e = "http://", - g = prompt(quicktagsL10n.enterImageURL, e), - f = prompt(quicktagsL10n.enterImageDescription, ""); - t.tagStart = '' + f + ''; - selection = t.tagStart; - t.closeTag(element, ed); - editorInstance[id].replaceSelection(selection, 'end'); - editorInstance[id].focus(); - } - } else if (qt_instance.theButtons[button_name].id == 'close') { - - } else if (qt_instance.theButtons[button_name].id == 'link') { - var t = this; - qt_instance.theButtons[button_name].callback = - function (b, c, d, e) { - activeUrlEditor = c; - var f, g = this; - return "undefined" != typeof wpLink ? void wpLink.open(d.id) : (e || (e = "http://"), void(g.isOpen(d) === !1 ? (f = prompt(quicktagsL10n.enterURL, e), f && (g.tagStart = '', a.TagButton.prototype.callback.call(g, b, c, d))) : a.TagButton.prototype.callback.call(g, b, c, d))) - }; - jQuery('#wp-link-submit').off(); - jQuery('#wp-link-submit').on('click', function (event) { - event.preventDefault(); - if (wpLink.isMCE()) { - wpLink.mceUpdate(); - } else { - var id = jQuery(activeUrlEditor).attr('id'), - selection = editorInstance[id].getSelection(), - inputs = {}, - attrs, text, title, html; - inputs.wrap = jQuery('#wp-link-wrap'); - inputs.backdrop = jQuery('#wp-link-backdrop'); - if (jQuery('#link-target-checkbox').length > 0) { - // Backwards compatibility - before WordPress 4.2 - inputs.text = jQuery('#link-title-field'); - attrs = wpLink.getAttrs(); - text = inputs.text.val(); - if (!attrs.href) { - return; - } - // Build HTML - html = '/g, '>').replace(/"/g, '"'); - html += ' title="' + title + '"'; - } - html += '>'; - html += text || selection; - html += ''; - t.tagStart = html; - selection = t.tagStart; - } else { - // WordPress 4.2+ - inputs.text = jQuery('#wp-link-text'); - attrs = wpLink.getAttrs(); - text = inputs.text.val(); - if (!attrs.href) { - return; - } - // Build HTML - html = ' 0) { - if (!t.tagEnd) { - selection = selection + t.tagStart; - } else { - selection = t.tagStart + selection + t.tagEnd; - } - } else { - if (!t.tagEnd) { - selection = t.tagStart; - } else if (t.isOpen(ed) === false) { - selection = t.tagStart; - t.openTag(element, ed); - } else { - selection = t.tagEnd; - t.closeTag(element, ed); - } - } - editorInstance[id].replaceSelection(selection, 'end'); - editorInstance[id].focus(); - } - } - } - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/singleton_factory.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/singleton_factory.php deleted file mode 100644 index 0ad0d33..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/singleton_factory.php +++ /dev/null @@ -1,81 +0,0 @@ -newInstanceArgs( $arguments ); - } else { - // no arguments, no extra magic needed - self::$instances[ $class ] = new $class(); - } - - - return self::$instances[ $class ]; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/utils.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/utils.php deleted file mode 100644 index a137548..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/utils.php +++ /dev/null @@ -1,867 +0,0 @@ - The content to show inside the help box. - * tutorial-button-text => Optional button anchor text. - * tutorial-button-url => Optional button url. - * link-text => Optional link anchor text. - * link-url => Optional link url. - * footer => 'true'|'false' Whether the help box should have a footer with a Close button (managed) and a "dismiss forever" button (not managed). Defaults to 'false'. - * classname => Additional classnames for the help box in a space-separated list. - * close => 'true'|'false' Whether the help box should have a close button. Defaults to 'true'. - * hidden => 'true'|'false' Whether the help box should be hidden by default. Defaults to 'false'. - * - * @since 1.7 - */ - public static function help_box( $data = array() ) { - if ( is_array( $data ) && ! empty( $data ) ) { - $data_attr = ''; - foreach ( $data as $key => $value ) { - if ( 'text' != $key ) { - $data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '"'; - } - } - ?> -
                > - -
                - $_wp_additional_image_sizes[ $_size ]['width'], - 'height' => $_wp_additional_image_sizes[ $_size ]['height'], - 'crop' => $_wp_additional_image_sizes[ $_size ]['crop'], - ); - } - } - - // Get only 1 size if found - if ( $size ) { - - if ( isset( $sizes[ $size ] ) ) { - return $sizes[ $size ]; - } else { - return false; - } - } - - return $sizes; - } - - /** - * Check if a value is numeric and represents a non-negative number (zero is also ok, floats are ok). - * - * @param $value - * - * @return bool - * @since m2m - */ - public static function is_nonnegative_numeric( $value ) { - return ( is_numeric( $value ) && ( 0 <= $value ) ); - } - - - /** - * Check if a value is numeric and represents an integer (not a float). - * - * @param $value - * - * @return bool - * @since m2m - */ - public static function is_integer( $value ) { - // http://stackoverflow.com/questions/2559923/shortest-way-to-check-if-a-variable-contains-positive-integer-using-php - return ( (int) $value == $value && is_numeric( $value ) ); - } - - - /** - * Check if a value is numeric, represents an integer, and is non-negative. - * - * @param $value - * - * @return bool - */ - public static function is_nonnegative_integer( $value ) { - return ( - self::is_nonnegative_numeric( $value ) - && self::is_integer( $value ) - ); - } - - /** - * Check if a value is numeric, represents an integer (not a float) and positive. - * - * @param mixed $value - * - * @return bool - * @since m2m - */ - public static function is_natural_numeric( $value ) { - return ( - self::is_nonnegative_integer( $value ) - && ( 0 < (int) $value ) - ); - } - - - /** - * Changes array of items into string of items, separated by comma and sql-escaped - * - * @see https://coderwall.com/p/zepnaw - * - * Taken from wpml_prepare_in(). - * - * @param mixed|array $items item(s) to be joined into string - * @param string $format %s or %d - * - * @return string Items separated by comma and sql-escaped - * @since m2m - */ - public static function prepare_mysql_in( $items, $format = '%s' ) { - global $wpdb; - - $items = (array) $items; - $how_many = count( $items ); - $prepared_in = ''; - - if ( $how_many > 0 ) { - $placeholders = array_fill( 0, $how_many, $format ); - $prepared_format = implode( ",", $placeholders ); - $prepared_in = $wpdb->prepare( $prepared_format, $items ); - } - - return $prepared_in; - } - - /** - * Check for a custom field value's "emptiness". - * - * "0" is also a valid value that we need to take into account. - * - * @param $field_value - ** @return bool - * - * @since 2.2.3 - */ - public static function is_field_value_truly_empty( $field_value ) { - $is_truly_empty = ( empty( $field_value ) && ! is_numeric( $field_value ) ); - - return $is_truly_empty; - } - - - /** - * Return an ID of an attachment by searching the database with the file URL. - * - * First checks to see if the $url is pointing to a file that exists in - * the wp-content directory. If so, then we search the database for a - * partial match consisting of the remaining path AFTER the wp-content - * directory. Finally, if a match is found the attachment ID will be - * returned. - * - * Taken from: - * - * @link http://frankiejarrett.com/get-an-attachment-id-by-url-in-wordpress/ - * - * @param string $url URL of the file. - * - * @return int|null Attachment ID if it exists. - * @since 2.2.9 - */ - public static function get_attachment_id_by_url( $url ) { - - // Split the $url into two parts with the wp-content directory as the separator. - $parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url ); - - // Get the host of the current site and the host of the $url, ignoring www. - $this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) ); - $file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) ); - - // Return nothing if there aren't any $url parts or if the current host and $url host do not match. - $attachment_path = toolset_getarr( $parsed_url, 1 ); - if ( ! isset( $attachment_path ) || empty( $attachment_path ) || ( $this_host != $file_host ) ) { - return null; - } - - // Now we're going to quickly search the DB for any attachment GUID with a partial path match. - // Example: /uploads/2013/05/test-image.jpg - global $wpdb; - - $query = $wpdb->prepare( - "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND guid LIKE %s", - '%' . $attachment_path - ); - - $attachment = $wpdb->get_col( $query ); - - if ( is_array( $attachment ) && ! empty( $attachment ) ) { - return (int) array_shift( $attachment ); - } - - return null; - } - - - /** - * Set a value in a nested array, creating the structure as needed. - * - * @param array &$array The array to be modified. - * @param string[] $path Array of keys, each element means one level of nesting. - * @param mixed $value The value to be assigned to the last level. - * - * Example: - * - * $result = Toolset_Utils::set_nested_value( $result, array( 'a', 'b', 'c' ), 'x' ); - * - * Then $result would be: - * - * array( - * 'a' => array( - * 'b' => array( - * 'c' => 'x' - * ) - * ) - * ); - * - * If there are any other elements set, they will not be touched. - * - * @return array - */ - public static function set_nested_value( &$array, $path, $value ) { - if ( ! is_array( $array ) || ! is_array( $path ) ) { - throw new InvalidArgumentException(); - } - - if ( empty( $path ) ) { - return $value; - } - - $next_level = array_shift( $path ); - - if ( ! array_key_exists( $next_level, $array ) ) { - $array[ $next_level ] = array(); - } - - $array[ $next_level ] = self::set_nested_value( $array[ $next_level ], $path, $value ); - - return $array; - } - - - /** - * Safely resolve a lowercase callback name into a handler class name even if mb_convert_case() is not available. - * - * It will always work correctly with values that contain only alphabetic characters, numbers and underscores. - * But nothing else should be used in callback names anyway. - * - * Example: "types_ajax_m2m_action" will become "Types_Ajax_M2M_Action" - * - * @param string $callback - * - * @return string Name of the handler class. - * @since 3.0 - */ - public static function resolve_callback_class_name( $callback ) { - - // Use the native solution if available (which will happen in the vast majority of most cases). - if( function_exists( 'mb_convert_case' ) && defined( 'MB_CASE_TITLE' ) ) { - return mb_convert_case( $callback, MB_CASE_TITLE ); - } - - // mb_convert_case() works this way - it also capitalizes first letters after numbers - $name_parts = preg_split( "/_|[0-9]/", $callback ); - $parts_ucfirst = array_map( function( $part ) { return ucfirst( $part ); }, $name_parts ); - - $result = ''; - foreach( $parts_ucfirst as $part ) { - $result .= $part; - $delimiter_position = strlen( $result ); - - // Put back the delimiter (it could be a number or an underscore) - if( $delimiter_position < strlen( $callback ) ) { - $result .= $callback[ $delimiter_position ]; - } - } - - return $result; - } - } - -} - -if ( ! function_exists( 'wp_json_encode' ) ) { - - function wp_json_encode( $data, $options = 0, $depth = 512 ) { - /* - * json_encode() has had extra params added over the years. - * $options was added in 5.3, and $depth in 5.5. - * We need to make sure we call it with the correct arguments. - */ - if ( version_compare( PHP_VERSION, '5.5', '>=' ) ) { - $args = array( $data, $options, $depth ); - } elseif ( version_compare( PHP_VERSION, '5.3', '>=' ) ) { - $args = array( $data, $options ); - } else { - $args = array( $data ); - } - - $json = call_user_func_array( 'json_encode', $args ); - - // If json_encode() was successful, no need to do more sanity checking. - // ... unless we're in an old version of PHP, and json_encode() returned - // a string containing 'null'. Then we need to do more sanity checking. - if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) ) { - return $json; - } - - try { - $args[0] = _wp_json_sanity_check( $data, $depth ); - } catch ( Exception $e ) { - return false; - } - - return call_user_func_array( 'json_encode', $args ); - } - - if ( ! function_exists( '_wp_json_sanity_check' ) ) { - - function _wp_json_sanity_check( $data, $depth ) { - if ( $depth < 0 ) { - throw new Exception( 'Reached depth limit' ); - } - - if ( is_array( $data ) ) { - $output = array(); - foreach ( $data as $id => $el ) { - // Don't forget to sanitize the ID! - if ( is_string( $id ) ) { - $clean_id = _wp_json_convert_string( $id ); - } else { - $clean_id = $id; - } - - // Check the element type, so that we're only recursing if we really have to. - if ( is_array( $el ) || is_object( $el ) ) { - $output[ $clean_id ] = _wp_json_sanity_check( $el, $depth - 1 ); - } elseif ( is_string( $el ) ) { - $output[ $clean_id ] = _wp_json_convert_string( $el ); - } else { - $output[ $clean_id ] = $el; - } - } - } elseif ( is_object( $data ) ) { - $output = new stdClass; - foreach ( $data as $id => $el ) { - if ( is_string( $id ) ) { - $clean_id = _wp_json_convert_string( $id ); - } else { - $clean_id = $id; - } - - if ( is_array( $el ) || is_object( $el ) ) { - $output->$clean_id = _wp_json_sanity_check( $el, $depth - 1 ); - } elseif ( is_string( $el ) ) { - $output->$clean_id = _wp_json_convert_string( $el ); - } else { - $output->$clean_id = $el; - } - } - } elseif ( is_string( $data ) ) { - return _wp_json_convert_string( $data ); - } else { - return $data; - } - - return $output; - } - - } - - if ( ! function_exists( '_wp_json_convert_string' ) ) { - - function _wp_json_convert_string( $string ) { - static $use_mb = null; - if ( is_null( $use_mb ) ) { - $use_mb = function_exists( 'mb_convert_encoding' ); - } - - if ( $use_mb ) { - $encoding = mb_detect_encoding( $string, mb_detect_order(), true ); - if ( $encoding ) { - return mb_convert_encoding( $string, 'UTF-8', $encoding ); - } else { - return mb_convert_encoding( $string, 'UTF-8', 'UTF-8' ); - } - } else { - return wp_check_invalid_utf8( $string, true ); - } - } - - } -} - -if ( ! class_exists( 'Toolset_ArrayUtils', false ) ) { - - Class Toolset_ArrayUtils { - - private $value = null; - private $property = null; - - function __construct( $property = null, $value = null ) { - $this->value = $value; - $this->property = $property; - } - - function filter_array( $element ) { - if ( is_object( $element ) ) { - - if ( property_exists( $element, $this->property ) === false ) { - return null; - } - - return $element->{$this->property} === $this->value; - } elseif ( is_array( $element ) ) { - - if ( isset( $element[ $this->property ] ) === false ) { - return null; - } - - return $element[ $this->property ] === $this->value; - } else { - - throw new Exception( sprintf( "Element parameter should be an object or an array, %s given.", gettype( $element ) ) ); - } - } - - public function remap_by_property( $data ) { - return $data[ $this->property ]; - } - - function value_in_array( $array ) { - if ( ! is_array( $array ) ) { - return false; - } - - return in_array( $this->value, array_values( $array ) ); - } - - function sort_string_ascendant( $a, $b ) { - return strcmp( $a[ $this->property ], $b[ $this->property ] ); - } - - } - -} - - -if ( ! class_exists( 'Toolset_ErrorHandler', false ) ) { - - /** - * ErrorHandler that can be used to catch internal PHP errors - * and convert to an ErrorException instance. - */ - abstract class Toolset_ErrorHandler { - - /** - * Active stack - * - * @var array - */ - protected static $stack = array(); - - /** - * Check if this error handler is active - * - * @return bool - */ - public static function started() { - return (bool) self::getNestedLevel(); - } - - /** - * Get the current nested level - * - * @return int - */ - public static function getNestedLevel() { - return count( self::$stack ); - } - - /** - * Starting the error handler - * - * @param int $errorLevel - */ - public static function start( $errorLevel = E_WARNING ) { - if ( ! self::$stack ) { - set_error_handler( array( get_called_class(), 'addError' ), $errorLevel ); - register_shutdown_function( array( get_called_class(), 'handle_shutdown' ), true ); - } - - self::$stack[] = null; - } - - /** - * Stopping the error handler - * - * @param bool $throw Throw the ErrorException if any - * - * @return null|ErrorException - * @throws ErrorException If an error has been catched and $throw is true - */ - public static function stop( $throw = false ) { - $errorException = null; - - if ( self::$stack ) { - $errorException = array_pop( self::$stack ); - - if ( ! self::$stack ) { - restore_error_handler(); - } - - if ( $errorException && $throw ) { - throw $errorException; - } - } - - return $errorException; - } - - public static function handle_shutdown() { - if ( self::is_fatal() ) { - do_action( 'toolset-shutdown-hander' ); - } - exit; - } - - public static function is_fatal() { - $error = error_get_last(); - $ignore = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_STRICT | E_DEPRECATED | E_USER_DEPRECATED; - if ( ( $error['type'] & $ignore ) == 0 ) { - return true; - } - - return false; - } - - /** - * Stop all active handler - * - * @return void - */ - public static function clean() { - if ( self::$stack ) { - restore_error_handler(); - } - - self::$stack = array(); - } - - /** - * Add an error to the stack - * - * @param int $errno - * @param string $errstr - * @param string $errfile - * @param int $errline - * - * @return void - */ - public static function addError( $errno, $errstr = '', $errfile = '', $errline = 0 ) { - if ( count( self::$stack ) ) { - $stack = &self::$stack[ count( self::$stack ) - 1 ]; - } else { - $stack = null; - } - $stack = new ErrorException( (string) $errstr, 0, (int) $errno, (string) $errfile, (int) $errline ); - } - - } - -} - -if ( ! function_exists( 'get_called_class' ) ) { - - /** - * PHP 5.2 support. - * - * get_called_class() is only in PHP >= 5.3, this is a workaround. - * This function is needed by WPDDL_Theme_Integration_Abstract (and others). - */ - function get_called_class() { - $bt = debug_backtrace(); - $l = 0; - $matches = null; - do { - $l ++; - if ( isset( $bt[ $l ]['file'] ) ) { - $lines = file( $bt[ $l ]['file'] ); - $callerLine = $lines[ $bt[ $l ]['line'] - 1 ]; - preg_match( '/([a-zA-Z0-9\_]+)::' . $bt[ $l ]['function'] . '/', $callerLine, $matches ); - } - } while ( isset( $matches[1] ) && $matches[1] === 'parent' ); - - return isset( $matches[1] ) ? $matches[1] : ""; - } - -} - - -if ( ! function_exists( 'toolset_getarr' ) ) { - - - /** - * Safely retrieve a key from given array (meant for $_POST, $_GET, etc). - * - * Checks if the key is set in the source array. If not, default value is returned. Optionally validates against array - * of allowed values and returns default value if the validation fails. - * - * @param array $source The source array. - * @param string $key The key to be retrieved from the source array. - * @param mixed $default Default value to be returned if key is not set or the value is invalid. Optional. - * Default is empty string. - * @param null|array $valid If an array is provided, the value will be validated against it's elements. - * - * @return mixed The value of the given key or $default. - * - * @since 1.8 - */ - function toolset_getarr( &$source, $key, $default = '', $valid = null ) { - if ( isset( $source[ $key ] ) ) { - $val = $source[ $key ]; - - if ( is_callable( $valid ) && ! call_user_func( $valid, $val ) ) { - return $default; - } elseif ( is_array( $valid ) && ! in_array( $val, $valid ) ) { - return $default; - } - - return $val; - } else { - return $default; - } - } - -} - - -if ( ! function_exists( 'toolset_getget' ) ) { - - /** - * Safely retrieve a key from $_GET variable. - * - * This is a wrapper for toolset_getarr(). See that for more information. - * - * @param string $key - * @param mixed $default - * @param null|array $valid - * - * @return mixed - * @since 1.9 - */ - function toolset_getget( $key, $default = '', $valid = null ) { - return toolset_getarr( $_GET, $key, $default, $valid ); - } - -} - - -if ( ! function_exists( 'toolset_getpost' ) ) { - - /** - * Safely retrieve a key from $_POST variable. - * - * This is a wrapper for toolset_getarr(). See that for more information. - * - * @param string $key - * @param mixed $default - * @param null|array $valid - * - * @return mixed - * @since 1.9 - */ - function toolset_getpost( $key, $default = '', $valid = null ) { - return toolset_getarr( $_POST, $key, $default, $valid ); - } - -} - - -if ( ! function_exists( 'toolset_ensarr' ) ) { - - /** - * Ensure that a variable is an array. - * - * @param mixed $array The original value. - * @param array $default Default value to use when no array is provided. This one should definitely be an array, - * otherwise the function doesn't make much sense. - * - * @return array The original array or a default value if no array is provided. - * - * @since 1.9 - */ - function toolset_ensarr( $array, $default = array() ) { - return ( is_array( $array ) ? $array : $default ); - } - -} - - -if ( ! function_exists( 'toolset_wraparr' ) ) { - - /** - * Wrap a variable value in an array if it's not array already. - * - * @param mixed $input - * - * @return array - * @since 1.9.1 - */ - function toolset_wraparr( $input ) { - return ( is_array( $input ) ? $input : array( $input ) ); - } - -} - - -if ( ! function_exists( 'toolset_getnest' ) ) { - - /** - * Get a value from nested associative array. - * - * This function will try to traverse a nested associative array by the set of keys provided. - * - * E.g. if you have $source = array( 'a' => array( 'b' => array( 'c' => 'my_value' ) ) ) and want to reach 'my_value', - * you need to write: $my_value = wpcf_getnest( $source, array( 'a', 'b', 'c' ) ); - * - * @param mixed|array $source The source array. - * @param string[] $keys Keys which will be used to access the final value. - * @param null|mixed $default Default value to return when the keys cannot be followed. - * - * @return mixed|null Value in the nested structure defined by keys or default value. - * - * @since 1.9 - */ - function toolset_getnest( &$source, $keys = array(), $default = null ) { - - $current_value = $source; - - // For detecting if a value is missing in a sub-array, we'll use this temporary object. - // We cannot just use $default on every level of the nesting, because if $default is an - // (possibly nested) array itself, it might mess with the value retrieval in an unexpected way. - $missing_value = new stdClass(); - - while ( ! empty( $keys ) ) { - $current_key = array_shift( $keys ); - $is_last_key = empty( $keys ); - - $current_value = toolset_getarr( $current_value, $current_key, $missing_value ); - - if ( $is_last_key ) { - // Apply given default value. - if ( $missing_value === $current_value ) { - return $default; - } else { - return $current_value; - } - } elseif ( ! is_array( $current_value ) ) { - return $default; - } - } - - return $default; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon-generic.class.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon-generic.class.php deleted file mode 100644 index fea9aee..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon-generic.class.php +++ /dev/null @@ -1,221 +0,0 @@ -name = $name; - $this->plugin_js_url = $plugin_js_url; - $this->button_text = $button_text; - $this->media_button_image = $media_button_image; - $this->initialized = false; - $this->icon_class = $icon_class; - - - if ( ( $media_button_image != '' || $icon_class != '' ) && $print_button ) { - // Media buttons - //Adding "embed form" button - // WP 3.3 changes - global $wp_version; - if ( version_compare( $wp_version, '3.1.4', '>' ) ) { - add_action( 'media_buttons', - array($this, 'add_form_button'), 10, 2 ); - } else { - add_action( 'media_buttons_context', - array($this, 'add_form_button'), 10, 2 ); - } - } - - } - - public function __destruct() { - - } - - - /** - * Add a menu item that will insert the shortcode. - * - * To use sub menus, add a '-!-' separator between levels in the $menu parameter. - * eg. Field-!-image - * This will create/use a menu "Field" and add a sub menu "image" - * - * $function_name is the javascript function to call for the on-click - * If it's left blank then a function will be created that just - * inserts the shortcode. - */ - public function add_insert_shortcode_menu( $text, $shortcode, $menu, - $function_name = '' ) { - $this->items[] = array($text, $shortcode, $menu, $function_name); - } - - - public function add_form_button( $context, $text_area, $standard_v, $add_views, $codemirror_button ) - { - throw new Exception( 'You should implement this method '. __METHOD__ ); - } - - - /** - * @deprecated This doesn't seem to be used anywhere in Toolset, nor should it be. Consider removing it. - * - * @return array - */ - public static function getWpForbiddenNames() - { - global $wp_post_types; - - $reserved_list = array( - 'attachment', 'attachment_id', 'author', 'author_name', 'calendar', 'cat', 'category', 'category__and', 'category__in', - 'category__not_in', 'category_name', 'comments_per_page', 'comments_popup', 'customize_messenger_channel', - 'customized', 'cpage', 'day', 'debug', 'error', 'exact', 'feed', 'hour', 'link_category', 'm', 'minute', - 'monthnum', 'more', 'name', 'nav_menu', 'nonce', 'nopaging', 'offset', 'order', 'orderby', 'p', 'page', 'page_id', - 'paged', 'pagename', 'pb', 'perm', 'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', - 'post_tag', 'post_type', 'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search', - 'second', 'sentence', 'showposts', 'static', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', - 'tag_id', 'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'theme', 'type', 'w', 'withcomments', 'withoutcomments', - 'year ' - ); - - - $reserved_post_types = array_keys( $wp_post_types ); - - $wpv_taxes = get_taxonomies(); - $reserved_taxonomies = array_keys( $wpv_taxes ); - - $wpv_forbidden_parameters = array( - 'wordpress' => $reserved_list, - 'post_types' => $reserved_post_types, - 'taxonomies' => $reserved_taxonomies, - ); - - return $wpv_forbidden_parameters; - } - - } - -} - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon.class.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon.class.php deleted file mode 100644 index 9394273..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon.class.php +++ /dev/null @@ -1,824 +0,0 @@ -items ); - } - - /** - * Adding a "V" button to the menu - * @param string $context - * @param string $text_area - * @param boolean $standard_v is this a standard V button - */ - function add_form_button( $context, $text_area = '', $standard_v = true, $add_views = false, $codemirror_button = false ) - { - /** - * turn off button - */ - if ( !apply_filters('toolset_editor_add_form_buttons', true) ) { - return; - } - - global $wp_version; - - if ( empty($context) && $text_area == '' ){ - return; - } - // WP 3.3 changes ($context arg is actually a editor ID now) - if ( version_compare( $wp_version, '3.1.4', '>' ) && !empty( $context ) ) { - $text_area = $context; - } - - // Apply filters - $this->items = apply_filters( 'editor_addon_items_' . $this->name, - $this->items ); - - // add_filter('editor_addon_parent_items', array($this, 'wpv_add_parent_items'), 10, $this->items); - // Apply filter parent items - //apply_filters('editor_addon_parent_items', $this->items); - // sort the items into menu levels. - - $menus = array(); - $sub_menus = array(); - - if( $this->items ) - foreach ( $this->items as $item ) { - $parts = explode( '-!-', $item[2] ); - $menu_level = &$menus; - foreach ( $parts as $part ) { - if ( $part != '' ) { - if ( !array_key_exists( $part, $menu_level ) ) { - $menu_level[$part] = array(); - } - $menu_level = &$menu_level[$part]; - } - } - $menu_level[$item[0]] = $item; - } - - // Apply filters - $menus = apply_filters( 'editor_addon_menus_' . $this->name, $menus ); - - // add View Template links to the "Add Field" button - if ( !$standard_v ) { - $this->add_view_type( $menus, 'view-template', - __( 'Content Template', 'wpv-views' ) ); - $this->add_view_type( $menus, 'view', - __( 'Post View', 'wpv-views' ) ); - $this->add_view_type( $menus, 'view', - __( 'Taxonomy View', 'wpv-views' ) ); - $this->add_view_type( $menus, 'view', - __( 'User View', 'wpv-views' ) ); - } - - if ( $standard_v && $add_views ) { - $this->add_view_type( $menus, 'view', - __( 'Post View', 'wpv-views' ) ); - $this->add_view_type( $menus, 'view', - __( 'Taxonomy View', 'wpv-views' ) ); - $this->add_view_type( $menus, 'view', - __( 'User View', 'wpv-views' ) ); - } - - // Sort menus - if ( is_array( $menus ) ) { - $menus = $this->sort_menus_alphabetically( $menus ); - } - - $this->_media_menu_direct_links = array(); - $menus_output = $this->_output_media_menu( $menus, $text_area, $standard_v ); - - $direct_links = implode( ' ', $this->_media_menu_direct_links ); - $dropdown_class = 'js-editor_addon_dropdown-'.$this->name; - $icon_class = 'js-wpv-shortcode-post-icon-'.$this->name; - if ( $this->name == 'wpv-views' ) { - $button_label = __( 'Fields and Views', 'wpv-views' ); - } else if ( $this->name == 'types' ) { - $button_label = __( 'Types', 'wpv-views' ); - } else { - $button_label = ''; - } - - if( '' !== $this->media_button_image ) - { - $addon_button = '' . $button_label . ''; - } - else if( '' !== $this->icon_class ){ - - $addon_button = '' . $button_label . ''; - } - - if ( !$standard_v ) { - - if( '' !== $this->media_button_image ) - { - $addon_button = '' . $button_label . ''; - } - else if( '' !== $this->icon_class ) - { - $addon_button = '' . $button_label . ''; - } - } - // Codemirror (new layout) button - if ( $codemirror_button ){ - $addon_button = ''; - } - // add search box - $searchbar = $this->get_search_bar(); - - - // generate output content - $out = '' . - $addon_button . ' -
                -

                ' . $this->button_text . '

                '; - /** - * Add text after popup header. - * - * @since 1.6.7 - * - * @param string $context content - */ - $out .= apply_filters('editor_addon_dropdown_after_title', ''); - $out .= '
                 
                -
                - ' . apply_filters( 'editor_addon_dropdown_top_message_' . $this->name, - '' ) . ' - - - ' . $searchbar . ' - ' . $menus_output . ' - ' . apply_filters( 'editor_addon_dropdown_bottom_message' . $this->name, - '' ) . - ' -
                -
                '; - - // WP 3.3 changes - if ( version_compare( $wp_version, '3.1.4', '>' ) ) { - echo apply_filters( 'wpv_add_media_buttons', $out ); - } else { - return apply_filters( 'wpv_add_media_buttons', $context . $out ); - } - } - - /** - * Adding a "V" button to the menu (for user fields) - * - * @global object $wpdb - * - * @param string $context - * @param string $text_area - * @param boolean $standard_v is this a standard V button - * DEPRECATED since Views 1.9, not used anywhere else :-) - */ - function add_users_form_button( $context, $text_area = 'textarea#content', $codemirror_button = false ) { - global $wp_version, $sitepress, $wpdb, $WP_Views; - $standard_v = true; - // WP 3.3 changes ($context arg is actually a editor ID now) - if ( version_compare( $wp_version, '3.1.4', '>' ) && !empty( $context ) ) { - $text_area = $context; - } - //print_r($this->items);exit; - $this->items = array(); - - $unused_field = array('comment_shortcuts','managenav-menuscolumnshidden','dismissed_wp_pointers','meta-box-order_dashboard','nav_menu_recently_edited', - 'primary_blog','rich_editing','source_domain','use_ssl','user_level','user-settings-time' - ,'user-settings','dashboard_quick_press_last_post_id','capabilities','new_date','show_admin_bar_front','show_welcome_panel','show_highlight','admin_color' - ,'language_pairs','first_name','last_name','name','nickname','description','yim','jabber','aim'); - $exclude_these_hidden_var = '/('.implode('|', $unused_field).')/'; - $this->items = array( - array(__('User ID', 'wpv-views'), 'wpv-user field="ID"',__('Basic', 'wpv-views'),''), - array(__('User Email', 'wpv-views'), 'wpv-user field="user_email"',__('Basic', 'wpv-views'),''), - array(__('User Login', 'wpv-views'), 'wpv-user field="user_login"',__('Basic', 'wpv-views'),''), - array(__('First Name', 'wpv-views'), 'wpv-user field="user_firstname"',__('Basic', 'wpv-views'),''), - array(__('Last Name', 'wpv-views'), 'wpv-user field="user_lastname"',__('Basic', 'wpv-views'),''), - array(__('Nickname', 'wpv-views'), 'wpv-user field="nickname"',__('Basic', 'wpv-views'),''), - array(__('Display Name', 'wpv-views'), 'wpv-user field="display_name"',__('Basic', 'wpv-views'),''), - array(__('Description', 'wpv-views'), 'wpv-user field="description"',__('Basic', 'wpv-views'),''), - array(__('Yahoo IM', 'wpv-views'), 'wpv-user field="yim"',__('Basic', 'wpv-views'),''), - array(__('Jabber', 'wpv-views'), 'wpv-user field="jabber"',__('Basic', 'wpv-views'),''), - array(__('AIM', 'wpv-views'), 'wpv-user field="aim"',__('Basic', 'wpv-views'),''), - array(__('User Url', 'wpv-views'), 'wpv-user field="user_url"',__('Basic', 'wpv-views'),''), - array(__('Registration Date', 'wpv-views'), 'wpv-user field="user_registered"',__('Basic', 'wpv-views'),''), - array(__('User Status', 'wpv-views'), 'wpv-user field="user_status"',__('Basic', 'wpv-views'),''), - array(__('User Spam Status', 'wpv-views'), 'wpv-user field="spam"',__('Basic', 'wpv-views'),'') - ); - - if ( isset( $sitepress ) && function_exists( 'wpml_string_shortcode' ) ) { - $nonce = wp_create_nonce('wpv_editor_callback'); - $this->items[] = array( - __('Translatable string', 'wpv-views'), - 'wpml-string', - __('Basic', 'wpv-views'), - "WPViews.shortcodes_gui.wpv_insert_popup('wpml-string', '" . __( 'Translatable string', 'wpv-views' ) . "', {}, '" . $nonce . "', this )" - ); - } - - - - $meta_keys = get_user_meta_keys(); - $all_types_fields = get_option( 'wpcf-fields', array() ); - foreach ($meta_keys as $key) { - $key_nicename = ''; - if ( function_exists('wpcf_init') ){ - if (stripos($key, 'wpcf-') === 0) { - // - } - else { - if ( preg_match($exclude_these_hidden_var , $key) ){ - continue; - } - $this->items[] = array($key, - 'wpv-user field="'.$key.'"', - __('Users fields', 'wpv-views'),''); - } - } - else{ - if ( preg_match($exclude_these_hidden_var , $key) ){ - continue; - } - $this->items[] = array($key, - 'wpv-user field="'.$key.'"', - __('User fields', 'wpv-views'),''); - } - - } - - if ( function_exists('wpcf_init') ){ - //Get types groups and fields - $groups = wpcf_admin_fields_get_groups( 'wp-types-user-group' ); - $user_id = wpcf_usermeta_get_user(); - $add = array(); - if ( !empty( $groups ) ) { - foreach ( $groups as $group_id => $group ) { - if ( empty( $group['is_active'] ) ) { - continue; - } - $fields = wpcf_admin_fields_get_fields_by_group( $group['id'], - 'slug', true, false, true, 'wp-types-user-group', - 'wpcf-usermeta' ); - // @since m2m wpcf_admin_fields_get_fields_by_group returns strings for repeatng fields groups - $fields = array_filter( $fields, 'is_array' ); - - if ( !empty( $fields ) ) { - foreach ( $fields as $field_id => $field ) { - $add[] = $field['meta_key']; - $callback = 'wpcfFieldsEditorCallback(\'' . $field['id'] . '\', \'views-usermeta\', -1)'; - $this->items[] = array($field['name'], - 'types usermeta="'.$field['meta_key'].'"][/types', - $group['name'],$callback); - - - } - } - } - } - - //Get unused types fields - $cf_types = wpcf_admin_fields_get_fields( true, true, false, 'wpcf-usermeta' ); - foreach ( $cf_types as $cf_id => $cf ) { - if ( !in_array( $cf['meta_key'], $add) ){ - $callback = 'wpcfFieldsEditorCallback(\'' . $cf['id'] . '\', \'views-usermeta\', -1)'; - $this->items[] = array($cf['name'], - 'types usermeta="'.$cf['meta_key'].'"][/types', - __('Types fields', 'wpv-views'),$callback); - - } - } - } - - $view_available = $wpdb->get_results("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type='view' AND post_status in ('publish')"); - foreach($view_available as $view) { - - $view_settings = get_post_meta($view->ID, '_wpv_settings', true); - if (isset($view_settings['query_type'][0]) && $view_settings['query_type'][0] == 'posts' && !$WP_Views->is_archive_view($view->ID)) { - - $this->items[] = array($view->post_title, - $view->post_title, - __('Post View', 'wpv-views'), - '' - ); - } - } - - $out = array(); - - $menus = array(); - $sub_menus = array(); - - if( $this->items ) - foreach ( $this->items as $item ) { - $parts = explode( '-!-', $item[2] ); - $menu_level = &$menus; - foreach ( $parts as $part ) { - if ( $part != '' ) { - if ( !array_key_exists( $part, $menu_level ) ) { - $menu_level[$part] = array(); - } - $menu_level = &$menu_level[$part]; - } - } - $menu_level[$item[0]] = $item; - } - - - - - // Sort menus - if ( is_array( $menus ) ) { - $menus = $this->sort_menus_alphabetically( $menus ); - } - - - $this->_media_menu_direct_links = array(); - $menus_output = $this->_output_media_menu( $menus, $text_area, - $standard_v ); - - $direct_links = implode( ' ', $this->_media_menu_direct_links ); - $dropdown_class = 'js-editor_addon_dropdown-'.$this->name; - $icon_class = 'js-wpv-shortcode-post-icon-'.$this->name; - if ( $this->name == 'wpv-views' ) { - $button_label = __( 'Fields and Views', 'wpv-views' ); - } else if ( $this->name == 'types' ) { - $button_label = __( 'Types', 'wpv-views' ); - } else { - $button_label = ''; - } - $addon_button = '' . $button_label . ''; - if ( !$standard_v ) { - $addon_button = '' . $button_label . ''; - // $addon_button = ''; - //$addon_button = ''. __('Add field', 'wpv-views') .''; - } - // Codemirrir (new layout) button - if ( $codemirror_button ){ - $addon_button = ''; - } - // add search box - $searchbar = $this->get_search_bar(); - - // generate output content - $out = '' . - $addon_button . ' -
                -

                ' . $this->button_text . '

                '; - $out .= apply_filters('editor_addon_dropdown_after_title', ''); - $out .= '
                 
                -
                - ' . apply_filters( 'editor_addon_dropdown_top_message_' . $this->name, - '' ) . ' - - - ' . $searchbar . ' - ' . $menus_output . ' - ' . apply_filters( 'editor_addon_dropdown_bottom_message' . $this->name, - '' ) . - ' -
                -
                '; - // WP 3.3 changes - if ( version_compare( $wp_version, '3.1.4', '>' ) ) { - echo apply_filters( 'wpv_add_media_buttons', $out ); - } else { - return apply_filters( 'wpv_add_media_buttons', $context . $out ); - } - - } - - /** - * Output a single menu item - * @param string $menu - * @param string $text_area - * @param boolean $standard_v - * @return string media menu - */ - function _output_media_menu( $menu, $text_area, $standard_v ) { - - /** - * get current post id - */ - $post_id = 0; - global $post; - if ( is_object($post) && isset($post->ID) ) { - $post_id = $post->ID; - } - - $all_post_types = implode( ' ', - get_post_types( array('public' => true) ) ); - - $out = ''; - - if ( is_array( $menu ) ) { - foreach ( $menu as $key => $menu_item ) { - if ( isset( $menu_item[0] ) && !is_array( $menu_item[0] ) ) { - if ( !isset( $menu_item[3] ) ) { - break; - } - if ( $menu_item[3] != '' ) { - if ( !($key == 'css') ) { // hide unnecessary elements from the V popup - if ( !$standard_v && (strpos( $menu_item[3], - 'wpcfFieldsEditorCallback' ) !== false || - strpos( $menu_item[3], - 'wpcfFieldsEmailEditorCallback' ) !== false || - strpos( $menu_item[3], - 'wpv_insert_view_form_popup' ) !== false) ) { - $out .= $this->wpv_parse_menu_item_from_addfield( $menu_item ); - } else { - $out .= sprintf( - '
              • %s
              • ', - $menu_item[3], - $post_id, - $menu_item[0] - ); - } - } - } else { - if ( $standard_v ) { - $short_code = $menu_item[1]; - $link_text = $menu_item[0]; - - if ( $menu_item[2] == __( 'Post View', - 'wpv-views' ) || $menu_item[2] == __( 'Taxonomy View', - 'wpv-views' ) || $menu_item[2] == __( 'User View', - 'wpv-views' ) ) { - $short_code = 'wpv-view name="' . $short_code . '"'; - $link_text = str_replace( ' - ' . __( 'Post View' ), - '', $link_text ); - $link_text = str_replace( ' - ' . __( 'Taxonomy View' ), - '', $link_text ); - $link_text = str_replace( ' - ' . __( 'User View' ), - '', $link_text ); - } - $short_code = '[' . $short_code . ']'; - $short_code = base64_encode( $short_code ); - - $out .= '
              • ' . $link_text . "
              • \n"; - } else { - $out .= $this->wpv_parse_menu_item_from_addfield( $menu_item ); - } - } - } else { - if ( 'wpcf' != $key && 'views' != $key ) { // for some reason it displays a group wpcf on sites with WPLANG different from '' - // a sum menu. - /* - * SRDJAN - * Avoid using all classes. - * It will add generic classes that can messup our code. - */ - $css_classes = ''; -// $css_classes = isset($menu_item['css']) ? $menu_item['css'] : ''; -// if($key == __('Taxonomy', 'wpv-views') || $key == __('Basic', 'wpv-views')) { -// $css_classes = $all_post_types; -// } - $this->_media_menu_direct_links[] = ''; - /* - * SRDJAN - * Hmmmm, multiple IDs - * Changed ID to class - */ -// $out .= '
                \n"; - $out .= '
                "; - $out .= '
                  '; - $out .= $this->_output_media_menu( $menu_item, $text_area, $standard_v ); - $out .= "
                "; - $out .= "
                "; - } - } - } - } - - return $out; - } - - /** - * Parser for menu items in the add-field - * @param unknown_type $key - * @param unknown_type $menu_item - * @return string - */ - function wpv_parse_menu_item_from_addfield( $menu_item ) { - $param1 = ''; - $slug = $menu_item[1]; - - // search for wpv- starting fields first - if ( strpos( $slug, 'wpv-' ) !== false ) { - $menuitem_parts = explode( ' ', $slug ); - $slug = $menuitem_parts[0]; - } - // find types fields - else if ( (strpos( $menu_item[3], 'wpcfFieldsEditorCallback' ) !== false) - || (strpos( $menu_item[3], 'wpcfFieldsEmailEditorCallback' ) !== false) - || (strpos( $menu_item[3], 'wpv_insert_view_form_popup' ) !== false) ) { - return '
              • ' . $menu_item[0] . "
              • \n"; - } else if ( (preg_match( '/types field="(.+)"/', $slug, $matches ) > 0) - || (preg_match( '/type="(.+)"/', $slug, $matches ) > 0) ) { - $types_slug = $matches[1]; - $types_slug = str_replace( '" class="" style="', '', $types_slug ); - // convert Types fields to Views fields - $slug = $types_slug; - $param1 = 'Types-!-wpcf'; - } else if ( preg_match( '/type="(.+)"/', $slug, $matches ) > 0 ) { - $types_slug = $matches[1]; - $types_slug = str_replace( '" class="" style="', '', $types_slug ); - // convert field to Views field - $slug = $types_slug; - $param1 = 'Types-!-wpcf'; - - // apply_filters() for Types shortcodes - } - // for Basic group fields - if ( $menu_item[2] == __( 'Basic', 'wpv-views' ) ) { - // don't use slug here, just field name. - $slug = $menu_item[0]; - } - // View Templates here - if ( $menu_item[2] == __( 'Content Template', 'wpv-views' ) ) { - $param1 = 'Content Template'; - } - if ( $menu_item[2] == __( 'Post View', 'wpv-views' ) || $menu_item[2] == __( 'Taxonomy View', - 'wpv-views' ) || $menu_item[2] == __( 'User View', 'wpv-views' ) ) { - $param1 = 'Child View'; - } - if ( strpos( $slug, 'wpv-post-field' ) !== false ) { - $param1 = __('Field', 'wpv-views'); - $slug = $menu_item[0]; - } - // Taxonomies - if ( strpos( $menu_item[1], 'wpv-post-taxonomy' ) !== false ) { - $slug = $menu_item[1]; - $param1 = 'Taxonomy'; - if ( preg_match( '/wpv-post-taxonomy type="([^"]*)"/', $slug, - $matches ) > 0 ) { - $slug = 'wpvtax-' . $matches[1]; // split up and pass text only - } else { - $slug = esc_html( $menu_item[1] ); - $slug = str_replace( 'wpv-post-taxonomy', 'wpv-taxonomy', - $slug ); - } - /* $slug = esc_html($menu_item[1]); - $slug = str_replace('wpv-post-taxonomy', 'wpv-taxonomy', $slug); */ - } - - $link_text = $menu_item[0]; - if ( $param1 == 'Child View' ) { - $link_text = str_replace( ' - ' . __( 'Post View' ), '', - $link_text ); - $link_text = str_replace( ' - ' . __( 'Taxonomy View' ), '', - $link_text ); - $link_text = str_replace( ' - ' . __( 'User View' ), '', - $link_text ); - } - return '
              • ' . $link_text . "
              • \n"; - } - - // add parent items for Views and Content Templates - function wpv_add_parent_items( $items ) { - global $post, $pagenow; - - // ct-editor-deprecate - if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'view-template' ) { - $this->add_view_template_parent_groups( $items ); - } - - // @todo this should be also deprecated, no? - if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'view' ) { - - } else if ( $pagenow == 'post.php' && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) { - $post_type = $post->post_type; - - // todo deprecate? - // ct-editor-deprecate - if ( $post_type == 'view' ) { - $items = $this->add_view_parent_groups( $items ); - } else if ( $post_type == 'view-template' ) { - $items = $this->add_view_template_parent_groups( $items ); - } - } - - return $items; - } - - function add_view_parent_groups( $items ) { - - } - - // add parent groups for vew templates - function add_view_template_parent_groups( $items ) { - global $post, $WPV_settings; - // get current View ID - $view_template_id = $post->ID; - - // get all view templates attached in the Settings page for single view - $view_template_relations = $WPV_settings->get_view_template_settings(); - - // find view template groups and get their parents - $current_types = array(); - $parent_types = array(); - foreach ( $view_template_relations as $relation => $value ) { - if ( $value == $view_template_id ) { - $current_types[] = $relation; - if ( function_exists( 'wpcf_pr_get_belongs' ) ) { - $parent_types[] = wpcf_pr_get_belongs( $relation ); - } - } - } - - // get parent groups - $all_parent_groups = array(); - foreach ( $parent_types as $type ) { - foreach ( $type as $typename => $typeval ) { - $parent_groups = wpcf_admin_get_groups_by_post_type( $typename ); - } - } - - - } - - /** - * - * Sort menus (and menu content) in an alphabetical order - * - * Still, keep Basic and Taxonomy on the top and Other Fields at the bottom - * - * @param array $menu menu reference - */ - function sort_menus_alphabetically( $menus ) { - // keep main references if set (not set on every screen) - $menu_temp = array(); - $menu_names = array( - __( 'User View', 'wpv-views' ), - __( 'Taxonomy View', 'wpv-views' ), - __( 'Post View', 'wpv-views' ), - __( 'View', 'wpv-views' ), - __( 'Content Template', 'wpv-views' ), - __( 'Taxonomy', 'wpv-views' ), - __( 'Basic', 'wpv-views' ), - __( 'Other Fields', 'wpv-views' ) - ); - - foreach ( $menu_names as $name ) { - $menu_temp[$name] = isset( $menus[$name] ) ? $menus[$name] : array(); - } - - // remove them to preserve correct listing - foreach ( $menu_names as $name ) { - unset( $menus[$name] ); - } - - // sort all elements by key - ksort( $menus ); - - // add main elements in the correct order - foreach ( $menu_names as $name ) { - $menus = !empty( $menu_temp[$name] ) ? array_merge( array($name => $menu_temp[$name]), - $menus ) : $menus; - } - - // sort inner elements in the submenus - foreach ( $menus as $key => $menu_group ) { - if ( is_array( $menu_group ) ) { - ksort( $menu_group ); - } - } - - return $menus; - } - - function get_search_bar() { - $searchbar = ''; - return $searchbar; - } - - /** - * - * @global object $wpdb - * - */ - function add_view_type( &$menus, $post_type, $post_name ) { - global $wpdb; - $all_post_types = implode( ' ', - get_post_types( array('public' => true) ) ); - - $view_templates_available = $wpdb->get_results( - $wpdb->prepare( - "SELECT ID, post_title, post_name FROM {$wpdb->posts} - WHERE post_type = %s - AND post_status in (%s)", - $post_type, - 'publish' - ) - ); - $menus[$post_name] = array(); - $menus[$post_name]['css'] = $all_post_types; - - $vtemplate_index = 0; - foreach ( $view_templates_available as $vtemplate ) { - - $title = $vtemplate->post_title; - - if ( $post_type == 'view' ) { - $view_settings = get_post_meta( $vtemplate->ID, - '_wpv_settings', true ); - $title = $vtemplate->post_title . ' - ' . __( 'Post View', - 'wpv-views' ); - if ( isset( $view_settings['query_type'] ) && isset( $view_settings['query_type'][0] ) && $view_settings['query_type'][0] == 'taxonomy' ) { - $title = $vtemplate->post_title . ' - ' . __( 'Taxonomy View', - 'wpv-views' ); - if ( $post_name == __( 'Post View', 'wpv-views' ) || $post_name == __( 'User View', 'wpv-views' ) ) { - continue; - } - } elseif ( isset( $view_settings['query_type'] ) && isset( $view_settings['query_type'][0] ) && $view_settings['query_type'][0] == 'users' ) { - $title = $vtemplate->post_title . ' - ' . __( 'User View', - 'wpv-views' ); - if ( $post_name == __( 'Post View', 'wpv-views' ) || $post_name == __( 'Taxonomy View', 'wpv-views' ) ) { - continue; - } - } else { - if ( $post_name == __( 'Taxonomy View', 'wpv-views' ) || $post_name == __( 'User View', 'wpv-views' ) ) { - continue; - } - } - if ( isset( $view_settings['view-query-mode'] ) && $view_settings['view-query-mode'] =='archive' ){ - continue; - } - } - - $menus[$post_name][$vtemplate_index] = array(); - $menus[$post_name][$vtemplate_index][] = $title; - $menus[$post_name][$vtemplate_index][] = $vtemplate->post_name; - $menus[$post_name][$vtemplate_index][] = $post_name; - $menus[$post_name][$vtemplate_index][] = ''; - $vtemplate_index++; - } - } - } - -/* - Add the wpv_views button to the toolbar. - */ - function wpv_mce_add_button( $buttons ) - { - array_push( $buttons, "separator", str_replace( '-', '_', $this->name ) ); - return $buttons; - } - - /* - - Register this plugin as a mce 'addon' - Tell the mce editor the url of the javascript file. - */ - if( !function_exists('wpv_mce_register') ) - { - function wpv_mce_register( $plugin_array ) - { - $plugin_array[str_replace( '-', '_', $this->name )] = $this->plugin_js_url; - return $plugin_array; - } - } - - /** - * Renders JS for inserting shortcode from thickbox popup to editor. - * - * @param type $shortcode - */ - if( !function_exists('editor_admin_popup_insert_shortcode_js') ) - { - function editor_admin_popup_insert_shortcode_js( $shortcode ) { // Types now uses ColorBox, it's not used in Views anymore. Maybe DEPRECATED - - ?> - - and others - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/README.md b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/README.md deleted file mode 100644 index 77824eb..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# CodeMirror -[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror) -[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror) -[Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?again)](https://marijnhaverbeke.nl/fund/) - -CodeMirror is a versatile text editor implemented in JavaScript for -the browser. It is specialized for editing code, and comes with over -100 language modes and various addons that implement more advanced -editing functionality. - -A rich programming API and a CSS theming system are available for -customizing CodeMirror to fit your application, and extending it with -new functionality. - -You can find more information (and the -[manual](http://codemirror.net/doc/manual.html)) on the [project -page](http://codemirror.net). For questions and discussion, use the -[discussion forum](http://discuss.codemirror.net/). - -See -[CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md) -for contributing guidelines. - -The CodeMirror community aims to be welcoming to everybody. We use the -[Contributor Covenant -(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of -conduct. diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/comment.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/comment.js deleted file mode 100644 index 2dd114d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/comment.js +++ /dev/null @@ -1,183 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var noOptions = {}; - var nonWS = /[^\s\u00a0]/; - var Pos = CodeMirror.Pos; - - function firstNonWS(str) { - var found = str.search(nonWS); - return found == -1 ? 0 : found; - } - - CodeMirror.commands.toggleComment = function(cm) { - var minLine = Infinity, ranges = cm.listSelections(), mode = null; - for (var i = ranges.length - 1; i >= 0; i--) { - var from = ranges[i].from(), to = ranges[i].to(); - if (from.line >= minLine) continue; - if (to.line >= minLine) to = Pos(minLine, 0); - minLine = from.line; - if (mode == null) { - if (cm.uncomment(from, to)) mode = "un"; - else { cm.lineComment(from, to); mode = "line"; } - } else if (mode == "un") { - cm.uncomment(from, to); - } else { - cm.lineComment(from, to); - } - } - }; - - CodeMirror.defineExtension("lineComment", function(from, to, options) { - if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); - var commentString = options.lineComment || mode.lineComment; - if (!commentString) { - if (options.blockCommentStart || mode.blockCommentStart) { - options.fullLines = true; - self.blockComment(from, to, options); - } - return; - } - var firstLine = self.getLine(from.line); - if (firstLine == null) return; - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); - var pad = options.padding == null ? " " : options.padding; - var blankLines = options.commentBlankLines || from.line == to.line; - - self.operation(function() { - if (options.indent) { - var baseString = firstLine.slice(0, firstNonWS(firstLine)); - for (var i = from.line; i < end; ++i) { - var line = self.getLine(i), cut = baseString.length; - if (!blankLines && !nonWS.test(line)) continue; - if (line.slice(0, cut) != baseString) cut = firstNonWS(line); - self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut)); - } - } else { - for (var i = from.line; i < end; ++i) { - if (blankLines || nonWS.test(self.getLine(i))) - self.replaceRange(commentString + pad, Pos(i, 0)); - } - } - }); - }); - - CodeMirror.defineExtension("blockComment", function(from, to, options) { - if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) { - if ((options.lineComment || mode.lineComment) && options.fullLines != false) - self.lineComment(from, to, options); - return; - } - - var end = Math.min(to.line, self.lastLine()); - if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end; - - var pad = options.padding == null ? " " : options.padding; - if (from.line > end) return; - - self.operation(function() { - if (options.fullLines != false) { - var lastLineHasText = nonWS.test(self.getLine(end)); - self.replaceRange(pad + endString, Pos(end)); - self.replaceRange(startString + pad, Pos(from.line, 0)); - var lead = options.blockCommentLead || mode.blockCommentLead; - if (lead != null) for (var i = from.line + 1; i <= end; ++i) - if (i != end || lastLineHasText) - self.replaceRange(lead + pad, Pos(i, 0)); - } else { - self.replaceRange(endString, to); - self.replaceRange(startString, from); - } - }); - }); - - CodeMirror.defineExtension("uncomment", function(from, to, options) { - if (!options) options = noOptions; - var self = this, mode = self.getModeAt(from); - var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end); - - // Try finding line comments - var lineString = options.lineComment || mode.lineComment, lines = []; - var pad = options.padding == null ? " " : options.padding, didSomething; - lineComment: { - if (!lineString) break lineComment; - for (var i = start; i <= end; ++i) { - var line = self.getLine(i); - var found = line.indexOf(lineString); - if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; - if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment; - if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; - lines.push(line); - } - self.operation(function() { - for (var i = start; i <= end; ++i) { - var line = lines[i - start]; - var pos = line.indexOf(lineString), endPos = pos + lineString.length; - if (pos < 0) continue; - if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length; - didSomething = true; - self.replaceRange("", Pos(i, pos), Pos(i, endPos)); - } - }); - if (didSomething) return true; - } - - // Try block comments - var startString = options.blockCommentStart || mode.blockCommentStart; - var endString = options.blockCommentEnd || mode.blockCommentEnd; - if (!startString || !endString) return false; - var lead = options.blockCommentLead || mode.blockCommentLead; - var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end); - var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString); - if (close == -1 && start != end) { - endLine = self.getLine(--end); - close = endLine.lastIndexOf(endString); - } - if (open == -1 || close == -1 || - !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) || - !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1)))) - return false; - - // Avoid killing block comments completely outside the selection. - // Positions of the last startString before the start of the selection, and the first endString after it. - var lastStart = startLine.lastIndexOf(startString, from.ch); - var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length); - if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false; - // Positions of the first endString after the end of the selection, and the last startString before it. - firstEnd = endLine.indexOf(endString, to.ch); - var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch); - lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart; - if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false; - - self.operation(function() { - self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)), - Pos(end, close + endString.length)); - var openEnd = open + startString.length; - if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length; - self.replaceRange("", Pos(start, open), Pos(start, openEnd)); - if (lead) for (var i = start + 1; i <= end; ++i) { - var line = self.getLine(i), found = line.indexOf(lead); - if (found == -1 || nonWS.test(line.slice(0, found))) continue; - var foundEnd = found + lead.length; - if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length; - self.replaceRange("", Pos(i, found), Pos(i, foundEnd)); - } - }); - return true; - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/continuecomment.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/continuecomment.js deleted file mode 100644 index b11d51e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/continuecomment.js +++ /dev/null @@ -1,85 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var modes = ["clike", "css", "javascript"]; - - for (var i = 0; i < modes.length; ++i) - CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "}); - - function continueComment(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), mode, inserts = []; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].head, token = cm.getTokenAt(pos); - if (token.type != "comment") return CodeMirror.Pass; - var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode; - if (!mode) mode = modeHere; - else if (mode != modeHere) return CodeMirror.Pass; - - var insert = null; - if (mode.blockCommentStart && mode.blockCommentContinue) { - var end = token.string.indexOf(mode.blockCommentEnd); - var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found; - if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) { - // Comment ended, don't continue it - } else if (token.string.indexOf(mode.blockCommentStart) == 0) { - insert = full.slice(0, token.start); - if (!/^\s*$/.test(insert)) { - insert = ""; - for (var j = 0; j < token.start; ++j) insert += " "; - } - } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && - found + mode.blockCommentContinue.length > token.start && - /^\s*$/.test(full.slice(0, found))) { - insert = full.slice(0, found); - } - if (insert != null) insert += mode.blockCommentContinue; - } - if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) { - var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment); - if (found > -1) { - insert = line.slice(0, found); - if (/\S/.test(insert)) insert = null; - else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0]; - } - } - if (insert == null) return CodeMirror.Pass; - inserts[i] = "\n" + insert; - } - - cm.operation(function() { - for (var i = ranges.length - 1; i >= 0; i--) - cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+insert"); - }); - } - - function continueLineCommentEnabled(cm) { - var opt = cm.getOption("continueComments"); - if (opt && typeof opt == "object") - return opt.continueLineComment !== false; - return true; - } - - CodeMirror.defineOption("continueComments", null, function(cm, val, prev) { - if (prev && prev != CodeMirror.Init) - cm.removeKeyMap("continueComment"); - if (val) { - var key = "Enter"; - if (typeof val == "string") - key = val; - else if (typeof val == "object" && val.key) - key = val.key; - var map = {name: "continueComment"}; - map[key] = continueComment; - cm.addKeyMap(map); - } - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.css deleted file mode 100644 index 677c078..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.css +++ /dev/null @@ -1,32 +0,0 @@ -.CodeMirror-dialog { - position: absolute; - left: 0; right: 0; - background: inherit; - z-index: 15; - padding: .1em .8em; - overflow: hidden; - color: inherit; -} - -.CodeMirror-dialog-top { - border-bottom: 1px solid #eee; - top: 0; -} - -.CodeMirror-dialog-bottom { - border-top: 1px solid #eee; - bottom: 0; -} - -.CodeMirror-dialog input { - border: none; - outline: none; - background: transparent; - width: 20em; - color: inherit; - font-family: monospace; -} - -.CodeMirror-dialog button { - font-size: 70%; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.js deleted file mode 100644 index 323b200..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.js +++ /dev/null @@ -1,157 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Open simple dialogs on top of an editor. Relies on dialog.css. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - function dialogDiv(cm, template, bottom) { - var wrap = cm.getWrapperElement(); - var dialog; - dialog = wrap.appendChild(document.createElement("div")); - if (bottom) - dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom"; - else - dialog.className = "CodeMirror-dialog CodeMirror-dialog-top"; - - if (typeof template == "string") { - dialog.innerHTML = template; - } else { // Assuming it's a detached DOM element. - dialog.appendChild(template); - } - return dialog; - } - - function closeNotification(cm, newVal) { - if (cm.state.currentNotificationClose) - cm.state.currentNotificationClose(); - cm.state.currentNotificationClose = newVal; - } - - CodeMirror.defineExtension("openDialog", function(template, callback, options) { - if (!options) options = {}; - - closeNotification(this, null); - - var dialog = dialogDiv(this, template, options.bottom); - var closed = false, me = this; - function close(newVal) { - if (typeof newVal == 'string') { - inp.value = newVal; - } else { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - me.focus(); - - if (options.onClose) options.onClose(dialog); - } - } - - var inp = dialog.getElementsByTagName("input")[0], button; - if (inp) { - if (options.value) { - inp.value = options.value; - if (options.selectValueOnOpen !== false) { - inp.select(); - } - } - - if (options.onInput) - CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);}); - if (options.onKeyUp) - CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);}); - - CodeMirror.on(inp, "keydown", function(e) { - if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; } - if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) { - inp.blur(); - CodeMirror.e_stop(e); - close(); - } - if (e.keyCode == 13) callback(inp.value, e); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); - - inp.focus(); - } else if (button = dialog.getElementsByTagName("button")[0]) { - CodeMirror.on(button, "click", function() { - close(); - me.focus(); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); - - button.focus(); - } - return close; - }); - - CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) { - closeNotification(this, null); - var dialog = dialogDiv(this, template, options && options.bottom); - var buttons = dialog.getElementsByTagName("button"); - var closed = false, me = this, blurring = 1; - function close() { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - me.focus(); - } - buttons[0].focus(); - for (var i = 0; i < buttons.length; ++i) { - var b = buttons[i]; - (function(callback) { - CodeMirror.on(b, "click", function(e) { - CodeMirror.e_preventDefault(e); - close(); - if (callback) callback(me); - }); - })(callbacks[i]); - CodeMirror.on(b, "blur", function() { - --blurring; - setTimeout(function() { if (blurring <= 0) close(); }, 200); - }); - CodeMirror.on(b, "focus", function() { ++blurring; }); - } - }); - - /* - * openNotification - * Opens a notification, that can be closed with an optional timer - * (default 5000ms timer) and always closes on click. - * - * If a notification is opened while another is opened, it will close the - * currently opened one and open the new one immediately. - */ - CodeMirror.defineExtension("openNotification", function(template, options) { - closeNotification(this, close); - var dialog = dialogDiv(this, template, options && options.bottom); - var closed = false, doneTimer; - var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000; - - function close() { - if (closed) return; - closed = true; - clearTimeout(doneTimer); - dialog.parentNode.removeChild(dialog); - } - - CodeMirror.on(dialog, 'click', function(e) { - CodeMirror.e_preventDefault(e); - close(); - }); - - if (duration) - doneTimer = setTimeout(close, duration); - - return close; - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.css deleted file mode 100644 index 437acd8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.css +++ /dev/null @@ -1,6 +0,0 @@ -.CodeMirror-fullscreen { - position: fixed; - top: 0; left: 0; right: 0; bottom: 0; - height: auto; - z-index: 9; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.js deleted file mode 100644 index cd3673b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.js +++ /dev/null @@ -1,41 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { - if (old == CodeMirror.Init) old = false; - if (!old == !val) return; - if (val) setFullscreen(cm); - else setNormal(cm); - }); - - function setFullscreen(cm) { - var wrap = cm.getWrapperElement(); - cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, - width: wrap.style.width, height: wrap.style.height}; - wrap.style.width = ""; - wrap.style.height = "auto"; - wrap.className += " CodeMirror-fullscreen"; - document.documentElement.style.overflow = "hidden"; - cm.refresh(); - } - - function setNormal(cm) { - var wrap = cm.getWrapperElement(); - wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); - document.documentElement.style.overflow = ""; - var info = cm.state.fullScreenRestore; - wrap.style.width = info.width; wrap.style.height = info.height; - window.scrollTo(info.scrollLeft, info.scrollTop); - cm.refresh(); - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/panel.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/panel.js deleted file mode 100644 index ba29484..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/panel.js +++ /dev/null @@ -1,112 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineExtension("addPanel", function(node, options) { - options = options || {}; - - if (!this.state.panels) initPanels(this); - - var info = this.state.panels; - var wrapper = info.wrapper; - var cmWrapper = this.getWrapperElement(); - - if (options.after instanceof Panel && !options.after.cleared) { - wrapper.insertBefore(node, options.before.node.nextSibling); - } else if (options.before instanceof Panel && !options.before.cleared) { - wrapper.insertBefore(node, options.before.node); - } else if (options.replace instanceof Panel && !options.replace.cleared) { - wrapper.insertBefore(node, options.replace.node); - options.replace.clear(); - } else if (options.position == "bottom") { - wrapper.appendChild(node); - } else if (options.position == "before-bottom") { - wrapper.insertBefore(node, cmWrapper.nextSibling); - } else if (options.position == "after-top") { - wrapper.insertBefore(node, cmWrapper); - } else { - wrapper.insertBefore(node, wrapper.firstChild); - } - - var height = (options && options.height) || node.offsetHeight; - this._setSize(null, info.heightLeft -= height); - info.panels++; - return new Panel(this, node, options, height); - }); - - function Panel(cm, node, options, height) { - this.cm = cm; - this.node = node; - this.options = options; - this.height = height; - this.cleared = false; - } - - Panel.prototype.clear = function() { - if (this.cleared) return; - this.cleared = true; - var info = this.cm.state.panels; - this.cm._setSize(null, info.heightLeft += this.height); - info.wrapper.removeChild(this.node); - if (--info.panels == 0) removePanels(this.cm); - }; - - Panel.prototype.changed = function(height) { - var newHeight = height == null ? this.node.offsetHeight : height; - var info = this.cm.state.panels; - this.cm._setSize(null, info.height += (newHeight - this.height)); - this.height = newHeight; - }; - - function initPanels(cm) { - var wrap = cm.getWrapperElement(); - var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle; - var height = parseInt(style.height); - var info = cm.state.panels = { - setHeight: wrap.style.height, - heightLeft: height, - panels: 0, - wrapper: document.createElement("div") - }; - wrap.parentNode.insertBefore(info.wrapper, wrap); - var hasFocus = cm.hasFocus(); - info.wrapper.appendChild(wrap); - if (hasFocus) cm.focus(); - - cm._setSize = cm.setSize; - if (height != null) cm.setSize = function(width, newHeight) { - if (newHeight == null) return this._setSize(width, newHeight); - info.setHeight = newHeight; - if (typeof newHeight != "number") { - var px = /^(\d+\.?\d*)px$/.exec(newHeight); - if (px) { - newHeight = Number(px[1]); - } else { - info.wrapper.style.height = newHeight; - newHeight = info.wrapper.offsetHeight; - info.wrapper.style.height = ""; - } - } - cm._setSize(width, info.heightLeft += (newHeight - height)); - height = newHeight; - }; - } - - function removePanels(cm) { - var info = cm.state.panels; - cm.state.panels = null; - - var wrap = cm.getWrapperElement(); - info.wrapper.parentNode.replaceChild(wrap, info.wrapper); - wrap.style.height = info.setHeight; - cm.setSize = cm._setSize; - cm.setSize(); - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/placeholder.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/placeholder.js deleted file mode 100644 index bb0c393..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/placeholder.js +++ /dev/null @@ -1,58 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineOption("placeholder", "", function(cm, val, old) { - var prev = old && old != CodeMirror.Init; - if (val && !prev) { - cm.on("blur", onBlur); - cm.on("change", onChange); - onChange(cm); - } else if (!val && prev) { - cm.off("blur", onBlur); - cm.off("change", onChange); - clearPlaceholder(cm); - var wrapper = cm.getWrapperElement(); - wrapper.className = wrapper.className.replace(" CodeMirror-empty", ""); - } - - if (val && !cm.hasFocus()) onBlur(cm); - }); - - function clearPlaceholder(cm) { - if (cm.state.placeholder) { - cm.state.placeholder.parentNode.removeChild(cm.state.placeholder); - cm.state.placeholder = null; - } - } - function setPlaceholder(cm) { - clearPlaceholder(cm); - var elt = cm.state.placeholder = document.createElement("pre"); - elt.style.cssText = "height: 0; overflow: visible"; - elt.className = "CodeMirror-placeholder"; - elt.appendChild(document.createTextNode(cm.getOption("placeholder"))); - cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild); - } - - function onBlur(cm) { - if (isEmpty(cm)) setPlaceholder(cm); - } - function onChange(cm) { - var wrapper = cm.getWrapperElement(), empty = isEmpty(cm); - wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : ""); - - if (empty) setPlaceholder(cm); - else clearPlaceholder(cm); - } - - function isEmpty(cm) { - return (cm.lineCount() === 1) && (cm.getLine(0) === ""); - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/rulers.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/rulers.js deleted file mode 100644 index 01f6566..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/rulers.js +++ /dev/null @@ -1,63 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("rulers", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - clearRulers(cm); - cm.off("refresh", refreshRulers); - } - if (val && val.length) { - setRulers(cm); - cm.on("refresh", refreshRulers); - } - }); - - function clearRulers(cm) { - for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) { - var node = cm.display.lineSpace.childNodes[i]; - if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className)) - node.parentNode.removeChild(node); - } - } - - function setRulers(cm) { - var val = cm.getOption("rulers"); - var cw = cm.defaultCharWidth(); - var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left; - var minH = cm.display.scroller.offsetHeight + 30; - for (var i = 0; i < val.length; i++) { - var elt = document.createElement("div"); - elt.className = "CodeMirror-ruler"; - var col, conf = val[i]; - if (typeof conf == "number") { - col = conf; - } else { - col = conf.column; - if (conf.className) elt.className += " " + conf.className; - if (conf.color) elt.style.borderColor = conf.color; - if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle; - if (conf.width) elt.style.borderLeftWidth = conf.width; - } - elt.style.left = (left + col * cw) + "px"; - elt.style.top = "-50px"; - elt.style.bottom = "-20px"; - elt.style.minHeight = minH + "px"; - cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv); - } - } - - function refreshRulers(cm) { - clearRulers(cm); - setRulers(cm); - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closebrackets.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closebrackets.js deleted file mode 100644 index 7030268..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closebrackets.js +++ /dev/null @@ -1,185 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var defaults = { - pairs: "()[]{}''\"\"", - triples: "", - explode: "[]{}" - }; - - var Pos = CodeMirror.Pos; - - CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.removeKeyMap(keyMap); - cm.state.closeBrackets = null; - } - if (val) { - cm.state.closeBrackets = val; - cm.addKeyMap(keyMap); - } - }); - - function getOption(conf, name) { - if (name == "pairs" && typeof conf == "string") return conf; - if (typeof conf == "object" && conf[name] != null) return conf[name]; - return defaults[name]; - } - - var bind = defaults.pairs + "`"; - var keyMap = {Backspace: handleBackspace, Enter: handleEnter}; - for (var i = 0; i < bind.length; i++) - keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i)); - - function handler(ch) { - return function(cm) { return handleChar(cm, ch); }; - } - - function getConfig(cm) { - var deflt = cm.state.closeBrackets; - if (!deflt) return null; - var mode = cm.getModeAt(cm.getCursor()); - return mode.closeBrackets || deflt; - } - - function handleBackspace(cm) { - var conf = getConfig(cm); - if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; - - var pairs = getOption(conf, "pairs"); - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - for (var i = ranges.length - 1; i >= 0; i--) { - var cur = ranges[i].head; - cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); - } - } - - function handleEnter(cm) { - var conf = getConfig(cm); - var explode = conf && getOption(conf, "explode"); - if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; - - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - cm.operation(function() { - cm.replaceSelection("\n\n", null); - cm.execCommand("goCharLeft"); - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var line = ranges[i].head.line; - cm.indentLine(line, null, true); - cm.indentLine(line + 1, null, true); - } - }); - } - - function handleChar(cm, ch) { - var conf = getConfig(cm); - if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; - - var pairs = getOption(conf, "pairs"); - var pos = pairs.indexOf(ch); - if (pos == -1) return CodeMirror.Pass; - var triples = getOption(conf, "triples"); - - var identical = pairs.charAt(pos + 1) == ch; - var ranges = cm.listSelections(); - var opening = pos % 2 == 0; - - var type, next; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], cur = range.head, curType; - var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); - if (opening && !range.empty()) { - curType = "surround"; - } else if ((identical || !opening) && next == ch) { - if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) - curType = "skipThree"; - else - curType = "skip"; - } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && - cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch && - (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) { - curType = "addFour"; - } else if (identical) { - if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both"; - else return CodeMirror.Pass; - } else if (opening && (cm.getLine(cur.line).length == cur.ch || - isClosingBracket(next, pairs) || - /\s/.test(next))) { - curType = "both"; - } else { - return CodeMirror.Pass; - } - if (!type) type = curType; - else if (type != curType) return CodeMirror.Pass; - } - - var left = pos % 2 ? pairs.charAt(pos - 1) : ch; - var right = pos % 2 ? ch : pairs.charAt(pos + 1); - cm.operation(function() { - if (type == "skip") { - cm.execCommand("goCharRight"); - } else if (type == "skipThree") { - for (var i = 0; i < 3; i++) - cm.execCommand("goCharRight"); - } else if (type == "surround") { - var sels = cm.getSelections(); - for (var i = 0; i < sels.length; i++) - sels[i] = left + sels[i] + right; - cm.replaceSelections(sels, "around"); - } else if (type == "both") { - cm.replaceSelection(left + right, null); - cm.triggerElectric(left + right); - cm.execCommand("goCharLeft"); - } else if (type == "addFour") { - cm.replaceSelection(left + left + left + left, "before"); - cm.execCommand("goCharRight"); - } - }); - } - - function isClosingBracket(ch, pairs) { - var pos = pairs.lastIndexOf(ch); - return pos > -1 && pos % 2 == 1; - } - - function charsAround(cm, pos) { - var str = cm.getRange(Pos(pos.line, pos.ch - 1), - Pos(pos.line, pos.ch + 1)); - return str.length == 2 ? str : null; - } - - // Project the token type that will exists after the given char is - // typed, and use it to determine whether it would cause the start - // of a string token. - function enteringString(cm, pos, ch) { - var line = cm.getLine(pos.line); - var token = cm.getTokenAt(pos); - if (/\bstring2?\b/.test(token.type)) return false; - var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4); - stream.pos = stream.start = token.start; - for (;;) { - var type1 = cm.getMode().token(stream, token.state); - if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1); - stream.start = stream.pos; - } - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closetag.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closetag.js deleted file mode 100644 index e68d52d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closetag.js +++ /dev/null @@ -1,166 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Tag-closer extension for CodeMirror. - * - * This extension adds an "autoCloseTags" option that can be set to - * either true to get the default behavior, or an object to further - * configure its behavior. - * - * These are supported options: - * - * `whenClosing` (default true) - * Whether to autoclose when the '/' of a closing tag is typed. - * `whenOpening` (default true) - * Whether to autoclose the tag when the final '>' of an opening - * tag is typed. - * `dontCloseTags` (default is empty tags for HTML, none for XML) - * An array of tag names that should not be autoclosed. - * `indentTags` (default is block tags for HTML, none for XML) - * An array of tag names that should, when opened, cause a - * blank line to be added inside the tag, and the blank line and - * closing line to be indented. - * - * See demos/closetag.html for a usage example. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../fold/xml-fold")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../fold/xml-fold"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) { - if (old != CodeMirror.Init && old) - cm.removeKeyMap("autoCloseTags"); - if (!val) return; - var map = {name: "autoCloseTags"}; - if (typeof val != "object" || val.whenClosing) - map["'/'"] = function(cm) { return autoCloseSlash(cm); }; - if (typeof val != "object" || val.whenOpening) - map["'>'"] = function(cm) { return autoCloseGT(cm); }; - cm.addKeyMap(map); - }); - - var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", - "source", "track", "wbr"]; - var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", - "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; - - function autoCloseGT(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), replacements = []; - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var pos = ranges[i].head, tok = cm.getTokenAt(pos); - var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; - if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass; - - var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; - var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); - var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); - - var tagName = state.tagName; - if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); - var lowerTagName = tagName.toLowerCase(); - // Don't process the '>' at the end of an end-tag or self-closing tag - if (!tagName || - tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) || - tok.type == "tag" && state.type == "closeTag" || - tok.string.indexOf("/") == (tok.string.length - 1) || // match something like - dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 || - closingTagExists(cm, tagName, pos, state, true)) - return CodeMirror.Pass; - - var indent = indentTags && indexOf(indentTags, lowerTagName) > -1; - replacements[i] = {indent: indent, - text: ">" + (indent ? "\n\n" : "") + "", - newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)}; - } - - for (var i = ranges.length - 1; i >= 0; i--) { - var info = replacements[i]; - cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert"); - var sel = cm.listSelections().slice(0); - sel[i] = {head: info.newPos, anchor: info.newPos}; - cm.setSelections(sel); - if (info.indent) { - cm.indentLine(info.newPos.line, null, true); - cm.indentLine(info.newPos.line + 1, null, true); - } - } - } - - function autoCloseCurrent(cm, typingSlash) { - var ranges = cm.listSelections(), replacements = []; - var head = typingSlash ? "/" : ""; - else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css") - replacements[i] = head + "style>"; - else - return CodeMirror.Pass; - } else { - if (!state.context || !state.context.tagName || - closingTagExists(cm, state.context.tagName, pos, state)) - return CodeMirror.Pass; - replacements[i] = head + state.context.tagName + ">"; - } - } - cm.replaceSelections(replacements); - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) - if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line) - cm.indentLine(ranges[i].head.line); - } - - function autoCloseSlash(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - return autoCloseCurrent(cm, true); - } - - CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); }; - - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; - } - - // If xml-fold is loaded, we use its functionality to try and verify - // whether a given tag is actually unclosed. - function closingTagExists(cm, tagName, pos, state, newTag) { - if (!CodeMirror.scanForClosingTag) return false; - var end = Math.min(cm.lastLine() + 1, pos.line + 500); - var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end); - if (!nextClose || nextClose.tag != tagName) return false; - var cx = state.context; - // If the immediate wrapping context contains onCx instances of - // the same tag, a closing tag only exists if there are at least - // that many closing tags of that type following. - for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx; - pos = nextClose.to; - for (var i = 1; i < onCx; i++) { - var next = CodeMirror.scanForClosingTag(cm, pos, null, end); - if (!next || next.tag != tagName) return false; - pos = next.to; - } - return true; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/continuelist.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/continuelist.js deleted file mode 100644 index df5179f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/continuelist.js +++ /dev/null @@ -1,51 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/, - emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/, - unorderedListRE = /[*+-]\s/; - - CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), replacements = []; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].head; - var eolState = cm.getStateAfter(pos.line); - var inList = eolState.list !== false; - var inQuote = eolState.quote !== 0; - - var line = cm.getLine(pos.line), match = listRE.exec(line); - if (!ranges[i].empty() || (!inList && !inQuote) || !match) { - cm.execCommand("newlineAndIndent"); - return; - } - if (emptyListRE.test(line)) { - cm.replaceRange("", { - line: pos.line, ch: 0 - }, { - line: pos.line, ch: pos.ch + 1 - }); - replacements[i] = "\n"; - } else { - var indent = match[1], after = match[5]; - var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 - ? match[2] - : (parseInt(match[3], 10) + 1) + match[4]; - - replacements[i] = "\n" + indent + bullet + after; - } - } - - cm.replaceSelections(replacements); - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchbrackets.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchbrackets.js deleted file mode 100644 index 70e1ae1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchbrackets.js +++ /dev/null @@ -1,120 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && - (document.documentMode == null || document.documentMode < 8); - - var Pos = CodeMirror.Pos; - - var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - - function findMatchingBracket(cm, where, strict, config) { - var line = cm.getLineHandle(where.line), pos = where.ch - 1; - var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; - if (!match) return null; - var dir = match.charAt(1) == ">" ? 1 : -1; - if (strict && (dir > 0) != (pos == where.ch)) return null; - var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); - - var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); - if (found == null) return null; - return {from: Pos(where.line, pos), to: found && found.pos, - match: found && found.ch == match.charAt(0), forward: dir > 0}; - } - - // bracketRegex is used to specify which type of bracket to scan - // should be a regexp, e.g. /[[\]]/ - // - // Note: If "where" is on an open bracket, then this bracket is ignored. - // - // Returns false when no bracket was found, null when it reached - // maxScanLines and gave up - function scanForBracket(cm, where, dir, style, config) { - var maxScanLen = (config && config.maxScanLineLength) || 10000; - var maxScanLines = (config && config.maxScanLines) || 1000; - - var stack = []; - var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; - var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) - : Math.max(cm.firstLine() - 1, where.line - maxScanLines); - for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { - var line = cm.getLine(lineNo); - if (!line) continue; - var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1; - if (line.length > maxScanLen) continue; - if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); - for (; pos != end; pos += dir) { - var ch = line.charAt(pos); - if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { - var match = matching[ch]; - if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); - else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; - else stack.pop(); - } - } - } - return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; - } - - function matchBrackets(cm, autoclear, config) { - // Disable brace matching in long lines, since it'll cause hugely slow updates - var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; - var marks = [], ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config); - if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { - var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); - if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) - marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style})); - } - } - - if (marks.length) { - // Kludge to work around the IE bug from issue #1193, where text - // input stops going to the textare whever this fires. - if (ie_lt8 && cm.state.focused) cm.focus(); - - var clear = function() { - cm.operation(function() { - for (var i = 0; i < marks.length; i++) marks[i].clear(); - }); - }; - if (autoclear) setTimeout(clear, 800); - else return clear; - } - } - - var currentlyHighlighted = null; - function doMatchBrackets(cm) { - cm.operation(function() { - if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} - currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); - }); - } - - CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) - cm.off("cursorActivity", doMatchBrackets); - if (val) { - cm.state.matchBrackets = typeof val == "object" ? val : {}; - cm.on("cursorActivity", doMatchBrackets); - } - }); - - CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); - CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){ - return findMatchingBracket(this, pos, strict, config); - }); - CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){ - return scanForBracket(this, pos, dir, style, config); - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchtags.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchtags.js deleted file mode 100644 index fb1911a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchtags.js +++ /dev/null @@ -1,66 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../fold/xml-fold")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../fold/xml-fold"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("matchTags", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.off("cursorActivity", doMatchTags); - cm.off("viewportChange", maybeUpdateMatch); - clear(cm); - } - if (val) { - cm.state.matchBothTags = typeof val == "object" && val.bothTags; - cm.on("cursorActivity", doMatchTags); - cm.on("viewportChange", maybeUpdateMatch); - doMatchTags(cm); - } - }); - - function clear(cm) { - if (cm.state.tagHit) cm.state.tagHit.clear(); - if (cm.state.tagOther) cm.state.tagOther.clear(); - cm.state.tagHit = cm.state.tagOther = null; - } - - function doMatchTags(cm) { - cm.state.failedTagMatch = false; - cm.operation(function() { - clear(cm); - if (cm.somethingSelected()) return; - var cur = cm.getCursor(), range = cm.getViewport(); - range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to); - var match = CodeMirror.findMatchingTag(cm, cur, range); - if (!match) return; - if (cm.state.matchBothTags) { - var hit = match.at == "open" ? match.open : match.close; - if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"}); - } - var other = match.at == "close" ? match.open : match.close; - if (other) - cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); - else - cm.state.failedTagMatch = true; - }); - } - - function maybeUpdateMatch(cm) { - if (cm.state.failedTagMatch) doMatchTags(cm); - } - - CodeMirror.commands.toMatchingTag = function(cm) { - var found = CodeMirror.findMatchingTag(cm, cm.getCursor()); - if (found) { - var other = found.at == "close" ? found.open : found.close; - if (other) cm.extendSelection(other.to, other.from); - } - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/trailingspace.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/trailingspace.js deleted file mode 100644 index fa7b56b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/trailingspace.js +++ /dev/null @@ -1,27 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { - if (prev == CodeMirror.Init) prev = false; - if (prev && !val) - cm.removeOverlay("trailingspace"); - else if (!prev && val) - cm.addOverlay({ - token: function(stream) { - for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} - if (i > stream.pos) { stream.pos = i; return null; } - stream.pos = l; - return "trailingspace"; - }, - name: "trailingspace" - }); - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/brace-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/brace-fold.js deleted file mode 100644 index 1605f6c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/brace-fold.js +++ /dev/null @@ -1,105 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("fold", "brace", function(cm, start) { - var line = start.line, lineText = cm.getLine(line); - var startCh, tokenType; - - function findOpening(openCh) { - for (var at = start.ch, pass = 0;;) { - var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1); - if (found == -1) { - if (pass == 1) break; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found < start.ch) break; - tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)); - if (!/^(comment|string)/.test(tokenType)) return found + 1; - at = found - 1; - } - } - - var startToken = "{", endToken = "}", startCh = findOpening("{"); - if (startCh == null) { - startToken = "[", endToken = "]"; - startCh = findOpening("["); - } - - if (startCh == null) return; - var count = 1, lastLine = cm.lastLine(), end, endCh; - outer: for (var i = line; i <= lastLine; ++i) { - var text = cm.getLine(i), pos = i == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) { - if (pos == nextOpen) ++count; - else if (!--count) { end = i; endCh = pos; break outer; } - } - ++pos; - } - } - if (end == null || line == end && endCh == startCh) return; - return {from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh)}; -}); - -CodeMirror.registerHelper("fold", "import", function(cm, start) { - function hasImport(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type != "keyword" || start.string != "import") return null; - // Now find closing semicolon, return its position - for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { - var text = cm.getLine(i), semi = text.indexOf(";"); - if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)}; - } - } - - var start = start.line, has = hasImport(start), prev; - if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) - return null; - for (var end = has.end;;) { - var next = hasImport(end.line + 1); - if (next == null) break; - end = next.end; - } - return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; -}); - -CodeMirror.registerHelper("fold", "include", function(cm, start) { - function hasInclude(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; - } - - var start = start.line, has = hasInclude(start); - if (has == null || hasInclude(start - 1) != null) return null; - for (var end = start;;) { - var next = hasInclude(end + 1); - if (next == null) break; - ++end; - } - return {from: CodeMirror.Pos(start, has + 1), - to: cm.clipPos(CodeMirror.Pos(end))}; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/comment-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/comment-fold.js deleted file mode 100644 index b75db7e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/comment-fold.js +++ /dev/null @@ -1,57 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerGlobalHelper("fold", "comment", function(mode) { - return mode.blockCommentStart && mode.blockCommentEnd; -}, function(cm, start) { - var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd; - if (!startToken || !endToken) return; - var line = start.line, lineText = cm.getLine(line); - - var startCh; - for (var at = start.ch, pass = 0;;) { - var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1); - if (found == -1) { - if (pass == 1) return; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found < start.ch) return; - if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) { - startCh = found + startToken.length; - break; - } - at = found - 1; - } - - var depth = 1, lastLine = cm.lastLine(), end, endCh; - outer: for (var i = line; i <= lastLine; ++i) { - var text = cm.getLine(i), pos = i == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (pos == nextOpen) ++depth; - else if (!--depth) { end = i; endCh = pos; break outer; } - ++pos; - } - } - if (end == null || line == end && endCh == startCh) return; - return {from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh)}; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldcode.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldcode.js deleted file mode 100644 index 62911f9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldcode.js +++ /dev/null @@ -1,149 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function doFold(cm, pos, options, force) { - if (options && options.call) { - var finder = options; - options = null; - } else { - var finder = getOption(cm, options, "rangeFinder"); - } - if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); - var minSize = getOption(cm, options, "minFoldSize"); - - function getRange(allowFolded) { - var range = finder(cm, pos); - if (!range || range.to.line - range.from.line < minSize) return null; - var marks = cm.findMarksAt(range.from); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold && force !== "fold") { - if (!allowFolded) return null; - range.cleared = true; - marks[i].clear(); - } - } - return range; - } - - var range = getRange(true); - if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { - pos = CodeMirror.Pos(pos.line - 1, 0); - range = getRange(false); - } - if (!range || range.cleared || force === "unfold") return; - - var myWidget = makeWidget(cm, options); - CodeMirror.on(myWidget, "mousedown", function(e) { - myRange.clear(); - CodeMirror.e_preventDefault(e); - }); - var myRange = cm.markText(range.from, range.to, { - replacedWith: myWidget, - clearOnEnter: true, - __isFold: true - }); - myRange.on("clear", function(from, to) { - CodeMirror.signal(cm, "unfold", cm, from, to); - }); - CodeMirror.signal(cm, "fold", cm, range.from, range.to); - } - - function makeWidget(cm, options) { - var widget = getOption(cm, options, "widget"); - if (typeof widget == "string") { - var text = document.createTextNode(widget); - widget = document.createElement("span"); - widget.appendChild(text); - widget.className = "CodeMirror-foldmarker"; - } - return widget; - } - - // Clumsy backwards-compatible interface - CodeMirror.newFoldFunction = function(rangeFinder, widget) { - return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; - }; - - // New-style interface - CodeMirror.defineExtension("foldCode", function(pos, options, force) { - doFold(this, pos, options, force); - }); - - CodeMirror.defineExtension("isFolded", function(pos) { - var marks = this.findMarksAt(pos); - for (var i = 0; i < marks.length; ++i) - if (marks[i].__isFold) return true; - }); - - CodeMirror.commands.toggleFold = function(cm) { - cm.foldCode(cm.getCursor()); - }; - CodeMirror.commands.fold = function(cm) { - cm.foldCode(cm.getCursor(), null, "fold"); - }; - CodeMirror.commands.unfold = function(cm) { - cm.foldCode(cm.getCursor(), null, "unfold"); - }; - CodeMirror.commands.foldAll = function(cm) { - cm.operation(function() { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) - cm.foldCode(CodeMirror.Pos(i, 0), null, "fold"); - }); - }; - CodeMirror.commands.unfoldAll = function(cm) { - cm.operation(function() { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) - cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold"); - }); - }; - - CodeMirror.registerHelper("fold", "combine", function() { - var funcs = Array.prototype.slice.call(arguments, 0); - return function(cm, start) { - for (var i = 0; i < funcs.length; ++i) { - var found = funcs[i](cm, start); - if (found) return found; - } - }; - }); - - CodeMirror.registerHelper("fold", "auto", function(cm, start) { - var helpers = cm.getHelpers(start, "fold"); - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, start); - if (cur) return cur; - } - }); - - var defaultOptions = { - rangeFinder: CodeMirror.fold.auto, - widget: "\u2194", - minFoldSize: 0, - scanUp: false - }; - - CodeMirror.defineOption("foldOptions", null); - - function getOption(cm, options, name) { - if (options && options[name] !== undefined) - return options[name]; - var editorOptions = cm.options.foldOptions; - if (editorOptions && editorOptions[name] !== undefined) - return editorOptions[name]; - return defaultOptions[name]; - } - - CodeMirror.defineExtension("foldOption", function(options, name) { - return getOption(this, options, name); - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.css deleted file mode 100644 index ad19ae2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.css +++ /dev/null @@ -1,20 +0,0 @@ -.CodeMirror-foldmarker { - color: blue; - text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; - font-family: arial; - line-height: .3; - cursor: pointer; -} -.CodeMirror-foldgutter { - width: .7em; -} -.CodeMirror-foldgutter-open, -.CodeMirror-foldgutter-folded { - cursor: pointer; -} -.CodeMirror-foldgutter-open:after { - content: "\25BE"; -} -.CodeMirror-foldgutter-folded:after { - content: "\25B8"; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.js deleted file mode 100644 index ed7bd87..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.js +++ /dev/null @@ -1,146 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./foldcode")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./foldcode"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("foldGutter", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.clearGutter(cm.state.foldGutter.options.gutter); - cm.state.foldGutter = null; - cm.off("gutterClick", onGutterClick); - cm.off("change", onChange); - cm.off("viewportChange", onViewportChange); - cm.off("fold", onFold); - cm.off("unfold", onFold); - cm.off("swapDoc", updateInViewport); - } - if (val) { - cm.state.foldGutter = new State(parseOptions(val)); - updateInViewport(cm); - cm.on("gutterClick", onGutterClick); - cm.on("change", onChange); - cm.on("viewportChange", onViewportChange); - cm.on("fold", onFold); - cm.on("unfold", onFold); - cm.on("swapDoc", updateInViewport); - } - }); - - var Pos = CodeMirror.Pos; - - function State(options) { - this.options = options; - this.from = this.to = 0; - } - - function parseOptions(opts) { - if (opts === true) opts = {}; - if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; - if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; - if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; - return opts; - } - - function isFolded(cm, line) { - var marks = cm.findMarksAt(Pos(line)); - for (var i = 0; i < marks.length; ++i) - if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i]; - } - - function marker(spec) { - if (typeof spec == "string") { - var elt = document.createElement("div"); - elt.className = spec + " CodeMirror-guttermarker-subtle"; - return elt; - } else { - return spec.cloneNode(true); - } - } - - function updateFoldInfo(cm, from, to) { - var opts = cm.state.foldGutter.options, cur = from; - var minSize = cm.foldOption(opts, "minFoldSize"); - var func = cm.foldOption(opts, "rangeFinder"); - cm.eachLine(from, to, function(line) { - var mark = null; - if (isFolded(cm, cur)) { - mark = marker(opts.indicatorFolded); - } else { - var pos = Pos(cur, 0); - var range = func && func(cm, pos); - if (range && range.to.line - range.from.line >= minSize) - mark = marker(opts.indicatorOpen); - } - cm.setGutterMarker(line, opts.gutter, mark); - ++cur; - }); - } - - function updateInViewport(cm) { - var vp = cm.getViewport(), state = cm.state.foldGutter; - if (!state) return; - cm.operation(function() { - updateFoldInfo(cm, vp.from, vp.to); - }); - state.from = vp.from; state.to = vp.to; - } - - function onGutterClick(cm, line, gutter) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - if (gutter != opts.gutter) return; - var folded = isFolded(cm, line); - if (folded) folded.clear(); - else cm.foldCode(Pos(line, 0), opts.rangeFinder); - } - - function onChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - state.from = state.to = 0; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600); - } - - function onViewportChange(cm) { - var state = cm.state.foldGutter; - if (!state) return; - var opts = state.options; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { - var vp = cm.getViewport(); - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - updateInViewport(cm); - } else { - cm.operation(function() { - if (vp.from < state.from) { - updateFoldInfo(cm, vp.from, state.from); - state.from = vp.from; - } - if (vp.to > state.to) { - updateFoldInfo(cm, state.to, vp.to); - state.to = vp.to; - } - }); - } - }, opts.updateViewportTimeSpan || 400); - } - - function onFold(cm, from) { - var state = cm.state.foldGutter; - if (!state) return; - var line = from.line; - if (line >= state.from && line < state.to) - updateFoldInfo(cm, line, line + 1); - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/indent-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/indent-fold.js deleted file mode 100644 index e29f15e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/indent-fold.js +++ /dev/null @@ -1,44 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("fold", "indent", function(cm, start) { - var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); - if (!/\S/.test(firstLine)) return; - var getIndent = function(line) { - return CodeMirror.countColumn(line, null, tabSize); - }; - var myIndent = getIndent(firstLine); - var lastLineInFold = null; - // Go through lines until we find a line that definitely doesn't belong in - // the block we're folding, or to the end. - for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { - var curLine = cm.getLine(i); - var curIndent = getIndent(curLine); - if (curIndent > myIndent) { - // Lines with a greater indent are considered part of the block. - lastLineInFold = i; - } else if (!/\S/.test(curLine)) { - // Empty lines might be breaks within the block we're trying to fold. - } else { - // A non-empty line at an indent equal to or less than ours marks the - // start of another block. - break; - } - } - if (lastLineInFold) return { - from: CodeMirror.Pos(start.line, firstLine.length), - to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) - }; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/markdown-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/markdown-fold.js deleted file mode 100644 index ce84c94..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/markdown-fold.js +++ /dev/null @@ -1,49 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("fold", "markdown", function(cm, start) { - var maxDepth = 100; - - function isHeader(lineNo) { - var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); - return tokentype && /\bheader\b/.test(tokentype); - } - - function headerLevel(lineNo, line, nextLine) { - var match = line && line.match(/^#+/); - if (match && isHeader(lineNo)) return match[0].length; - match = nextLine && nextLine.match(/^[=\-]+\s*$/); - if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; - return maxDepth; - } - - var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); - var level = headerLevel(start.line, firstLine, nextLine); - if (level === maxDepth) return undefined; - - var lastLineNo = cm.lastLine(); - var end = start.line, nextNextLine = cm.getLine(end + 2); - while (end < lastLineNo) { - if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; - ++end; - nextLine = nextNextLine; - nextNextLine = cm.getLine(end + 2); - } - - return { - from: CodeMirror.Pos(start.line, firstLine.length), - to: CodeMirror.Pos(end, cm.getLine(end).length) - }; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/xml-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/xml-fold.js deleted file mode 100644 index 504727f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/xml-fold.js +++ /dev/null @@ -1,182 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - function cmp(a, b) { return a.line - b.line || a.ch - b.ch; } - - var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; - var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g"); - - function Iter(cm, line, ch, range) { - this.line = line; this.ch = ch; - this.cm = cm; this.text = cm.getLine(line); - this.min = range ? range.from : cm.firstLine(); - this.max = range ? range.to - 1 : cm.lastLine(); - } - - function tagAt(iter, ch) { - var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch)); - return type && /\btag\b/.test(type); - } - - function nextLine(iter) { - if (iter.line >= iter.max) return; - iter.ch = 0; - iter.text = iter.cm.getLine(++iter.line); - return true; - } - function prevLine(iter) { - if (iter.line <= iter.min) return; - iter.text = iter.cm.getLine(--iter.line); - iter.ch = iter.text.length; - return true; - } - - function toTagEnd(iter) { - for (;;) { - var gt = iter.text.indexOf(">", iter.ch); - if (gt == -1) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - function toTagStart(iter) { - for (;;) { - var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1; - if (lt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; } - xmlTagStart.lastIndex = lt; - iter.ch = lt; - var match = xmlTagStart.exec(iter.text); - if (match && match.index == lt) return match; - } - } - - function toNextTag(iter) { - for (;;) { - xmlTagStart.lastIndex = iter.ch; - var found = xmlTagStart.exec(iter.text); - if (!found) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; } - iter.ch = found.index + found[0].length; - return found; - } - } - function toPrevTag(iter) { - for (;;) { - var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1; - if (gt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - - function findMatchingClose(iter, tag) { - var stack = []; - for (;;) { - var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0); - if (!next || !(end = toTagEnd(iter))) return; - if (end == "selfClose") continue; - if (next[1]) { // closing tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == next[2])) return { - tag: next[2], - from: Pos(startLine, startCh), - to: Pos(iter.line, iter.ch) - }; - } else { // opening tag - stack.push(next[2]); - } - } - } - function findMatchingOpen(iter, tag) { - var stack = []; - for (;;) { - var prev = toPrevTag(iter); - if (!prev) return; - if (prev == "selfClose") { toTagStart(iter); continue; } - var endLine = iter.line, endCh = iter.ch; - var start = toTagStart(iter); - if (!start) return; - if (start[1]) { // closing tag - stack.push(start[2]); - } else { // opening tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == start[2])) return { - tag: start[2], - from: Pos(iter.line, iter.ch), - to: Pos(endLine, endCh) - }; - } - } - } - - CodeMirror.registerHelper("fold", "xml", function(cm, start) { - var iter = new Iter(cm, start.line, 0); - for (;;) { - var openTag = toNextTag(iter), end; - if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; - if (!openTag[1] && end != "selfClose") { - var start = Pos(iter.line, iter.ch); - var close = findMatchingClose(iter, openTag[2]); - return close && {from: start, to: close.from}; - } - } - }); - CodeMirror.findMatchingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return; - var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch); - var start = end && toTagStart(iter); - if (!end || !start || cmp(iter, pos) > 0) return; - var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]}; - if (end == "selfClose") return {open: here, close: null, at: "open"}; - - if (start[1]) { // closing tag - return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"}; - } else { // opening tag - iter = new Iter(cm, to.line, to.ch, range); - return {open: here, close: findMatchingClose(iter, start[2]), at: "open"}; - } - }; - - CodeMirror.findEnclosingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - for (;;) { - var open = findMatchingOpen(iter); - if (!open) break; - var forward = new Iter(cm, pos.line, pos.ch, range); - var close = findMatchingClose(forward, open.tag); - if (close) return {open: open, close: close}; - } - }; - - // Used by addon/edit/closetag.js - CodeMirror.scanForClosingTag = function(cm, pos, name, end) { - var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null); - return findMatchingClose(iter, name); - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/anyword-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/anyword-hint.js deleted file mode 100644 index 8e74a92..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/anyword-hint.js +++ /dev/null @@ -1,41 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var WORD = /[\w$]+/, RANGE = 500; - - CodeMirror.registerHelper("hint", "anyword", function(editor, options) { - var word = options && options.word || WORD; - var range = options && options.range || RANGE; - var cur = editor.getCursor(), curLine = editor.getLine(cur.line); - var end = cur.ch, start = end; - while (start && word.test(curLine.charAt(start - 1))) --start; - var curWord = start != end && curLine.slice(start, end); - - var list = [], seen = {}; - var re = new RegExp(word.source, "g"); - for (var dir = -1; dir <= 1; dir += 2) { - var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; - for (; line != endLine; line += dir) { - var text = editor.getLine(line), m; - while (m = re.exec(text)) { - if (line == cur.line && m[0] === curWord) continue; - if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { - seen[m[0]] = true; - list.push(m[0]); - } - } - } - } - return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/css-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/css-hint.js deleted file mode 100644 index 2264272..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/css-hint.js +++ /dev/null @@ -1,60 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../mode/css/css")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../mode/css/css"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var pseudoClasses = {link: 1, visited: 1, active: 1, hover: 1, focus: 1, - "first-letter": 1, "first-line": 1, "first-child": 1, - before: 1, after: 1, lang: 1}; - - CodeMirror.registerHelper("hint", "css", function(cm) { - var cur = cm.getCursor(), token = cm.getTokenAt(cur); - var inner = CodeMirror.innerMode(cm.getMode(), token.state); - if (inner.mode.name != "css") return; - - if (token.type == "keyword" && "!important".indexOf(token.string) == 0) - return {list: ["!important"], from: CodeMirror.Pos(cur.line, token.start), - to: CodeMirror.Pos(cur.line, token.end)}; - - var start = token.start, end = cur.ch, word = token.string.slice(0, end - start); - if (/[^\w$_-]/.test(word)) { - word = ""; start = end = cur.ch; - } - - var spec = CodeMirror.resolveMode("text/css"); - - var result = []; - function add(keywords) { - for (var name in keywords) - if (!word || name.lastIndexOf(word, 0) == 0) - result.push(name); - } - - var st = inner.state.state; - if (st == "pseudo" || token.type == "variable-3") { - add(pseudoClasses); - } else if (st == "block" || st == "maybeprop") { - add(spec.propertyKeywords); - } else if (st == "prop" || st == "parens" || st == "at" || st == "params") { - add(spec.valueKeywords); - add(spec.colorKeywords); - } else if (st == "media" || st == "media_parens") { - add(spec.mediaTypes); - add(spec.mediaFeatures); - } - - if (result.length) return { - list: result, - from: CodeMirror.Pos(cur.line, start), - to: CodeMirror.Pos(cur.line, end) - }; - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/html-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/html-hint.js deleted file mode 100644 index c6769bc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/html-hint.js +++ /dev/null @@ -1,348 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./xml-hint")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./xml-hint"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var langs = "ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "); - var targets = ["_blank", "_self", "_top", "_parent"]; - var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"]; - var methods = ["get", "post", "put", "delete"]; - var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]; - var media = ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech", - "3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait", - "orientation:landscape", "device-height: [X]", "device-width: [X]"]; - var s = { attrs: {} }; // Simple tag, reused for a whole lot of tags - - var data = { - a: { - attrs: { - href: null, ping: null, type: null, - media: media, - target: targets, - hreflang: langs - } - }, - abbr: s, - acronym: s, - address: s, - applet: s, - area: { - attrs: { - alt: null, coords: null, href: null, target: null, ping: null, - media: media, hreflang: langs, type: null, - shape: ["default", "rect", "circle", "poly"] - } - }, - article: s, - aside: s, - audio: { - attrs: { - src: null, mediagroup: null, - crossorigin: ["anonymous", "use-credentials"], - preload: ["none", "metadata", "auto"], - autoplay: ["", "autoplay"], - loop: ["", "loop"], - controls: ["", "controls"] - } - }, - b: s, - base: { attrs: { href: null, target: targets } }, - basefont: s, - bdi: s, - bdo: s, - big: s, - blockquote: { attrs: { cite: null } }, - body: s, - br: s, - button: { - attrs: { - form: null, formaction: null, name: null, value: null, - autofocus: ["", "autofocus"], - disabled: ["", "autofocus"], - formenctype: encs, - formmethod: methods, - formnovalidate: ["", "novalidate"], - formtarget: targets, - type: ["submit", "reset", "button"] - } - }, - canvas: { attrs: { width: null, height: null } }, - caption: s, - center: s, - cite: s, - code: s, - col: { attrs: { span: null } }, - colgroup: { attrs: { span: null } }, - command: { - attrs: { - type: ["command", "checkbox", "radio"], - label: null, icon: null, radiogroup: null, command: null, title: null, - disabled: ["", "disabled"], - checked: ["", "checked"] - } - }, - data: { attrs: { value: null } }, - datagrid: { attrs: { disabled: ["", "disabled"], multiple: ["", "multiple"] } }, - datalist: { attrs: { data: null } }, - dd: s, - del: { attrs: { cite: null, datetime: null } }, - details: { attrs: { open: ["", "open"] } }, - dfn: s, - dir: s, - div: s, - dl: s, - dt: s, - em: s, - embed: { attrs: { src: null, type: null, width: null, height: null } }, - eventsource: { attrs: { src: null } }, - fieldset: { attrs: { disabled: ["", "disabled"], form: null, name: null } }, - figcaption: s, - figure: s, - font: s, - footer: s, - form: { - attrs: { - action: null, name: null, - "accept-charset": charsets, - autocomplete: ["on", "off"], - enctype: encs, - method: methods, - novalidate: ["", "novalidate"], - target: targets - } - }, - frame: s, - frameset: s, - h1: s, h2: s, h3: s, h4: s, h5: s, h6: s, - head: { - attrs: {}, - children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"] - }, - header: s, - hgroup: s, - hr: s, - html: { - attrs: { manifest: null }, - children: ["head", "body"] - }, - i: s, - iframe: { - attrs: { - src: null, srcdoc: null, name: null, width: null, height: null, - sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"], - seamless: ["", "seamless"] - } - }, - img: { - attrs: { - alt: null, src: null, ismap: null, usemap: null, width: null, height: null, - crossorigin: ["anonymous", "use-credentials"] - } - }, - input: { - attrs: { - alt: null, dirname: null, form: null, formaction: null, - height: null, list: null, max: null, maxlength: null, min: null, - name: null, pattern: null, placeholder: null, size: null, src: null, - step: null, value: null, width: null, - accept: ["audio/*", "video/*", "image/*"], - autocomplete: ["on", "off"], - autofocus: ["", "autofocus"], - checked: ["", "checked"], - disabled: ["", "disabled"], - formenctype: encs, - formmethod: methods, - formnovalidate: ["", "novalidate"], - formtarget: targets, - multiple: ["", "multiple"], - readonly: ["", "readonly"], - required: ["", "required"], - type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month", - "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio", - "file", "submit", "image", "reset", "button"] - } - }, - ins: { attrs: { cite: null, datetime: null } }, - kbd: s, - keygen: { - attrs: { - challenge: null, form: null, name: null, - autofocus: ["", "autofocus"], - disabled: ["", "disabled"], - keytype: ["RSA"] - } - }, - label: { attrs: { "for": null, form: null } }, - legend: s, - li: { attrs: { value: null } }, - link: { - attrs: { - href: null, type: null, - hreflang: langs, - media: media, - sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"] - } - }, - map: { attrs: { name: null } }, - mark: s, - menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } }, - meta: { - attrs: { - content: null, - charset: charsets, - name: ["viewport", "application-name", "author", "description", "generator", "keywords"], - "http-equiv": ["content-language", "content-type", "default-style", "refresh"] - } - }, - meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } }, - nav: s, - noframes: s, - noscript: s, - object: { - attrs: { - data: null, type: null, name: null, usemap: null, form: null, width: null, height: null, - typemustmatch: ["", "typemustmatch"] - } - }, - ol: { attrs: { reversed: ["", "reversed"], start: null, type: ["1", "a", "A", "i", "I"] } }, - optgroup: { attrs: { disabled: ["", "disabled"], label: null } }, - option: { attrs: { disabled: ["", "disabled"], label: null, selected: ["", "selected"], value: null } }, - output: { attrs: { "for": null, form: null, name: null } }, - p: s, - param: { attrs: { name: null, value: null } }, - pre: s, - progress: { attrs: { value: null, max: null } }, - q: { attrs: { cite: null } }, - rp: s, - rt: s, - ruby: s, - s: s, - samp: s, - script: { - attrs: { - type: ["text/javascript"], - src: null, - async: ["", "async"], - defer: ["", "defer"], - charset: charsets - } - }, - section: s, - select: { - attrs: { - form: null, name: null, size: null, - autofocus: ["", "autofocus"], - disabled: ["", "disabled"], - multiple: ["", "multiple"] - } - }, - small: s, - source: { attrs: { src: null, type: null, media: null } }, - span: s, - strike: s, - strong: s, - style: { - attrs: { - type: ["text/css"], - media: media, - scoped: null - } - }, - sub: s, - summary: s, - sup: s, - table: s, - tbody: s, - td: { attrs: { colspan: null, rowspan: null, headers: null } }, - textarea: { - attrs: { - dirname: null, form: null, maxlength: null, name: null, placeholder: null, - rows: null, cols: null, - autofocus: ["", "autofocus"], - disabled: ["", "disabled"], - readonly: ["", "readonly"], - required: ["", "required"], - wrap: ["soft", "hard"] - } - }, - tfoot: s, - th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } }, - thead: s, - time: { attrs: { datetime: null } }, - title: s, - tr: s, - track: { - attrs: { - src: null, label: null, "default": null, - kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"], - srclang: langs - } - }, - tt: s, - u: s, - ul: s, - "var": s, - video: { - attrs: { - src: null, poster: null, width: null, height: null, - crossorigin: ["anonymous", "use-credentials"], - preload: ["auto", "metadata", "none"], - autoplay: ["", "autoplay"], - mediagroup: ["movie"], - muted: ["", "muted"], - controls: ["", "controls"] - } - }, - wbr: s - }; - - var globalAttrs = { - accesskey: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - "class": null, - contenteditable: ["true", "false"], - contextmenu: null, - dir: ["ltr", "rtl", "auto"], - draggable: ["true", "false", "auto"], - dropzone: ["copy", "move", "link", "string:", "file:"], - hidden: ["hidden"], - id: null, - inert: ["inert"], - itemid: null, - itemprop: null, - itemref: null, - itemscope: ["itemscope"], - itemtype: null, - lang: ["en", "es"], - spellcheck: ["true", "false"], - style: null, - tabindex: ["1", "2", "3", "4", "5", "6", "7", "8", "9"], - title: null, - translate: ["yes", "no"], - onclick: null, - rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"] - }; - function populate(obj) { - for (var attr in globalAttrs) if (globalAttrs.hasOwnProperty(attr)) - obj.attrs[attr] = globalAttrs[attr]; - } - - populate(s); - for (var tag in data) if (data.hasOwnProperty(tag) && data[tag] != s) - populate(data[tag]); - - CodeMirror.htmlSchema = data; - function htmlHint(cm, options) { - var local = {schemaInfo: data}; - if (options) for (var opt in options) local[opt] = options[opt]; - return CodeMirror.hint.xml(cm, local); - } - CodeMirror.registerHelper("hint", "html", htmlHint); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/javascript-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/javascript-hint.js deleted file mode 100644 index 7bcbf4a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/javascript-hint.js +++ /dev/null @@ -1,146 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var Pos = CodeMirror.Pos; - - function forEach(arr, f) { - for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); - } - - function arrayContains(arr, item) { - if (!Array.prototype.indexOf) { - var i = arr.length; - while (i--) { - if (arr[i] === item) { - return true; - } - } - return false; - } - return arr.indexOf(item) != -1; - } - - function scriptHint(editor, keywords, getToken, options) { - // Find the token at the cursor - var cur = editor.getCursor(), token = getToken(editor, cur); - if (/\b(?:string|comment)\b/.test(token.type)) return; - token.state = CodeMirror.innerMode(editor.getMode(), token.state).state; - - // If it's not a 'word-style' token, ignore the token. - if (!/^[\w$_]*$/.test(token.string)) { - token = {start: cur.ch, end: cur.ch, string: "", state: token.state, - type: token.string == "." ? "property" : null}; - } else if (token.end > cur.ch) { - token.end = cur.ch; - token.string = token.string.slice(0, cur.ch - token.start); - } - - var tprop = token; - // If it is a property, find out what it is a property of. - while (tprop.type == "property") { - tprop = getToken(editor, Pos(cur.line, tprop.start)); - if (tprop.string != ".") return; - tprop = getToken(editor, Pos(cur.line, tprop.start)); - if (!context) var context = []; - context.push(tprop); - } - return {list: getCompletions(token, context, keywords, options), - from: Pos(cur.line, token.start), - to: Pos(cur.line, token.end)}; - } - - function javascriptHint(editor, options) { - return scriptHint(editor, javascriptKeywords, - function (e, cur) {return e.getTokenAt(cur);}, - options); - }; - CodeMirror.registerHelper("hint", "javascript", javascriptHint); - - function getCoffeeScriptToken(editor, cur) { - // This getToken, it is for coffeescript, imitates the behavior of - // getTokenAt method in javascript.js, that is, returning "property" - // type and treat "." as indepenent token. - var token = editor.getTokenAt(cur); - if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') { - token.end = token.start; - token.string = '.'; - token.type = "property"; - } - else if (/^\.[\w$_]*$/.test(token.string)) { - token.type = "property"; - token.start++; - token.string = token.string.replace(/\./, ''); - } - return token; - } - - function coffeescriptHint(editor, options) { - return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options); - } - CodeMirror.registerHelper("hint", "coffeescript", coffeescriptHint); - - var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " + - "toUpperCase toLowerCase split concat match replace search").split(" "); - var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " + - "lastIndexOf every some filter forEach map reduce reduceRight ").split(" "); - var funcProps = "prototype apply call bind".split(" "); - var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " + - "if in instanceof new null return switch throw true try typeof var void while with").split(" "); - var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + - "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" "); - - function getCompletions(token, context, keywords, options) { - var found = [], start = token.string, global = options && options.globalScope || window; - function maybeAdd(str) { - if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str); - } - function gatherCompletions(obj) { - if (typeof obj == "string") forEach(stringProps, maybeAdd); - else if (obj instanceof Array) forEach(arrayProps, maybeAdd); - else if (obj instanceof Function) forEach(funcProps, maybeAdd); - for (var name in obj) maybeAdd(name); - } - - if (context && context.length) { - // If this is a property, see if it belongs to some object we can - // find in the current environment. - var obj = context.pop(), base; - if (obj.type && obj.type.indexOf("variable") === 0) { - if (options && options.additionalContext) - base = options.additionalContext[obj.string]; - if (!options || options.useGlobalScope !== false) - base = base || global[obj.string]; - } else if (obj.type == "string") { - base = ""; - } else if (obj.type == "atom") { - base = 1; - } else if (obj.type == "function") { - if (global.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') && - (typeof global.jQuery == 'function')) - base = global.jQuery(); - else if (global._ != null && (obj.string == '_') && (typeof global._ == 'function')) - base = global._(); - } - while (base != null && context.length) - base = base[context.pop().string]; - if (base != null) gatherCompletions(base); - } else { - // If not, just look in the global object and any local scope - // (reading into JS mode internals to get at the local and global variables) - for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name); - for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name); - if (!options || options.useGlobalScope !== false) - gatherCompletions(global); - forEach(keywords, maybeAdd); - } - return found; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/python-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/python-hint.js deleted file mode 100644 index 1b97f6a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/python-hint.js +++ /dev/null @@ -1,102 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function forEach(arr, f) { - for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); - } - - function arrayContains(arr, item) { - if (!Array.prototype.indexOf) { - var i = arr.length; - while (i--) { - if (arr[i] === item) { - return true; - } - } - return false; - } - return arr.indexOf(item) != -1; - } - - function scriptHint(editor, _keywords, getToken) { - // Find the token at the cursor - var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; - // If it's not a 'word-style' token, ignore the token. - - if (!/^[\w$_]*$/.test(token.string)) { - token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, - className: token.string == ":" ? "python-type" : null}; - } - - if (!context) var context = []; - context.push(tprop); - - var completionList = getCompletions(token, context); - completionList = completionList.sort(); - - return {list: completionList, - from: CodeMirror.Pos(cur.line, token.start), - to: CodeMirror.Pos(cur.line, token.end)}; - } - - function pythonHint(editor) { - return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);}); - } - CodeMirror.registerHelper("hint", "python", pythonHint); - - var pythonKeywords = "and del from not while as elif global or with assert else if pass yield" -+ "break except import print class exec in raise continue finally is return def for lambda try"; - var pythonKeywordsL = pythonKeywords.split(" "); - var pythonKeywordsU = pythonKeywords.toUpperCase().split(" "); - - var pythonBuiltins = "abs divmod input open staticmethod all enumerate int ord str " -+ "any eval isinstance pow sum basestring execfile issubclass print super" -+ "bin file iter property tuple bool filter len range type" -+ "bytearray float list raw_input unichr callable format locals reduce unicode" -+ "chr frozenset long reload vars classmethod getattr map repr xrange" -+ "cmp globals max reversed zip compile hasattr memoryview round __import__" -+ "complex hash min set apply delattr help next setattr buffer" -+ "dict hex object slice coerce dir id oct sorted intern "; - var pythonBuiltinsL = pythonBuiltins.split(" ").join("() ").split(" "); - var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(" ").join("() ").split(" "); - - function getCompletions(token, context) { - var found = [], start = token.string; - function maybeAdd(str) { - if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str); - } - - function gatherCompletions(_obj) { - forEach(pythonBuiltinsL, maybeAdd); - forEach(pythonBuiltinsU, maybeAdd); - forEach(pythonKeywordsL, maybeAdd); - forEach(pythonKeywordsU, maybeAdd); - } - - if (context) { - // If this is a property, see if it belongs to some object we can - // find in the current environment. - var obj = context.pop(), base; - - if (obj.type == "variable") - base = obj.string; - else if(obj.type == "variable-3") - base = ":" + obj.string; - - while (base != null && context.length) - base = base[context.pop().string]; - if (base != null) gatherCompletions(base); - } - return found; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.css deleted file mode 100644 index 924e638..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.css +++ /dev/null @@ -1,38 +0,0 @@ -.CodeMirror-hints { - position: absolute; - z-index: 10; - overflow: hidden; - list-style: none; - - margin: 0; - padding: 2px; - - -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - box-shadow: 2px 3px 5px rgba(0,0,0,.2); - border-radius: 3px; - border: 1px solid silver; - - background: white; - font-size: 90%; - font-family: monospace; - - max-height: 20em; - overflow-y: auto; -} - -.CodeMirror-hint { - margin: 0; - padding: 0 4px; - border-radius: 2px; - max-width: 19em; - overflow: hidden; - white-space: pre; - color: black; - cursor: pointer; -} - -li.CodeMirror-hint-active { - background: #08f; - color: white; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.js deleted file mode 100644 index 980da52..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.js +++ /dev/null @@ -1,386 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var HINT_ELEMENT_CLASS = "CodeMirror-hint"; - var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; - - // This is the old interface, kept around for now to stay - // backwards-compatible. - CodeMirror.showHint = function(cm, getHints, options) { - if (!getHints) return cm.showHint(options); - if (options && options.async) getHints.async = true; - var newOpts = {hint: getHints}; - if (options) for (var prop in options) newOpts[prop] = options[prop]; - return cm.showHint(newOpts); - }; - - CodeMirror.defineExtension("showHint", function(options) { - // We want a single cursor position. - if (this.listSelections().length > 1 || this.somethingSelected()) return; - - if (this.state.completionActive) this.state.completionActive.close(); - var completion = this.state.completionActive = new Completion(this, options); - if (!completion.options.hint) return; - - CodeMirror.signal(this, "startCompletion", this); - completion.update(true); - }); - - function Completion(cm, options) { - this.cm = cm; - this.options = this.buildOptions(options); - this.widget = null; - this.debounce = 0; - this.tick = 0; - this.startPos = this.cm.getCursor(); - this.startLen = this.cm.getLine(this.startPos.line).length; - - var self = this; - cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); - } - - var requestAnimationFrame = window.requestAnimationFrame || function(fn) { - return setTimeout(fn, 1000/60); - }; - var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; - - Completion.prototype = { - close: function() { - if (!this.active()) return; - this.cm.state.completionActive = null; - this.tick = null; - this.cm.off("cursorActivity", this.activityFunc); - - if (this.widget && this.data) CodeMirror.signal(this.data, "close"); - if (this.widget) this.widget.close(); - CodeMirror.signal(this.cm, "endCompletion", this.cm); - }, - - active: function() { - return this.cm.state.completionActive == this; - }, - - pick: function(data, i) { - var completion = data.list[i]; - if (completion.hint) completion.hint(this.cm, data, completion); - else this.cm.replaceRange(getText(completion), completion.from || data.from, - completion.to || data.to, "complete"); - CodeMirror.signal(data, "pick", completion); - this.close(); - }, - - cursorActivity: function() { - if (this.debounce) { - cancelAnimationFrame(this.debounce); - this.debounce = 0; - } - - var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line); - if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || - pos.ch < this.startPos.ch || this.cm.somethingSelected() || - (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { - this.close(); - } else { - var self = this; - this.debounce = requestAnimationFrame(function() {self.update();}); - if (this.widget) this.widget.disable(); - } - }, - - update: function(first) { - if (this.tick == null) return; - if (!this.options.hint.async) { - this.finishUpdate(this.options.hint(this.cm, this.options), first); - } else { - var myTick = ++this.tick, self = this; - this.options.hint(this.cm, function(data) { - if (self.tick == myTick) self.finishUpdate(data, first); - }, this.options); - } - }, - - finishUpdate: function(data, first) { - if (this.data) CodeMirror.signal(this.data, "update"); - if (data && this.data && CodeMirror.cmpPos(data.from, this.data.from)) data = null; - this.data = data; - - var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); - if (this.widget) this.widget.close(); - if (data && data.list.length) { - if (picked && data.list.length == 1) { - this.pick(data, 0); - } else { - this.widget = new Widget(this, data); - CodeMirror.signal(data, "shown"); - } - } - }, - - buildOptions: function(options) { - var editor = this.cm.options.hintOptions; - var out = {}; - for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; - if (editor) for (var prop in editor) - if (editor[prop] !== undefined) out[prop] = editor[prop]; - if (options) for (var prop in options) - if (options[prop] !== undefined) out[prop] = options[prop]; - return out; - } - }; - - function getText(completion) { - if (typeof completion == "string") return completion; - else return completion.text; - } - - function buildKeyMap(completion, handle) { - var baseMap = { - Up: function() {handle.moveFocus(-1);}, - Down: function() {handle.moveFocus(1);}, - PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);}, - PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);}, - Home: function() {handle.setFocus(0);}, - End: function() {handle.setFocus(handle.length - 1);}, - Enter: handle.pick, - Tab: handle.pick, - Esc: handle.close - }; - var custom = completion.options.customKeys; - var ourMap = custom ? {} : baseMap; - function addBinding(key, val) { - var bound; - if (typeof val != "string") - bound = function(cm) { return val(cm, handle); }; - // This mechanism is deprecated - else if (baseMap.hasOwnProperty(val)) - bound = baseMap[val]; - else - bound = val; - ourMap[key] = bound; - } - if (custom) - for (var key in custom) if (custom.hasOwnProperty(key)) - addBinding(key, custom[key]); - var extra = completion.options.extraKeys; - if (extra) - for (var key in extra) if (extra.hasOwnProperty(key)) - addBinding(key, extra[key]); - return ourMap; - } - - function getHintElement(hintsElement, el) { - while (el && el != hintsElement) { - if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; - el = el.parentNode; - } - } - - function Widget(completion, data) { - this.completion = completion; - this.data = data; - this.picked = false; - var widget = this, cm = completion.cm; - - var hints = this.hints = document.createElement("ul"); - hints.className = "CodeMirror-hints"; - this.selectedHint = data.selectedHint || 0; - - var completions = data.list; - for (var i = 0; i < completions.length; ++i) { - var elt = hints.appendChild(document.createElement("li")), cur = completions[i]; - var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); - if (cur.className != null) className = cur.className + " " + className; - elt.className = className; - if (cur.render) cur.render(elt, data, cur); - else elt.appendChild(document.createTextNode(cur.displayText || getText(cur))); - elt.hintId = i; - } - - var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); - var left = pos.left, top = pos.bottom, below = true; - hints.style.left = left + "px"; - hints.style.top = top + "px"; - // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. - var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); - var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); - (completion.options.container || document.body).appendChild(hints); - var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; - if (overlapY > 0) { - var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); - if (curTop - height > 0) { // Fits above cursor - hints.style.top = (top = pos.top - height) + "px"; - below = false; - } else if (height > winH) { - hints.style.height = (winH - 5) + "px"; - hints.style.top = (top = pos.bottom - box.top) + "px"; - var cursor = cm.getCursor(); - if (data.from.ch != cursor.ch) { - pos = cm.cursorCoords(cursor); - hints.style.left = (left = pos.left) + "px"; - box = hints.getBoundingClientRect(); - } - } - } - var overlapX = box.right - winW; - if (overlapX > 0) { - if (box.right - box.left > winW) { - hints.style.width = (winW - 5) + "px"; - overlapX -= (box.right - box.left) - winW; - } - hints.style.left = (left = pos.left - overlapX) + "px"; - } - - cm.addKeyMap(this.keyMap = buildKeyMap(completion, { - moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); }, - setFocus: function(n) { widget.changeActive(n); }, - menuSize: function() { return widget.screenAmount(); }, - length: completions.length, - close: function() { completion.close(); }, - pick: function() { widget.pick(); }, - data: data - })); - - if (completion.options.closeOnUnfocus) { - var closingOnBlur; - cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); }); - cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); }); - } - - var startScroll = cm.getScrollInfo(); - cm.on("scroll", this.onScroll = function() { - var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect(); - var newTop = top + startScroll.top - curScroll.top; - var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop); - if (!below) point += hints.offsetHeight; - if (point <= editor.top || point >= editor.bottom) return completion.close(); - hints.style.top = newTop + "px"; - hints.style.left = (left + startScroll.left - curScroll.left) + "px"; - }); - - CodeMirror.on(hints, "dblclick", function(e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();} - }); - - CodeMirror.on(hints, "click", function(e) { - var t = getHintElement(hints, e.target || e.srcElement); - if (t && t.hintId != null) { - widget.changeActive(t.hintId); - if (completion.options.completeOnSingleClick) widget.pick(); - } - }); - - CodeMirror.on(hints, "mousedown", function() { - setTimeout(function(){cm.focus();}, 20); - }); - - CodeMirror.signal(data, "select", completions[0], hints.firstChild); - return true; - } - - Widget.prototype = { - close: function() { - if (this.completion.widget != this) return; - this.completion.widget = null; - this.hints.parentNode.removeChild(this.hints); - this.completion.cm.removeKeyMap(this.keyMap); - - var cm = this.completion.cm; - if (this.completion.options.closeOnUnfocus) { - cm.off("blur", this.onBlur); - cm.off("focus", this.onFocus); - } - cm.off("scroll", this.onScroll); - }, - - disable: function() { - this.completion.cm.removeKeyMap(this.keyMap); - var widget = this; - this.keyMap = {Enter: function() { widget.picked = true; }}; - this.completion.cm.addKeyMap(this.keyMap); - }, - - pick: function() { - this.completion.pick(this.data, this.selectedHint); - }, - - changeActive: function(i, avoidWrap) { - if (i >= this.data.list.length) - i = avoidWrap ? this.data.list.length - 1 : 0; - else if (i < 0) - i = avoidWrap ? 0 : this.data.list.length - 1; - if (this.selectedHint == i) return; - var node = this.hints.childNodes[this.selectedHint]; - node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); - node = this.hints.childNodes[this.selectedHint = i]; - node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; - if (node.offsetTop < this.hints.scrollTop) - this.hints.scrollTop = node.offsetTop - 3; - else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) - this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3; - CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); - }, - - screenAmount: function() { - return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; - } - }; - - CodeMirror.registerHelper("hint", "auto", function(cm, options) { - var helpers = cm.getHelpers(cm.getCursor(), "hint"), words; - if (helpers.length) { - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, options); - if (cur && cur.list.length) return cur; - } - } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { - if (words) return CodeMirror.hint.fromList(cm, {words: words}); - } else if (CodeMirror.hint.anyword) { - return CodeMirror.hint.anyword(cm, options); - } - }); - - CodeMirror.registerHelper("hint", "fromList", function(cm, options) { - var cur = cm.getCursor(), token = cm.getTokenAt(cur); - var to = CodeMirror.Pos(cur.line, token.end); - if (token.string && /\w/.test(token.string[token.string.length - 1])) { - var term = token.string, from = CodeMirror.Pos(cur.line, token.start); - } else { - var term = "", from = to; - } - var found = []; - for (var i = 0; i < options.words.length; i++) { - var word = options.words[i]; - if (word.slice(0, term.length) == term) - found.push(word); - } - - if (found.length) return {list: found, from: from, to: to}; - }); - - CodeMirror.commands.autocomplete = CodeMirror.showHint; - - var defaultOptions = { - hint: CodeMirror.hint.auto, - completeSingle: true, - alignWithWord: true, - closeCharacters: /[\s()\[\]{};:>,]/, - closeOnUnfocus: true, - completeOnSingleClick: false, - container: null, - customKeys: null, - extraKeys: null - }; - - CodeMirror.defineOption("hintOptions", null); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/sql-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/sql-hint.js deleted file mode 100644 index 22124b5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/sql-hint.js +++ /dev/null @@ -1,254 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../mode/sql/sql")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../mode/sql/sql"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var tables; - var defaultTable; - var keywords; - var CONS = { - QUERY_DIV: ";", - ALIAS_KEYWORD: "AS" - }; - var Pos = CodeMirror.Pos; - - function getKeywords(editor) { - var mode = editor.doc.modeOption; - if (mode === "sql") mode = "text/x-sql"; - return CodeMirror.resolveMode(mode).keywords; - } - - function getText(item) { - return typeof item == "string" ? item : item.text; - } - - function getItem(list, item) { - if (!list.slice) return list[item]; - for (var i = list.length - 1; i >= 0; i--) if (getText(list[i]) == item) - return list[i]; - } - - function shallowClone(object) { - var result = {}; - for (var key in object) if (object.hasOwnProperty(key)) - result[key] = object[key]; - return result; - } - - function match(string, word) { - var len = string.length; - var sub = getText(word).substr(0, len); - return string.toUpperCase() === sub.toUpperCase(); - } - - function addMatches(result, search, wordlist, formatter) { - for (var word in wordlist) { - if (!wordlist.hasOwnProperty(word)) continue; - if (wordlist.slice) word = wordlist[word]; - - if (match(search, word)) result.push(formatter(word)); - } - } - - function cleanName(name) { - // Get rid name from backticks(`) and preceding dot(.) - if (name.charAt(0) == ".") { - name = name.substr(1); - } - return name.replace(/`/g, ""); - } - - function insertBackticks(name) { - var nameParts = getText(name).split("."); - for (var i = 0; i < nameParts.length; i++) - nameParts[i] = "`" + nameParts[i] + "`"; - var escaped = nameParts.join("."); - if (typeof name == "string") return escaped; - name = shallowClone(name); - name.text = escaped; - return name; - } - - function nameCompletion(cur, token, result, editor) { - // Try to complete table, colunm names and return start position of completion - var useBacktick = false; - var nameParts = []; - var start = token.start; - var cont = true; - while (cont) { - cont = (token.string.charAt(0) == "."); - useBacktick = useBacktick || (token.string.charAt(0) == "`"); - - start = token.start; - nameParts.unshift(cleanName(token.string)); - - token = editor.getTokenAt(Pos(cur.line, token.start)); - if (token.string == ".") { - cont = true; - token = editor.getTokenAt(Pos(cur.line, token.start)); - } - } - - // Try to complete table names - var string = nameParts.join("."); - addMatches(result, string, tables, function(w) { - return useBacktick ? insertBackticks(w) : w; - }); - - // Try to complete columns from defaultTable - addMatches(result, string, defaultTable, function(w) { - return useBacktick ? insertBackticks(w) : w; - }); - - // Try to complete columns - string = nameParts.pop(); - var table = nameParts.join("."); - - var alias = false; - var aliasTable = table; - // Check if table is available. If not, find table by Alias - if (!getItem(tables, table)) { - var oldTable = table; - table = findTableByAlias(table, editor); - if (table !== oldTable) alias = true; - } - - var columns = getItem(tables, table); - if (columns && columns.columns) - columns = columns.columns; - - if (columns) { - addMatches(result, string, columns, function(w) { - var tableInsert = table; - if (alias == true) tableInsert = aliasTable; - if (typeof w == "string") { - w = tableInsert + "." + w; - } else { - w = shallowClone(w); - w.text = tableInsert + "." + w.text; - } - return useBacktick ? insertBackticks(w) : w; - }); - } - - return start; - } - - function eachWord(lineText, f) { - if (!lineText) return; - var excepted = /[,;]/g; - var words = lineText.split(" "); - for (var i = 0; i < words.length; i++) { - f(words[i]?words[i].replace(excepted, '') : ''); - } - } - - function convertCurToNumber(cur) { - // max characters of a line is 999,999. - return cur.line + cur.ch / Math.pow(10, 6); - } - - function convertNumberToCur(num) { - return Pos(Math.floor(num), +num.toString().split('.').pop()); - } - - function findTableByAlias(alias, editor) { - var doc = editor.doc; - var fullQuery = doc.getValue(); - var aliasUpperCase = alias.toUpperCase(); - var previousWord = ""; - var table = ""; - var separator = []; - var validRange = { - start: Pos(0, 0), - end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length) - }; - - //add separator - var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV); - while(indexOfSeparator != -1) { - separator.push(doc.posFromIndex(indexOfSeparator)); - indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1); - } - separator.unshift(Pos(0, 0)); - separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length)); - - //find valid range - var prevItem = 0; - var current = convertCurToNumber(editor.getCursor()); - for (var i=0; i< separator.length; i++) { - var _v = convertCurToNumber(separator[i]); - if (current > prevItem && current <= _v) { - validRange = { start: convertNumberToCur(prevItem), end: convertNumberToCur(_v) }; - break; - } - prevItem = _v; - } - - var query = doc.getRange(validRange.start, validRange.end, false); - - for (var i = 0; i < query.length; i++) { - var lineText = query[i]; - eachWord(lineText, function(word) { - var wordUpperCase = word.toUpperCase(); - if (wordUpperCase === aliasUpperCase && getItem(tables, previousWord)) - table = previousWord; - if (wordUpperCase !== CONS.ALIAS_KEYWORD) - previousWord = word; - }); - if (table) break; - } - return table; - } - - CodeMirror.registerHelper("hint", "sql", function(editor, options) { - tables = (options && options.tables) || {}; - var defaultTableName = options && options.defaultTable; - var disableKeywords = options && options.disableKeywords; - defaultTable = defaultTableName && getItem(tables, defaultTableName); - keywords = keywords || getKeywords(editor); - - if (defaultTableName && !defaultTable) - defaultTable = findTableByAlias(defaultTableName, editor); - - defaultTable = defaultTable || []; - - if (defaultTable.columns) - defaultTable = defaultTable.columns; - - var cur = editor.getCursor(); - var result = []; - var token = editor.getTokenAt(cur), start, end, search; - if (token.end > cur.ch) { - token.end = cur.ch; - token.string = token.string.slice(0, cur.ch - token.start); - } - - if (token.string.match(/^[.`\w@]\w*$/)) { - search = token.string; - start = token.start; - end = token.end; - } else { - start = end = cur.ch; - search = ""; - } - if (search.charAt(0) == "." || search.charAt(0) == "`") { - start = nameCompletion(cur, token, result, editor); - } else { - addMatches(result, search, tables, function(w) {return w;}); - addMatches(result, search, defaultTable, function(w) {return w;}); - if (!disableKeywords) - addMatches(result, search, keywords, function(w) {return w.toUpperCase();}); - } - - return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)}; - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/xml-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/xml-hint.js deleted file mode 100644 index 9b9baa0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/xml-hint.js +++ /dev/null @@ -1,110 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - - function getHints(cm, options) { - var tags = options && options.schemaInfo; - var quote = (options && options.quoteChar) || '"'; - if (!tags) return; - var cur = cm.getCursor(), token = cm.getTokenAt(cur); - if (token.end > cur.ch) { - token.end = cur.ch; - token.string = token.string.slice(0, cur.ch - token.start); - } - var inner = CodeMirror.innerMode(cm.getMode(), token.state); - if (inner.mode.name != "xml") return; - var result = [], replaceToken = false, prefix; - var tag = /\btag\b/.test(token.type) && !/>$/.test(token.string); - var tagName = tag && /^\w/.test(token.string), tagStart; - - if (tagName) { - var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start); - var tagType = /<\/$/.test(before) ? "close" : /<$/.test(before) ? "open" : null; - if (tagType) tagStart = token.start - (tagType == "close" ? 2 : 1); - } else if (tag && token.string == "<") { - tagType = "open"; - } else if (tag && token.string == ""); - } else { - // Attribute completion - var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs; - var globalAttrs = tags["!attrs"]; - if (!attrs && !globalAttrs) return; - if (!attrs) { - attrs = globalAttrs; - } else if (globalAttrs) { // Combine tag-local and global attributes - var set = {}; - for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm]; - for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm]; - attrs = set; - } - if (token.type == "string" || token.string == "=") { // A value - var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)), - Pos(cur.line, token.type == "string" ? token.start : token.end)); - var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues; - if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return; - if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget - if (token.type == "string") { - prefix = token.string; - var n = 0; - if (/['"]/.test(token.string.charAt(0))) { - quote = token.string.charAt(0); - prefix = token.string.slice(1); - n++; - } - var len = token.string.length; - if (/['"]/.test(token.string.charAt(len - 1))) { - quote = token.string.charAt(len - 1); - prefix = token.string.substr(n, len - 2); - } - replaceToken = true; - } - for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].lastIndexOf(prefix, 0) == 0) - result.push(quote + atValues[i] + quote); - } else { // An attribute name - if (token.type == "attribute") { - prefix = token.string; - replaceToken = true; - } - for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.lastIndexOf(prefix, 0) == 0)) - result.push(attr); - } - } - return { - list: result, - from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur, - to: replaceToken ? Pos(cur.line, token.end) : cur - }; - } - - CodeMirror.registerHelper("hint", "xml", getHints); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/coffeescript-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/coffeescript-lint.js deleted file mode 100644 index 7e39428..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/coffeescript-lint.js +++ /dev/null @@ -1,41 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js - -// declare global: coffeelint - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("lint", "coffeescript", function(text) { - var found = []; - var parseError = function(err) { - var loc = err.lineNumber; - found.push({from: CodeMirror.Pos(loc-1, 0), - to: CodeMirror.Pos(loc, 0), - severity: err.level, - message: err.message}); - }; - try { - var res = coffeelint.lint(text); - for(var i = 0; i < res.length; i++) { - parseError(res[i]); - } - } catch(e) { - found.push({from: CodeMirror.Pos(e.location.first_line, 0), - to: CodeMirror.Pos(e.location.last_line, e.location.last_column), - severity: 'error', - message: e.message}); - } - return found; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/css-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/css-lint.js deleted file mode 100644 index 1f61b47..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/css-lint.js +++ /dev/null @@ -1,35 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Depends on csslint.js from https://github.com/stubbornella/csslint - -// declare global: CSSLint - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("lint", "css", function(text) { - var found = []; - if (!window.CSSLint) return found; - var results = CSSLint.verify(text), messages = results.messages, message = null; - for ( var i = 0; i < messages.length; i++) { - message = messages[i]; - var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; - found.push({ - from: CodeMirror.Pos(startLine, startCol), - to: CodeMirror.Pos(endLine, endCol), - message: message.message, - severity : message.type - }); - } - return found; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/javascript-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/javascript-lint.js deleted file mode 100644 index d4f2ae9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/javascript-lint.js +++ /dev/null @@ -1,136 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - // declare global: JSHINT - - var bogus = [ "Dangerous comment" ]; - - var warnings = [ [ "Expected '{'", - "Statement body should be inside '{ }' braces." ] ]; - - var errors = [ "Missing semicolon", "Extra comma", "Missing property name", - "Unmatched ", " and instead saw", " is not defined", - "Unclosed string", "Stopping, unable to continue" ]; - - function validator(text, options) { - if (!window.JSHINT) return []; - JSHINT(text, options, options.globals); - var errors = JSHINT.data().errors, result = []; - if (errors) parseErrors(errors, result); - return result; - } - - CodeMirror.registerHelper("lint", "javascript", validator); - - function cleanup(error) { - // All problems are warnings by default - fixWith(error, warnings, "warning", true); - fixWith(error, errors, "error"); - - return isBogus(error) ? null : error; - } - - function fixWith(error, fixes, severity, force) { - var description, fix, find, replace, found; - - description = error.description; - - for ( var i = 0; i < fixes.length; i++) { - fix = fixes[i]; - find = (typeof fix === "string" ? fix : fix[0]); - replace = (typeof fix === "string" ? null : fix[1]); - found = description.indexOf(find) !== -1; - - if (force || found) { - error.severity = severity; - } - if (found && replace) { - error.description = replace; - } - } - } - - function isBogus(error) { - var description = error.description; - for ( var i = 0; i < bogus.length; i++) { - if (description.indexOf(bogus[i]) !== -1) { - return true; - } - } - return false; - } - - function parseErrors(errors, output) { - for ( var i = 0; i < errors.length; i++) { - var error = errors[i]; - if (error) { - var linetabpositions, index; - - linetabpositions = []; - - // This next block is to fix a problem in jshint. Jshint - // replaces - // all tabs with spaces then performs some checks. The error - // positions (character/space) are then reported incorrectly, - // not taking the replacement step into account. Here we look - // at the evidence line and try to adjust the character position - // to the correct value. - if (error.evidence) { - // Tab positions are computed once per line and cached - var tabpositions = linetabpositions[error.line]; - if (!tabpositions) { - var evidence = error.evidence; - tabpositions = []; - // ugggh phantomjs does not like this - // forEachChar(evidence, function(item, index) { - Array.prototype.forEach.call(evidence, function(item, - index) { - if (item === '\t') { - // First col is 1 (not 0) to match error - // positions - tabpositions.push(index + 1); - } - }); - linetabpositions[error.line] = tabpositions; - } - if (tabpositions.length > 0) { - var pos = error.character; - tabpositions.forEach(function(tabposition) { - if (pos > tabposition) pos -= 1; - }); - error.character = pos; - } - } - - var start = error.character - 1, end = start + 1; - if (error.evidence) { - index = error.evidence.substring(start).search(/.\b/); - if (index > -1) { - end += index; - } - } - - // Convert to format expected by validation service - error.description = error.reason;// + "(jshint)"; - error.start = error.character; - error.end = end; - error = cleanup(error); - - if (error) - output.push({message: error.description, - severity: error.severity, - from: CodeMirror.Pos(error.line - 1, start), - to: CodeMirror.Pos(error.line - 1, end)}); - } - } - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/json-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/json-lint.js deleted file mode 100644 index 9dbb616..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/json-lint.js +++ /dev/null @@ -1,31 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Depends on jsonlint.js from https://github.com/zaach/jsonlint - -// declare global: jsonlint - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("lint", "json", function(text) { - var found = []; - jsonlint.parseError = function(str, hash) { - var loc = hash.loc; - found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), - to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), - message: str}); - }; - try { jsonlint.parse(text); } - catch(e) {} - return found; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.css deleted file mode 100644 index 414a9a0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.css +++ /dev/null @@ -1,73 +0,0 @@ -/* The lint marker gutter */ -.CodeMirror-lint-markers { - width: 16px; -} - -.CodeMirror-lint-tooltip { - background-color: infobackground; - border: 1px solid black; - border-radius: 4px 4px 4px 4px; - color: infotext; - font-family: monospace; - font-size: 10pt; - overflow: hidden; - padding: 2px 5px; - position: fixed; - white-space: pre; - white-space: pre-wrap; - z-index: 100; - max-width: 600px; - opacity: 0; - transition: opacity .4s; - -moz-transition: opacity .4s; - -webkit-transition: opacity .4s; - -o-transition: opacity .4s; - -ms-transition: opacity .4s; -} - -.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { - background-position: left bottom; - background-repeat: repeat-x; -} - -.CodeMirror-lint-mark-error { - background-image: - url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==") - ; -} - -.CodeMirror-lint-mark-warning { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); -} - -.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { - background-position: center center; - background-repeat: no-repeat; - cursor: pointer; - display: inline-block; - height: 16px; - width: 16px; - vertical-align: middle; - position: relative; -} - -.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { - padding-left: 18px; - background-position: top left; - background-repeat: no-repeat; -} - -.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="); -} - -.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII="); -} - -.CodeMirror-lint-marker-multiple { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC"); - background-repeat: no-repeat; - background-position: right bottom; - width: 100%; height: 100%; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.js deleted file mode 100644 index 3eea203..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.js +++ /dev/null @@ -1,207 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var GUTTER_ID = "CodeMirror-lint-markers"; - - function showTooltip(e, content) { - var tt = document.createElement("div"); - tt.className = "CodeMirror-lint-tooltip"; - tt.appendChild(content.cloneNode(true)); - document.body.appendChild(tt); - - function position(e) { - if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position); - tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px"; - tt.style.left = (e.clientX + 5) + "px"; - } - CodeMirror.on(document, "mousemove", position); - position(e); - if (tt.style.opacity != null) tt.style.opacity = 1; - return tt; - } - function rm(elt) { - if (elt.parentNode) elt.parentNode.removeChild(elt); - } - function hideTooltip(tt) { - if (!tt.parentNode) return; - if (tt.style.opacity == null) rm(tt); - tt.style.opacity = 0; - setTimeout(function() { rm(tt); }, 600); - } - - function showTooltipFor(e, content, node) { - var tooltip = showTooltip(e, content); - function hide() { - CodeMirror.off(node, "mouseout", hide); - if (tooltip) { hideTooltip(tooltip); tooltip = null; } - } - var poll = setInterval(function() { - if (tooltip) for (var n = node;; n = n.parentNode) { - if (n && n.nodeType == 11) n = n.host; - if (n == document.body) return; - if (!n) { hide(); break; } - } - if (!tooltip) return clearInterval(poll); - }, 400); - CodeMirror.on(node, "mouseout", hide); - } - - function LintState(cm, options, hasGutter) { - this.marked = []; - this.options = options; - this.timeout = null; - this.hasGutter = hasGutter; - this.onMouseOver = function(e) { onMouseOver(cm, e); }; - } - - function parseOptions(_cm, options) { - if (options instanceof Function) return {getAnnotations: options}; - if (!options || options === true) options = {}; - return options; - } - - function clearMarks(cm) { - var state = cm.state.lint; - if (state.hasGutter) cm.clearGutter(GUTTER_ID); - for (var i = 0; i < state.marked.length; ++i) - state.marked[i].clear(); - state.marked.length = 0; - } - - function makeMarker(labels, severity, multiple, tooltips) { - var marker = document.createElement("div"), inner = marker; - marker.className = "CodeMirror-lint-marker-" + severity; - if (multiple) { - inner = marker.appendChild(document.createElement("div")); - inner.className = "CodeMirror-lint-marker-multiple"; - } - - if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) { - showTooltipFor(e, labels, inner); - }); - - return marker; - } - - function getMaxSeverity(a, b) { - if (a == "error") return a; - else return b; - } - - function groupByLine(annotations) { - var lines = []; - for (var i = 0; i < annotations.length; ++i) { - var ann = annotations[i], line = ann.from.line; - (lines[line] || (lines[line] = [])).push(ann); - } - return lines; - } - - function annotationTooltip(ann) { - var severity = ann.severity; - if (!severity) severity = "error"; - var tip = document.createElement("div"); - tip.className = "CodeMirror-lint-message-" + severity; - tip.appendChild(document.createTextNode(ann.message)); - return tip; - } - - function startLinting(cm) { - var state = cm.state.lint, options = state.options; - var passOptions = options.options || options; // Support deprecated passing of `options` property in options - var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint"); - if (!getAnnotations) return; - if (options.async || getAnnotations.async) - getAnnotations(cm.getValue(), updateLinting, passOptions, cm); - else - updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm)); - } - - function updateLinting(cm, annotationsNotSorted) { - clearMarks(cm); - var state = cm.state.lint, options = state.options; - - var annotations = groupByLine(annotationsNotSorted); - - for (var line = 0; line < annotations.length; ++line) { - var anns = annotations[line]; - if (!anns) continue; - - var maxSeverity = null; - var tipLabel = state.hasGutter && document.createDocumentFragment(); - - for (var i = 0; i < anns.length; ++i) { - var ann = anns[i]; - var severity = ann.severity; - if (!severity) severity = "error"; - maxSeverity = getMaxSeverity(maxSeverity, severity); - - if (options.formatAnnotation) ann = options.formatAnnotation(ann); - if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann)); - - if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, { - className: "CodeMirror-lint-mark-" + severity, - __annotation: ann - })); - } - - if (state.hasGutter) - cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1, - state.options.tooltips)); - } - if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm); - } - - function onChange(cm) { - var state = cm.state.lint; - if (!state) return; - clearTimeout(state.timeout); - state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500); - } - - function popupSpanTooltip(ann, e) { - var target = e.target || e.srcElement; - showTooltipFor(e, annotationTooltip(ann), target); - } - - function onMouseOver(cm, e) { - var target = e.target || e.srcElement; - if (!/\bCodeMirror-lint-mark-/.test(target.className)) return; - var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2; - var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client")); - for (var i = 0; i < spans.length; ++i) { - var ann = spans[i].__annotation; - if (ann) return popupSpanTooltip(ann, e); - } - } - - CodeMirror.defineOption("lint", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - clearMarks(cm); - cm.off("change", onChange); - CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); - clearTimeout(cm.state.lint.timeout); - delete cm.state.lint; - } - - if (val) { - var gutters = cm.getOption("gutters"), hasLintGutter = false; - for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true; - var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter); - cm.on("change", onChange); - if (state.options.tooltips != false) - CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); - - startLinting(cm); - } - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/yaml-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/yaml-lint.js deleted file mode 100644 index 3f77e52..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/yaml-lint.js +++ /dev/null @@ -1,28 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -// Depends on js-yaml.js from https://github.com/nodeca/js-yaml - -// declare global: jsyaml - -CodeMirror.registerHelper("lint", "yaml", function(text) { - var found = []; - try { jsyaml.load(text); } - catch(e) { - var loc = e.mark; - found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message }); - } - return found; -}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.css deleted file mode 100644 index a6a80e4..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.css +++ /dev/null @@ -1,112 +0,0 @@ -.CodeMirror-merge { - position: relative; - border: 1px solid #ddd; - white-space: pre; -} - -.CodeMirror-merge, .CodeMirror-merge .CodeMirror { - height: 350px; -} - -.CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; } -.CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; } -.CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; } -.CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; } - -.CodeMirror-merge-pane { - display: inline-block; - white-space: normal; - vertical-align: top; -} -.CodeMirror-merge-pane-rightmost { - position: absolute; - right: 0px; - z-index: 1; -} - -.CodeMirror-merge-gap { - z-index: 2; - display: inline-block; - height: 100%; - -moz-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - border-left: 1px solid #ddd; - border-right: 1px solid #ddd; - position: relative; - background: #f8f8f8; -} - -.CodeMirror-merge-scrolllock-wrap { - position: absolute; - bottom: 0; left: 50%; -} -.CodeMirror-merge-scrolllock { - position: relative; - left: -50%; - cursor: pointer; - color: #555; - line-height: 1; -} - -.CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right { - position: absolute; - left: 0; top: 0; - right: 0; bottom: 0; - line-height: 1; -} - -.CodeMirror-merge-copy { - position: absolute; - cursor: pointer; - color: #44c; -} - -.CodeMirror-merge-copy-reverse { - position: absolute; - cursor: pointer; - color: #44c; -} - -.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; } -.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; } - -.CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==); - background-position: bottom left; - background-repeat: repeat-x; -} - -.CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==); - background-position: bottom left; - background-repeat: repeat-x; -} - -.CodeMirror-merge-r-chunk { background: #ffffe0; } -.CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; } -.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; } -.CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; } - -.CodeMirror-merge-l-chunk { background: #eef; } -.CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; } -.CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; } -.CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; } - -.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; } -.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; } -.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; } - -.CodeMirror-merge-collapsed-widget:before { - content: "(...)"; -} -.CodeMirror-merge-collapsed-widget { - cursor: pointer; - color: #88b; - background: #eef; - border: 1px solid #ddf; - font-size: 90%; - padding: 0 3px; - border-radius: 4px; -} -.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt { display: none; } diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.js deleted file mode 100644 index 5b04b03..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.js +++ /dev/null @@ -1,775 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("diff_match_patch")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "diff_match_patch"], mod); - else // Plain browser env - mod(CodeMirror, diff_match_patch); -})(function(CodeMirror, diff_match_patch) { - "use strict"; - var Pos = CodeMirror.Pos; - var svgNS = "http://www.w3.org/2000/svg"; - - function DiffView(mv, type) { - this.mv = mv; - this.type = type; - this.classes = type == "left" - ? {chunk: "CodeMirror-merge-l-chunk", - start: "CodeMirror-merge-l-chunk-start", - end: "CodeMirror-merge-l-chunk-end", - insert: "CodeMirror-merge-l-inserted", - del: "CodeMirror-merge-l-deleted", - connect: "CodeMirror-merge-l-connect"} - : {chunk: "CodeMirror-merge-r-chunk", - start: "CodeMirror-merge-r-chunk-start", - end: "CodeMirror-merge-r-chunk-end", - insert: "CodeMirror-merge-r-inserted", - del: "CodeMirror-merge-r-deleted", - connect: "CodeMirror-merge-r-connect"}; - } - - DiffView.prototype = { - constructor: DiffView, - init: function(pane, orig, options) { - this.edit = this.mv.edit; - (this.edit.state.diffViews || (this.edit.state.diffViews = [])).push(this); - this.orig = CodeMirror(pane, copyObj({value: orig, readOnly: !this.mv.options.allowEditingOriginals}, copyObj(options))); - this.orig.state.diffViews = [this]; - - this.diff = getDiff(asString(orig), asString(options.value)); - this.chunks = getChunks(this.diff); - this.diffOutOfDate = this.dealigned = false; - - this.showDifferences = options.showDifferences !== false; - this.forceUpdate = registerUpdate(this); - setScrollLock(this, true, false); - registerScroll(this); - }, - setShowDifferences: function(val) { - val = val !== false; - if (val != this.showDifferences) { - this.showDifferences = val; - this.forceUpdate("full"); - } - } - }; - - function ensureDiff(dv) { - if (dv.diffOutOfDate) { - dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue()); - dv.chunks = getChunks(dv.diff); - dv.diffOutOfDate = false; - CodeMirror.signal(dv.edit, "updateDiff", dv.diff); - } - } - - var updating = false; - function registerUpdate(dv) { - var edit = {from: 0, to: 0, marked: []}; - var orig = {from: 0, to: 0, marked: []}; - var debounceChange, updatingFast = false; - function update(mode) { - updating = true; - updatingFast = false; - if (mode == "full") { - if (dv.svg) clear(dv.svg); - if (dv.copyButtons) clear(dv.copyButtons); - clearMarks(dv.edit, edit.marked, dv.classes); - clearMarks(dv.orig, orig.marked, dv.classes); - edit.from = edit.to = orig.from = orig.to = 0; - } - ensureDiff(dv); - if (dv.showDifferences) { - updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes); - updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes); - } - makeConnections(dv); - - if (dv.mv.options.connect == "align") - alignChunks(dv); - updating = false; - } - function setDealign(fast) { - if (updating) return; - dv.dealigned = true; - set(fast); - } - function set(fast) { - if (updating || updatingFast) return; - clearTimeout(debounceChange); - if (fast === true) updatingFast = true; - debounceChange = setTimeout(update, fast === true ? 20 : 250); - } - function change(_cm, change) { - if (!dv.diffOutOfDate) { - dv.diffOutOfDate = true; - edit.from = edit.to = orig.from = orig.to = 0; - } - // Update faster when a line was added/removed - setDealign(change.text.length - 1 != change.to.line - change.from.line); - } - dv.edit.on("change", change); - dv.orig.on("change", change); - dv.edit.on("markerAdded", setDealign); - dv.edit.on("markerCleared", setDealign); - dv.orig.on("markerAdded", setDealign); - dv.orig.on("markerCleared", setDealign); - dv.edit.on("viewportChange", function() { set(false); }); - dv.orig.on("viewportChange", function() { set(false); }); - update(); - return update; - } - - function registerScroll(dv) { - dv.edit.on("scroll", function() { - syncScroll(dv, DIFF_INSERT) && makeConnections(dv); - }); - dv.orig.on("scroll", function() { - syncScroll(dv, DIFF_DELETE) && makeConnections(dv); - }); - } - - function syncScroll(dv, type) { - // Change handler will do a refresh after a timeout when diff is out of date - if (dv.diffOutOfDate) return false; - if (!dv.lockScroll) return true; - var editor, other, now = +new Date; - if (type == DIFF_INSERT) { editor = dv.edit; other = dv.orig; } - else { editor = dv.orig; other = dv.edit; } - // Don't take action if the position of this editor was recently set - // (to prevent feedback loops) - if (editor.state.scrollSetBy == dv && (editor.state.scrollSetAt || 0) + 50 > now) return false; - - var sInfo = editor.getScrollInfo(); - if (dv.mv.options.connect == "align") { - targetPos = sInfo.top; - } else { - var halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen; - var mid = editor.lineAtHeight(midY, "local"); - var around = chunkBoundariesAround(dv.chunks, mid, type == DIFF_INSERT); - var off = getOffsets(editor, type == DIFF_INSERT ? around.edit : around.orig); - var offOther = getOffsets(other, type == DIFF_INSERT ? around.orig : around.edit); - var ratio = (midY - off.top) / (off.bot - off.top); - var targetPos = (offOther.top - halfScreen) + ratio * (offOther.bot - offOther.top); - - var botDist, mix; - // Some careful tweaking to make sure no space is left out of view - // when scrolling to top or bottom. - if (targetPos > sInfo.top && (mix = sInfo.top / halfScreen) < 1) { - targetPos = targetPos * mix + sInfo.top * (1 - mix); - } else if ((botDist = sInfo.height - sInfo.clientHeight - sInfo.top) < halfScreen) { - var otherInfo = other.getScrollInfo(); - var botDistOther = otherInfo.height - otherInfo.clientHeight - targetPos; - if (botDistOther > botDist && (mix = botDist / halfScreen) < 1) - targetPos = targetPos * mix + (otherInfo.height - otherInfo.clientHeight - botDist) * (1 - mix); - } - } - - other.scrollTo(sInfo.left, targetPos); - other.state.scrollSetAt = now; - other.state.scrollSetBy = dv; - return true; - } - - function getOffsets(editor, around) { - var bot = around.after; - if (bot == null) bot = editor.lastLine() + 1; - return {top: editor.heightAtLine(around.before || 0, "local"), - bot: editor.heightAtLine(bot, "local")}; - } - - function setScrollLock(dv, val, action) { - dv.lockScroll = val; - if (val && action != false) syncScroll(dv, DIFF_INSERT) && makeConnections(dv); - dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db  \u21da"; - } - - // Updating the marks for editor content - - function clearMarks(editor, arr, classes) { - for (var i = 0; i < arr.length; ++i) { - var mark = arr[i]; - if (mark instanceof CodeMirror.TextMarker) { - mark.clear(); - } else if (mark.parent) { - editor.removeLineClass(mark, "background", classes.chunk); - editor.removeLineClass(mark, "background", classes.start); - editor.removeLineClass(mark, "background", classes.end); - } - } - arr.length = 0; - } - - // FIXME maybe add a margin around viewport to prevent too many updates - function updateMarks(editor, diff, state, type, classes) { - var vp = editor.getViewport(); - editor.operation(function() { - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - clearMarks(editor, state.marked, classes); - markChanges(editor, diff, type, state.marked, vp.from, vp.to, classes); - state.from = vp.from; state.to = vp.to; - } else { - if (vp.from < state.from) { - markChanges(editor, diff, type, state.marked, vp.from, state.from, classes); - state.from = vp.from; - } - if (vp.to > state.to) { - markChanges(editor, diff, type, state.marked, state.to, vp.to, classes); - state.to = vp.to; - } - } - }); - } - - function markChanges(editor, diff, type, marks, from, to, classes) { - var pos = Pos(0, 0); - var top = Pos(from, 0), bot = editor.clipPos(Pos(to - 1)); - var cls = type == DIFF_DELETE ? classes.del : classes.insert; - function markChunk(start, end) { - var bfrom = Math.max(from, start), bto = Math.min(to, end); - for (var i = bfrom; i < bto; ++i) { - var line = editor.addLineClass(i, "background", classes.chunk); - if (i == start) editor.addLineClass(line, "background", classes.start); - if (i == end - 1) editor.addLineClass(line, "background", classes.end); - marks.push(line); - } - // When the chunk is empty, make sure a horizontal line shows up - if (start == end && bfrom == end && bto == end) { - if (bfrom) - marks.push(editor.addLineClass(bfrom - 1, "background", classes.end)); - else - marks.push(editor.addLineClass(bfrom, "background", classes.start)); - } - } - - var chunkStart = 0; - for (var i = 0; i < diff.length; ++i) { - var part = diff[i], tp = part[0], str = part[1]; - if (tp == DIFF_EQUAL) { - var cleanFrom = pos.line + (startOfLineClean(diff, i) ? 0 : 1); - moveOver(pos, str); - var cleanTo = pos.line + (endOfLineClean(diff, i) ? 1 : 0); - if (cleanTo > cleanFrom) { - if (i) markChunk(chunkStart, cleanFrom); - chunkStart = cleanTo; - } - } else { - if (tp == type) { - var end = moveOver(pos, str, true); - var a = posMax(top, pos), b = posMin(bot, end); - if (!posEq(a, b)) - marks.push(editor.markText(a, b, {className: cls})); - pos = end; - } - } - } - if (chunkStart <= pos.line) markChunk(chunkStart, pos.line + 1); - } - - // Updating the gap between editor and original - - function makeConnections(dv) { - if (!dv.showDifferences) return; - - if (dv.svg) { - clear(dv.svg); - var w = dv.gap.offsetWidth; - attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight); - } - if (dv.copyButtons) clear(dv.copyButtons); - - var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport(); - var sTopEdit = dv.edit.getScrollInfo().top, sTopOrig = dv.orig.getScrollInfo().top; - for (var i = 0; i < dv.chunks.length; i++) { - var ch = dv.chunks[i]; - if (ch.editFrom <= vpEdit.to && ch.editTo >= vpEdit.from && - ch.origFrom <= vpOrig.to && ch.origTo >= vpOrig.from) - drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w); - } - } - - function getMatchingOrigLine(editLine, chunks) { - var editStart = 0, origStart = 0; - for (var i = 0; i < chunks.length; i++) { - var chunk = chunks[i]; - if (chunk.editTo > editLine && chunk.editFrom <= editLine) return null; - if (chunk.editFrom > editLine) break; - editStart = chunk.editTo; - origStart = chunk.origTo; - } - return origStart + (editLine - editStart); - } - - function findAlignedLines(dv, other) { - var linesToAlign = []; - for (var i = 0; i < dv.chunks.length; i++) { - var chunk = dv.chunks[i]; - linesToAlign.push([chunk.origTo, chunk.editTo, other ? getMatchingOrigLine(chunk.editTo, other.chunks) : null]); - } - if (other) { - for (var i = 0; i < other.chunks.length; i++) { - var chunk = other.chunks[i]; - for (var j = 0; j < linesToAlign.length; j++) { - var align = linesToAlign[j]; - if (align[1] == chunk.editTo) { - j = -1; - break; - } else if (align[1] > chunk.editTo) { - break; - } - } - if (j > -1) - linesToAlign.splice(j - 1, 0, [getMatchingOrigLine(chunk.editTo, dv.chunks), chunk.editTo, chunk.origTo]); - } - } - return linesToAlign; - } - - function alignChunks(dv, force) { - if (!dv.dealigned && !force) return; - if (!dv.orig.curOp) return dv.orig.operation(function() { - alignChunks(dv, force); - }); - - dv.dealigned = false; - var other = dv.mv.left == dv ? dv.mv.right : dv.mv.left; - if (other) { - ensureDiff(other); - other.dealigned = false; - } - var linesToAlign = findAlignedLines(dv, other); - - // Clear old aligners - var aligners = dv.mv.aligners; - for (var i = 0; i < aligners.length; i++) - aligners[i].clear(); - aligners.length = 0; - - var cm = [dv.orig, dv.edit], scroll = []; - if (other) cm.push(other.orig); - for (var i = 0; i < cm.length; i++) - scroll.push(cm[i].getScrollInfo().top); - - for (var ln = 0; ln < linesToAlign.length; ln++) - alignLines(cm, linesToAlign[ln], aligners); - - for (var i = 0; i < cm.length; i++) - cm[i].scrollTo(null, scroll[i]); - } - - function alignLines(cm, lines, aligners) { - var maxOffset = 0, offset = []; - for (var i = 0; i < cm.length; i++) if (lines[i] != null) { - var off = cm[i].heightAtLine(lines[i], "local"); - offset[i] = off; - maxOffset = Math.max(maxOffset, off); - } - for (var i = 0; i < cm.length; i++) if (lines[i] != null) { - var diff = maxOffset - offset[i]; - if (diff > 1) - aligners.push(padAbove(cm[i], lines[i], diff)); - } - } - - function padAbove(cm, line, size) { - var above = true; - if (line > cm.lastLine()) { - line--; - above = false; - } - var elt = document.createElement("div"); - elt.className = "CodeMirror-merge-spacer"; - elt.style.height = size + "px"; elt.style.minWidth = "1px"; - return cm.addLineWidget(line, elt, {height: size, above: above}); - } - - function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) { - var flip = dv.type == "left"; - var top = dv.orig.heightAtLine(chunk.origFrom, "local") - sTopOrig; - if (dv.svg) { - var topLpx = top; - var topRpx = dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit; - if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; } - var botLpx = dv.orig.heightAtLine(chunk.origTo, "local") - sTopOrig; - var botRpx = dv.edit.heightAtLine(chunk.editTo, "local") - sTopEdit; - if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; } - var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx; - var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx; - attrs(dv.svg.appendChild(document.createElementNS(svgNS, "path")), - "d", "M -1 " + topRpx + curveTop + " L " + (w + 2) + " " + botLpx + curveBot + " z", - "class", dv.classes.connect); - } - if (dv.copyButtons) { - var copy = dv.copyButtons.appendChild(elt("div", dv.type == "left" ? "\u21dd" : "\u21dc", - "CodeMirror-merge-copy")); - var editOriginals = dv.mv.options.allowEditingOriginals; - copy.title = editOriginals ? "Push to left" : "Revert chunk"; - copy.chunk = chunk; - copy.style.top = top + "px"; - - if (editOriginals) { - var topReverse = dv.orig.heightAtLine(chunk.editFrom, "local") - sTopEdit; - var copyReverse = dv.copyButtons.appendChild(elt("div", dv.type == "right" ? "\u21dd" : "\u21dc", - "CodeMirror-merge-copy-reverse")); - copyReverse.title = "Push to right"; - copyReverse.chunk = {editFrom: chunk.origFrom, editTo: chunk.origTo, - origFrom: chunk.editFrom, origTo: chunk.editTo}; - copyReverse.style.top = topReverse + "px"; - dv.type == "right" ? copyReverse.style.left = "2px" : copyReverse.style.right = "2px"; - } - } - } - - function copyChunk(dv, to, from, chunk) { - if (dv.diffOutOfDate) return; - to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)), - Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0)); - } - - // Merge view, containing 0, 1, or 2 diff views. - - var MergeView = CodeMirror.MergeView = function(node, options) { - if (!(this instanceof MergeView)) return new MergeView(node, options); - - this.options = options; - var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight; - - var hasLeft = origLeft != null, hasRight = origRight != null; - var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0); - var wrap = [], left = this.left = null, right = this.right = null; - var self = this; - - if (hasLeft) { - left = this.left = new DiffView(this, "left"); - var leftPane = elt("div", null, "CodeMirror-merge-pane"); - wrap.push(leftPane); - wrap.push(buildGap(left)); - } - - var editPane = elt("div", null, "CodeMirror-merge-pane"); - wrap.push(editPane); - - if (hasRight) { - right = this.right = new DiffView(this, "right"); - wrap.push(buildGap(right)); - var rightPane = elt("div", null, "CodeMirror-merge-pane"); - wrap.push(rightPane); - } - - (hasRight ? rightPane : editPane).className += " CodeMirror-merge-pane-rightmost"; - - wrap.push(elt("div", null, null, "height: 0; clear: both;")); - - var wrapElt = this.wrap = node.appendChild(elt("div", wrap, "CodeMirror-merge CodeMirror-merge-" + panes + "pane")); - this.edit = CodeMirror(editPane, copyObj(options)); - - if (left) left.init(leftPane, origLeft, options); - if (right) right.init(rightPane, origRight, options); - - if (options.collapseIdentical) { - updating = true; - this.editor().operation(function() { - collapseIdenticalStretches(self, options.collapseIdentical); - }); - updating = false; - } - if (options.connect == "align") { - this.aligners = []; - alignChunks(this.left || this.right, true); - } - - var onResize = function() { - if (left) makeConnections(left); - if (right) makeConnections(right); - }; - CodeMirror.on(window, "resize", onResize); - var resizeInterval = setInterval(function() { - for (var p = wrapElt.parentNode; p && p != document.body; p = p.parentNode) {} - if (!p) { clearInterval(resizeInterval); CodeMirror.off(window, "resize", onResize); } - }, 5000); - }; - - function buildGap(dv) { - var lock = dv.lockButton = elt("div", null, "CodeMirror-merge-scrolllock"); - lock.title = "Toggle locked scrolling"; - var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap"); - CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); }); - var gapElts = [lockWrap]; - if (dv.mv.options.revertButtons !== false) { - dv.copyButtons = elt("div", null, "CodeMirror-merge-copybuttons-" + dv.type); - CodeMirror.on(dv.copyButtons, "click", function(e) { - var node = e.target || e.srcElement; - if (!node.chunk) return; - if (node.className == "CodeMirror-merge-copy-reverse") { - copyChunk(dv, dv.orig, dv.edit, node.chunk); - return; - } - copyChunk(dv, dv.edit, dv.orig, node.chunk); - }); - gapElts.unshift(dv.copyButtons); - } - if (dv.mv.options.connect != "align") { - var svg = document.createElementNS && document.createElementNS(svgNS, "svg"); - if (svg && !svg.createSVGRect) svg = null; - dv.svg = svg; - if (svg) gapElts.push(svg); - } - - return dv.gap = elt("div", gapElts, "CodeMirror-merge-gap"); - } - - MergeView.prototype = { - constuctor: MergeView, - editor: function() { return this.edit; }, - rightOriginal: function() { return this.right && this.right.orig; }, - leftOriginal: function() { return this.left && this.left.orig; }, - setShowDifferences: function(val) { - if (this.right) this.right.setShowDifferences(val); - if (this.left) this.left.setShowDifferences(val); - }, - rightChunks: function() { - if (this.right) { ensureDiff(this.right); return this.right.chunks; } - }, - leftChunks: function() { - if (this.left) { ensureDiff(this.left); return this.left.chunks; } - } - }; - - function asString(obj) { - if (typeof obj == "string") return obj; - else return obj.getValue(); - } - - // Operations on diffs - - var dmp = new diff_match_patch(); - function getDiff(a, b) { - var diff = dmp.diff_main(a, b); - dmp.diff_cleanupSemantic(diff); - // The library sometimes leaves in empty parts, which confuse the algorithm - for (var i = 0; i < diff.length; ++i) { - var part = diff[i]; - if (!part[1]) { - diff.splice(i--, 1); - } else if (i && diff[i - 1][0] == part[0]) { - diff.splice(i--, 1); - diff[i][1] += part[1]; - } - } - return diff; - } - - function getChunks(diff) { - var chunks = []; - var startEdit = 0, startOrig = 0; - var edit = Pos(0, 0), orig = Pos(0, 0); - for (var i = 0; i < diff.length; ++i) { - var part = diff[i], tp = part[0]; - if (tp == DIFF_EQUAL) { - var startOff = startOfLineClean(diff, i) ? 0 : 1; - var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff; - moveOver(edit, part[1], null, orig); - var endOff = endOfLineClean(diff, i) ? 1 : 0; - var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff; - if (cleanToEdit > cleanFromEdit) { - if (i) chunks.push({origFrom: startOrig, origTo: cleanFromOrig, - editFrom: startEdit, editTo: cleanFromEdit}); - startEdit = cleanToEdit; startOrig = cleanToOrig; - } - } else { - moveOver(tp == DIFF_INSERT ? edit : orig, part[1]); - } - } - if (startEdit <= edit.line || startOrig <= orig.line) - chunks.push({origFrom: startOrig, origTo: orig.line + 1, - editFrom: startEdit, editTo: edit.line + 1}); - return chunks; - } - - function endOfLineClean(diff, i) { - if (i == diff.length - 1) return true; - var next = diff[i + 1][1]; - if (next.length == 1 || next.charCodeAt(0) != 10) return false; - if (i == diff.length - 2) return true; - next = diff[i + 2][1]; - return next.length > 1 && next.charCodeAt(0) == 10; - } - - function startOfLineClean(diff, i) { - if (i == 0) return true; - var last = diff[i - 1][1]; - if (last.charCodeAt(last.length - 1) != 10) return false; - if (i == 1) return true; - last = diff[i - 2][1]; - return last.charCodeAt(last.length - 1) == 10; - } - - function chunkBoundariesAround(chunks, n, nInEdit) { - var beforeE, afterE, beforeO, afterO; - for (var i = 0; i < chunks.length; i++) { - var chunk = chunks[i]; - var fromLocal = nInEdit ? chunk.editFrom : chunk.origFrom; - var toLocal = nInEdit ? chunk.editTo : chunk.origTo; - if (afterE == null) { - if (fromLocal > n) { afterE = chunk.editFrom; afterO = chunk.origFrom; } - else if (toLocal > n) { afterE = chunk.editTo; afterO = chunk.origTo; } - } - if (toLocal <= n) { beforeE = chunk.editTo; beforeO = chunk.origTo; } - else if (fromLocal <= n) { beforeE = chunk.editFrom; beforeO = chunk.origFrom; } - } - return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}}; - } - - function collapseSingle(cm, from, to) { - cm.addLineClass(from, "wrap", "CodeMirror-merge-collapsed-line"); - var widget = document.createElement("span"); - widget.className = "CodeMirror-merge-collapsed-widget"; - widget.title = "Identical text collapsed. Click to expand."; - var mark = cm.markText(Pos(from, 0), Pos(to - 1), { - inclusiveLeft: true, - inclusiveRight: true, - replacedWith: widget, - clearOnEnter: true - }); - function clear() { - mark.clear(); - cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line"); - } - widget.addEventListener("click", clear); - return {mark: mark, clear: clear}; - } - - function collapseStretch(size, editors) { - var marks = []; - function clear() { - for (var i = 0; i < marks.length; i++) marks[i].clear(); - } - for (var i = 0; i < editors.length; i++) { - var editor = editors[i]; - var mark = collapseSingle(editor.cm, editor.line, editor.line + size); - marks.push(mark); - mark.mark.on("clear", clear); - } - return marks[0].mark; - } - - function unclearNearChunks(dv, margin, off, clear) { - for (var i = 0; i < dv.chunks.length; i++) { - var chunk = dv.chunks[i]; - for (var l = chunk.editFrom - margin; l < chunk.editTo + margin; l++) { - var pos = l + off; - if (pos >= 0 && pos < clear.length) clear[pos] = false; - } - } - } - - function collapseIdenticalStretches(mv, margin) { - if (typeof margin != "number") margin = 2; - var clear = [], edit = mv.editor(), off = edit.firstLine(); - for (var l = off, e = edit.lastLine(); l <= e; l++) clear.push(true); - if (mv.left) unclearNearChunks(mv.left, margin, off, clear); - if (mv.right) unclearNearChunks(mv.right, margin, off, clear); - - for (var i = 0; i < clear.length; i++) { - if (clear[i]) { - var line = i + off; - for (var size = 1; i < clear.length - 1 && clear[i + 1]; i++, size++) {} - if (size > margin) { - var editors = [{line: line, cm: edit}]; - if (mv.left) editors.push({line: getMatchingOrigLine(line, mv.left.chunks), cm: mv.left.orig}); - if (mv.right) editors.push({line: getMatchingOrigLine(line, mv.right.chunks), cm: mv.right.orig}); - var mark = collapseStretch(size, editors); - if (mv.options.onCollapse) mv.options.onCollapse(mv, line, size, mark); - } - } - } - } - - // General utilities - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) e.className = className; - if (style) e.style.cssText = style; - if (typeof content == "string") e.appendChild(document.createTextNode(content)); - else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); - return e; - } - - function clear(node) { - for (var count = node.childNodes.length; count > 0; --count) - node.removeChild(node.firstChild); - } - - function attrs(elt) { - for (var i = 1; i < arguments.length; i += 2) - elt.setAttribute(arguments[i], arguments[i+1]); - } - - function copyObj(obj, target) { - if (!target) target = {}; - for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop]; - return target; - } - - function moveOver(pos, str, copy, other) { - var out = copy ? Pos(pos.line, pos.ch) : pos, at = 0; - for (;;) { - var nl = str.indexOf("\n", at); - if (nl == -1) break; - ++out.line; - if (other) ++other.line; - at = nl + 1; - } - out.ch = (at ? 0 : out.ch) + (str.length - at); - if (other) other.ch = (at ? 0 : other.ch) + (str.length - at); - return out; - } - - function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a : b; } - function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 0 ? a : b; } - function posEq(a, b) { return a.line == b.line && a.ch == b.ch; } - - function findPrevDiff(chunks, start, isOrig) { - for (var i = chunks.length - 1; i >= 0; i--) { - var chunk = chunks[i]; - var to = (isOrig ? chunk.origTo : chunk.editTo) - 1; - if (to < start) return to; - } - } - - function findNextDiff(chunks, start, isOrig) { - for (var i = 0; i < chunks.length; i++) { - var chunk = chunks[i]; - var from = (isOrig ? chunk.origFrom : chunk.editFrom); - if (from > start) return from; - } - } - - function goNearbyDiff(cm, dir) { - var found = null, views = cm.state.diffViews, line = cm.getCursor().line; - if (views) for (var i = 0; i < views.length; i++) { - var dv = views[i], isOrig = cm == dv.orig; - ensureDiff(dv); - var pos = dir < 0 ? findPrevDiff(dv.chunks, line, isOrig) : findNextDiff(dv.chunks, line, isOrig); - if (pos != null && (found == null || (dir < 0 ? pos > found : pos < found))) - found = pos; - } - if (found != null) - cm.setCursor(found, 0); - else - return CodeMirror.Pass; - } - - CodeMirror.commands.goNextDiff = function(cm) { - return goNearbyDiff(cm, 1); - }; - CodeMirror.commands.goPrevDiff = function(cm) { - return goNearbyDiff(cm, -1); - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/loadmode.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/loadmode.js deleted file mode 100644 index 10117ec..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/loadmode.js +++ /dev/null @@ -1,64 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), "cjs"); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); }); - else // Plain browser env - mod(CodeMirror, "plain"); -})(function(CodeMirror, env) { - if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; - - var loading = {}; - function splitCallback(cont, n) { - var countDown = n; - return function() { if (--countDown == 0) cont(); }; - } - function ensureDeps(mode, cont) { - var deps = CodeMirror.modes[mode].dependencies; - if (!deps) return cont(); - var missing = []; - for (var i = 0; i < deps.length; ++i) { - if (!CodeMirror.modes.hasOwnProperty(deps[i])) - missing.push(deps[i]); - } - if (!missing.length) return cont(); - var split = splitCallback(cont, missing.length); - for (var i = 0; i < missing.length; ++i) - CodeMirror.requireMode(missing[i], split); - } - - CodeMirror.requireMode = function(mode, cont) { - if (typeof mode != "string") mode = mode.name; - if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); - if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); - - var file = CodeMirror.modeURL.replace(/%N/g, mode); - if (env == "plain") { - var script = document.createElement("script"); - script.src = file; - var others = document.getElementsByTagName("script")[0]; - var list = loading[mode] = [cont]; - CodeMirror.on(script, "load", function() { - ensureDeps(mode, function() { - for (var i = 0; i < list.length; ++i) list[i](); - }); - }); - others.parentNode.insertBefore(script, others); - } else if (env == "cjs") { - require(file); - cont(); - } else if (env == "amd") { - requirejs([file], cont); - } - }; - - CodeMirror.autoLoadMode = function(instance, mode) { - if (!CodeMirror.modes.hasOwnProperty(mode)) - CodeMirror.requireMode(mode, function() { - instance.setOption("mode", instance.getOption("mode")); - }); - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex.js deleted file mode 100644 index fe48c7f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex.js +++ /dev/null @@ -1,123 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.multiplexingMode = function(outer /*, others */) { - // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects - var others = Array.prototype.slice.call(arguments, 1); - - function indexOf(string, pattern, from, returnEnd) { - if (typeof pattern == "string") { - var found = string.indexOf(pattern, from); - return returnEnd && found > -1 ? found + pattern.length : found; - } - var m = pattern.exec(from ? string.slice(from) : string); - return m ? m.index + from + (returnEnd ? m[0].length : 0) : -1; - } - - return { - startState: function() { - return { - outer: CodeMirror.startState(outer), - innerActive: null, - inner: null - }; - }, - - copyState: function(state) { - return { - outer: CodeMirror.copyState(outer, state.outer), - innerActive: state.innerActive, - inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) - }; - }, - - token: function(stream, state) { - if (!state.innerActive) { - var cutOff = Infinity, oldContent = stream.string; - for (var i = 0; i < others.length; ++i) { - var other = others[i]; - var found = indexOf(oldContent, other.open, stream.pos); - if (found == stream.pos) { - if (!other.parseDelimiters) stream.match(other.open); - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle; - } else if (found != -1 && found < cutOff) { - cutOff = found; - } - } - if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); - var outerToken = outer.token(stream, state.outer); - if (cutOff != Infinity) stream.string = oldContent; - return outerToken; - } else { - var curInner = state.innerActive, oldContent = stream.string; - if (!curInner.close && stream.sol()) { - state.innerActive = state.inner = null; - return this.token(stream, state); - } - var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1; - if (found == stream.pos && !curInner.parseDelimiters) { - stream.match(curInner.close); - state.innerActive = state.inner = null; - return curInner.delimStyle; - } - if (found > -1) stream.string = oldContent.slice(0, found); - var innerToken = curInner.mode.token(stream, state.inner); - if (found > -1) stream.string = oldContent; - - if (found == stream.pos && curInner.parseDelimiters) - state.innerActive = state.inner = null; - - if (curInner.innerStyle) { - if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; - else innerToken = curInner.innerStyle; - } - - return innerToken; - } - }, - - indent: function(state, textAfter) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (!mode.indent) return CodeMirror.Pass; - return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); - }, - - blankLine: function(state) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (mode.blankLine) { - mode.blankLine(state.innerActive ? state.inner : state.outer); - } - if (!state.innerActive) { - for (var i = 0; i < others.length; ++i) { - var other = others[i]; - if (other.open === "\n") { - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); - } - } - } else if (state.innerActive.close === "\n") { - state.innerActive = state.inner = null; - } - }, - - electricChars: outer.electricChars, - - innerMode: function(state) { - return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; - } - }; -}; - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex_test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex_test.js deleted file mode 100644 index d339434..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex_test.js +++ /dev/null @@ -1,33 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - CodeMirror.defineMode("markdown_with_stex", function(){ - var inner = CodeMirror.getMode({}, "stex"); - var outer = CodeMirror.getMode({}, "markdown"); - - var innerOptions = { - open: '$', - close: '$', - mode: inner, - delimStyle: 'delim', - innerStyle: 'inner' - }; - - return CodeMirror.multiplexingMode(outer, innerOptions); - }); - - var mode = CodeMirror.getMode({}, "markdown_with_stex"); - - function MT(name) { - test.mode( - name, - mode, - Array.prototype.slice.call(arguments, 1), - 'multiplexing'); - } - - MT( - "stexInsideMarkdown", - "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]"); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/overlay.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/overlay.js deleted file mode 100644 index e1b9ed3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/overlay.js +++ /dev/null @@ -1,85 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Utility function that allows modes to be combined. The mode given -// as the base argument takes care of most of the normal mode -// functionality, but a second (typically simple) mode is used, which -// can override the style of text. Both modes get to parse all of the -// text, but when both assign a non-null style to a piece of code, the -// overlay wins, unless the combine argument was true and not overridden, -// or state.overlay.combineTokens was true, in which case the styles are -// combined. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.overlayMode = function(base, overlay, combine) { - return { - startState: function() { - return { - base: CodeMirror.startState(base), - overlay: CodeMirror.startState(overlay), - basePos: 0, baseCur: null, - overlayPos: 0, overlayCur: null, - streamSeen: null - }; - }, - copyState: function(state) { - return { - base: CodeMirror.copyState(base, state.base), - overlay: CodeMirror.copyState(overlay, state.overlay), - basePos: state.basePos, baseCur: null, - overlayPos: state.overlayPos, overlayCur: null - }; - }, - - token: function(stream, state) { - if (stream != state.streamSeen || - Math.min(state.basePos, state.overlayPos) < stream.start) { - state.streamSeen = stream; - state.basePos = state.overlayPos = stream.start; - } - - if (stream.start == state.basePos) { - state.baseCur = base.token(stream, state.base); - state.basePos = stream.pos; - } - if (stream.start == state.overlayPos) { - stream.pos = stream.start; - state.overlayCur = overlay.token(stream, state.overlay); - state.overlayPos = stream.pos; - } - stream.pos = Math.min(state.basePos, state.overlayPos); - - // state.overlay.combineTokens always takes precedence over combine, - // unless set to null - if (state.overlayCur == null) return state.baseCur; - else if (state.baseCur != null && - state.overlay.combineTokens || - combine && state.overlay.combineTokens == null) - return state.baseCur + " " + state.overlayCur; - else return state.overlayCur; - }, - - indent: base.indent && function(state, textAfter) { - return base.indent(state.base, textAfter); - }, - electricChars: base.electricChars, - - innerMode: function(state) { return {state: state.base, mode: base}; }, - - blankLine: function(state) { - if (base.blankLine) base.blankLine(state.base); - if (overlay.blankLine) overlay.blankLine(state.overlay); - } - }; -}; - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/simple.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/simple.js deleted file mode 100644 index 795328b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/simple.js +++ /dev/null @@ -1,213 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineSimpleMode = function(name, states) { - CodeMirror.defineMode(name, function(config) { - return CodeMirror.simpleMode(config, states); - }); - }; - - CodeMirror.simpleMode = function(config, states) { - ensureState(states, "start"); - var states_ = {}, meta = states.meta || {}, hasIndentation = false; - for (var state in states) if (state != meta && states.hasOwnProperty(state)) { - var list = states_[state] = [], orig = states[state]; - for (var i = 0; i < orig.length; i++) { - var data = orig[i]; - list.push(new Rule(data, states)); - if (data.indent || data.dedent) hasIndentation = true; - } - } - var mode = { - startState: function() { - return {state: "start", pending: null, - local: null, localState: null, - indent: hasIndentation ? [] : null}; - }, - copyState: function(state) { - var s = {state: state.state, pending: state.pending, - local: state.local, localState: null, - indent: state.indent && state.indent.slice(0)}; - if (state.localState) - s.localState = CodeMirror.copyState(state.local.mode, state.localState); - if (state.stack) - s.stack = state.stack.slice(0); - for (var pers = state.persistentStates; pers; pers = pers.next) - s.persistentStates = {mode: pers.mode, - spec: pers.spec, - state: pers.state == state.localState ? s.localState : CodeMirror.copyState(pers.mode, pers.state), - next: s.persistentStates}; - return s; - }, - token: tokenFunction(states_, config), - innerMode: function(state) { return state.local && {mode: state.local.mode, state: state.localState}; }, - indent: indentFunction(states_, meta) - }; - if (meta) for (var prop in meta) if (meta.hasOwnProperty(prop)) - mode[prop] = meta[prop]; - return mode; - }; - - function ensureState(states, name) { - if (!states.hasOwnProperty(name)) - throw new Error("Undefined state " + name + "in simple mode"); - } - - function toRegex(val, caret) { - if (!val) return /(?:)/; - var flags = ""; - if (val instanceof RegExp) { - if (val.ignoreCase) flags = "i"; - val = val.source; - } else { - val = String(val); - } - return new RegExp((caret === false ? "" : "^") + "(?:" + val + ")", flags); - } - - function asToken(val) { - if (!val) return null; - if (typeof val == "string") return val.replace(/\./g, " "); - var result = []; - for (var i = 0; i < val.length; i++) - result.push(val[i] && val[i].replace(/\./g, " ")); - return result; - } - - function Rule(data, states) { - if (data.next || data.push) ensureState(states, data.next || data.push); - this.regex = toRegex(data.regex); - this.token = asToken(data.token); - this.data = data; - } - - function tokenFunction(states, config) { - return function(stream, state) { - if (state.pending) { - var pend = state.pending.shift(); - if (state.pending.length == 0) state.pending = null; - stream.pos += pend.text.length; - return pend.token; - } - - if (state.local) { - if (state.local.end && stream.match(state.local.end)) { - var tok = state.local.endToken || null; - state.local = state.localState = null; - return tok; - } else { - var tok = state.local.mode.token(stream, state.localState), m; - if (state.local.endScan && (m = state.local.endScan.exec(stream.current()))) - stream.pos = stream.start + m.index; - return tok; - } - } - - var curState = states[state.state]; - for (var i = 0; i < curState.length; i++) { - var rule = curState[i]; - var matches = (!rule.data.sol || stream.sol()) && stream.match(rule.regex); - if (matches) { - if (rule.data.next) { - state.state = rule.data.next; - } else if (rule.data.push) { - (state.stack || (state.stack = [])).push(state.state); - state.state = rule.data.push; - } else if (rule.data.pop && state.stack && state.stack.length) { - state.state = state.stack.pop(); - } - - if (rule.data.mode) - enterLocalMode(config, state, rule.data.mode, rule.token); - if (rule.data.indent) - state.indent.push(stream.indentation() + config.indentUnit); - if (rule.data.dedent) - state.indent.pop(); - if (matches.length > 2) { - state.pending = []; - for (var j = 2; j < matches.length; j++) - if (matches[j]) - state.pending.push({text: matches[j], token: rule.token[j - 1]}); - stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0)); - return rule.token[0]; - } else if (rule.token && rule.token.join) { - return rule.token[0]; - } else { - return rule.token; - } - } - } - stream.next(); - return null; - }; - } - - function cmp(a, b) { - if (a === b) return true; - if (!a || typeof a != "object" || !b || typeof b != "object") return false; - var props = 0; - for (var prop in a) if (a.hasOwnProperty(prop)) { - if (!b.hasOwnProperty(prop) || !cmp(a[prop], b[prop])) return false; - props++; - } - for (var prop in b) if (b.hasOwnProperty(prop)) props--; - return props == 0; - } - - function enterLocalMode(config, state, spec, token) { - var pers; - if (spec.persistent) for (var p = state.persistentStates; p && !pers; p = p.next) - if (spec.spec ? cmp(spec.spec, p.spec) : spec.mode == p.mode) pers = p; - var mode = pers ? pers.mode : spec.mode || CodeMirror.getMode(config, spec.spec); - var lState = pers ? pers.state : CodeMirror.startState(mode); - if (spec.persistent && !pers) - state.persistentStates = {mode: mode, spec: spec.spec, state: lState, next: state.persistentStates}; - - state.localState = lState; - state.local = {mode: mode, - end: spec.end && toRegex(spec.end), - endScan: spec.end && spec.forceEnd !== false && toRegex(spec.end, false), - endToken: token && token.join ? token[token.length - 1] : token}; - } - - function indexOf(val, arr) { - for (var i = 0; i < arr.length; i++) if (arr[i] === val) return true; - } - - function indentFunction(states, meta) { - return function(state, textAfter, line) { - if (state.local && state.local.mode.indent) - return state.local.mode.indent(state.localState, textAfter, line); - if (state.indent == null || state.local || meta.dontIndentStates && indexOf(state.state, meta.dontIndentStates) > -1) - return CodeMirror.Pass; - - var pos = state.indent.length - 1, rules = states[state.state]; - scan: for (;;) { - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - if (rule.data.dedent && rule.data.dedentIfLineStart !== false) { - var m = rule.regex.exec(textAfter); - if (m && m[0]) { - pos--; - if (rule.next || rule.push) rules = states[rule.next || rule.push]; - textAfter = textAfter.slice(m[0].length); - continue scan; - } - } - } - break; - } - return pos < 0 ? 0 : state.indent[pos]; - }; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/colorize.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/colorize.js deleted file mode 100644 index eb7060d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/colorize.js +++ /dev/null @@ -1,40 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./runmode")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./runmode"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; - - function textContent(node, out) { - if (node.nodeType == 3) return out.push(node.nodeValue); - for (var ch = node.firstChild; ch; ch = ch.nextSibling) { - textContent(ch, out); - if (isBlock.test(node.nodeType)) out.push("\n"); - } - } - - CodeMirror.colorize = function(collection, defaultMode) { - if (!collection) collection = document.body.getElementsByTagName("pre"); - - for (var i = 0; i < collection.length; ++i) { - var node = collection[i]; - var mode = node.getAttribute("data-lang") || defaultMode; - if (!mode) continue; - - var text = []; - textContent(node, text); - node.innerHTML = ""; - CodeMirror.runMode(text.join(""), mode, node); - - node.className += " cm-s-default"; - } - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode-standalone.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode-standalone.js deleted file mode 100644 index f4f352c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode-standalone.js +++ /dev/null @@ -1,157 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -window.CodeMirror = {}; - -(function() { -"use strict"; - -function splitLines(string){ return string.split(/\r?\n|\r/); }; - -function StringStream(string) { - this.pos = this.start = 0; - this.string = string; - this.lineStart = 0; -} -StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos) || null;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return this.start - this.lineStart;}, - indentation: function() {return 0;}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } -}; -CodeMirror.StringStream = StringStream; - -CodeMirror.startState = function (mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; -}; - -var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; -CodeMirror.defineMode = function (name, mode) { - if (arguments.length > 2) - mode.dependencies = Array.prototype.slice.call(arguments, 2); - modes[name] = mode; -}; -CodeMirror.defineMIME = function (mime, spec) { mimeModes[mime] = spec; }; -CodeMirror.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - spec = mimeModes[spec.name]; - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; -}; -CodeMirror.getMode = function (options, spec) { - spec = CodeMirror.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) throw new Error("Unknown mode: " + spec); - return mfactory(options, spec); -}; -CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min; -CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; -}); -CodeMirror.defineMIME("text/plain", "null"); - -CodeMirror.runMode = function (string, modespec, callback, options) { - var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec); - - if (callback.nodeType == 1) { - var tabSize = (options && options.tabSize) || 4; - var node = callback, col = 0; - node.innerHTML = ""; - callback = function (text, style) { - if (text == "\n") { - node.appendChild(document.createElement("br")); - col = 0; - return; - } - var content = ""; - // replace tabs - for (var pos = 0; ;) { - var idx = text.indexOf("\t", pos); - if (idx == -1) { - content += text.slice(pos); - col += text.length - pos; - break; - } else { - col += idx - pos; - content += text.slice(pos, idx); - var size = tabSize - col % tabSize; - col += size; - for (var i = 0; i < size; ++i) content += " "; - pos = idx + 1; - } - } - - if (style) { - var sp = node.appendChild(document.createElement("span")); - sp.className = "cm-" + style.replace(/ +/g, " cm-"); - sp.appendChild(document.createTextNode(content)); - } else { - node.appendChild(document.createTextNode(content)); - } - }; - } - - var lines = splitLines(string), state = (options && options.state) || CodeMirror.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new CodeMirror.StringStream(lines[i]); - if (!stream.string && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start, state); - stream.start = stream.pos; - } - } -}; -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.js deleted file mode 100644 index 07d2279..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.js +++ /dev/null @@ -1,72 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.runMode = function(string, modespec, callback, options) { - var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); - var ie = /MSIE \d/.test(navigator.userAgent); - var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9); - - if (callback.nodeType == 1) { - var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; - var node = callback, col = 0; - node.innerHTML = ""; - callback = function(text, style) { - if (text == "\n") { - // Emitting LF or CRLF on IE8 or earlier results in an incorrect display. - // Emitting a carriage return makes everything ok. - node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text)); - col = 0; - return; - } - var content = ""; - // replace tabs - for (var pos = 0;;) { - var idx = text.indexOf("\t", pos); - if (idx == -1) { - content += text.slice(pos); - col += text.length - pos; - break; - } else { - col += idx - pos; - content += text.slice(pos, idx); - var size = tabSize - col % tabSize; - col += size; - for (var i = 0; i < size; ++i) content += " "; - pos = idx + 1; - } - } - - if (style) { - var sp = node.appendChild(document.createElement("span")); - sp.className = "cm-" + style.replace(/ +/g, " cm-"); - sp.appendChild(document.createTextNode(content)); - } else { - node.appendChild(document.createTextNode(content)); - } - }; - } - - var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new CodeMirror.StringStream(lines[i]); - if (!stream.string && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start, state); - stream.start = stream.pos; - } - } -}; - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.node.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.node.js deleted file mode 100644 index 8f345a3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.node.js +++ /dev/null @@ -1,178 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* Just enough of CodeMirror to run runMode under node.js */ - -function splitLines(string){return string.split(/\r\n?|\n/);}; - -// Counts the column offset in a string, taking tabs into account. -// Used mostly to find indentation. -var countColumn = function(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i); - if (nextTab < 0 || nextTab >= end) - return n + (end - i); - n += nextTab - i; - n += tabSize - (n % tabSize); - i = nextTab + 1; - } -}; - -function StringStream(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; -}; - -StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == this.lineStart;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - indentation: function() { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } -}; -exports.StringStream = StringStream; - -exports.startState = function(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; -}; - -var modes = exports.modes = {}, mimeModes = exports.mimeModes = {}; -exports.defineMode = function(name, mode) { - if (arguments.length > 2) - mode.dependencies = Array.prototype.slice.call(arguments, 2); - modes[name] = mode; -}; -exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; }; - -exports.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; -}); -exports.defineMIME("text/plain", "null"); - -exports.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - spec = mimeModes[spec.name]; - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; -}; - -function copyObj(obj, target, overwrite) { - if (!target) target = {}; - for (var prop in obj) - if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - target[prop] = obj[prop]; - return target; -} - -// This can be used to attach properties to mode objects from -// outside the actual mode definition. -var modeExtensions = exports.modeExtensions = {}; -exports.extendMode = function(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - copyObj(properties, exts); -}; - -exports.getMode = function(options, spec) { - var spec = exports.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) return exports.getMode(options, "text/plain"); - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) continue; - if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - if (spec.helperType) modeObj.helperType = spec.helperType; - if (spec.modeProps) for (var prop in spec.modeProps) - modeObj[prop] = spec.modeProps[prop]; - - return modeObj; -}; -exports.registerHelper = exports.registerGlobalHelper = Math.min; - -exports.runMode = function(string, modespec, callback, options) { - var mode = exports.getMode({indentUnit: 2}, modespec); - var lines = splitLines(string), state = (options && options.state) || exports.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new exports.StringStream(lines[i]); - if (!stream.string && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style, i, stream.start, state); - stream.start = stream.pos; - } - } -}; - -require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")]; diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/annotatescrollbar.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/annotatescrollbar.js deleted file mode 100644 index e62a45a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/annotatescrollbar.js +++ /dev/null @@ -1,115 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineExtension("annotateScrollbar", function(options) { - if (typeof options == "string") options = {className: options}; - return new Annotation(this, options); - }); - - CodeMirror.defineOption("scrollButtonHeight", 0); - - function Annotation(cm, options) { - this.cm = cm; - this.options = options; - this.buttonHeight = options.scrollButtonHeight || cm.getOption("scrollButtonHeight"); - this.annotations = []; - this.doRedraw = this.doUpdate = null; - this.div = cm.getWrapperElement().appendChild(document.createElement("div")); - this.div.style.cssText = "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none"; - this.computeScale(); - - function scheduleRedraw(delay) { - clearTimeout(self.doRedraw); - self.doRedraw = setTimeout(function() { self.redraw(); }, delay); - } - - var self = this; - cm.on("refresh", this.resizeHandler = function() { - clearTimeout(self.doUpdate); - self.doUpdate = setTimeout(function() { - if (self.computeScale()) scheduleRedraw(20); - }, 100); - }); - cm.on("markerAdded", this.resizeHandler); - cm.on("markerCleared", this.resizeHandler); - if (options.listenForChanges !== false) - cm.on("change", this.changeHandler = function() { - scheduleRedraw(250); - }); - } - - Annotation.prototype.computeScale = function() { - var cm = this.cm; - var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) / - cm.heightAtLine(cm.lastLine() + 1, "local"); - if (hScale != this.hScale) { - this.hScale = hScale; - return true; - } - }; - - Annotation.prototype.update = function(annotations) { - this.annotations = annotations; - this.redraw(); - }; - - Annotation.prototype.redraw = function(compute) { - if (compute !== false) this.computeScale(); - var cm = this.cm, hScale = this.hScale; - - var frag = document.createDocumentFragment(), anns = this.annotations; - - var wrapping = cm.getOption("lineWrapping"); - var singleLineH = wrapping && cm.defaultTextHeight() * 1.5; - var curLine = null, curLineObj = null; - function getY(pos, top) { - if (curLine != pos.line) { - curLine = pos.line; - curLineObj = cm.getLineHandle(curLine); - } - if (wrapping && curLineObj.height > singleLineH) - return cm.charCoords(pos, "local")[top ? "top" : "bottom"]; - var topY = cm.heightAtLine(curLineObj, "local"); - return topY + (top ? 0 : curLineObj.height); - } - - if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) { - var ann = anns[i]; - var top = nextTop || getY(ann.from, true) * hScale; - var bottom = getY(ann.to, false) * hScale; - while (i < anns.length - 1) { - nextTop = getY(anns[i + 1].from, true) * hScale; - if (nextTop > bottom + .9) break; - ann = anns[++i]; - bottom = getY(ann.to, false) * hScale; - } - if (bottom == top) continue; - var height = Math.max(bottom - top, 3); - - var elt = frag.appendChild(document.createElement("div")); - elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " - + (top + this.buttonHeight) + "px; height: " + height + "px"; - elt.className = this.options.className; - } - this.div.textContent = ""; - this.div.appendChild(frag); - }; - - Annotation.prototype.clear = function() { - this.cm.off("refresh", this.resizeHandler); - this.cm.off("markerAdded", this.resizeHandler); - this.cm.off("markerCleared", this.resizeHandler); - if (this.changeHandler) this.cm.off("change", this.changeHandler); - this.div.parentNode.removeChild(this.div); - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/scrollpastend.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/scrollpastend.js deleted file mode 100644 index 008ae4c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/scrollpastend.js +++ /dev/null @@ -1,46 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.off("change", onChange); - cm.off("refresh", updateBottomMargin); - cm.display.lineSpace.parentNode.style.paddingBottom = ""; - cm.state.scrollPastEndPadding = null; - } - if (val) { - cm.on("change", onChange); - cm.on("refresh", updateBottomMargin); - updateBottomMargin(cm); - } - }); - - function onChange(cm, change) { - if (CodeMirror.changeEnd(change).line == cm.lastLine()) - updateBottomMargin(cm); - } - - function updateBottomMargin(cm) { - var padding = ""; - if (cm.lineCount() > 1) { - var totalH = cm.display.scroller.clientHeight - 30, - lastLineH = cm.getLineHandle(cm.lastLine()).height; - padding = (totalH - lastLineH) + "px"; - } - if (cm.state.scrollPastEndPadding != padding) { - cm.state.scrollPastEndPadding = padding; - cm.display.lineSpace.parentNode.style.paddingBottom = padding; - cm.setSize(); - } - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.css deleted file mode 100644 index 5eea7aa..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.css +++ /dev/null @@ -1,66 +0,0 @@ -.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { - position: absolute; - background: #ccc; - -moz-box-sizing: border-box; - box-sizing: border-box; - border: 1px solid #bbb; - border-radius: 2px; -} - -.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { - position: absolute; - z-index: 6; - background: #eee; -} - -.CodeMirror-simplescroll-horizontal { - bottom: 0; left: 0; - height: 8px; -} -.CodeMirror-simplescroll-horizontal div { - bottom: 0; - height: 100%; -} - -.CodeMirror-simplescroll-vertical { - right: 0; top: 0; - width: 8px; -} -.CodeMirror-simplescroll-vertical div { - right: 0; - width: 100%; -} - - -.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { - display: none; -} - -.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { - position: absolute; - background: #bcd; - border-radius: 3px; -} - -.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { - position: absolute; - z-index: 6; -} - -.CodeMirror-overlayscroll-horizontal { - bottom: 0; left: 0; - height: 6px; -} -.CodeMirror-overlayscroll-horizontal div { - bottom: 0; - height: 100%; -} - -.CodeMirror-overlayscroll-vertical { - right: 0; top: 0; - width: 6px; -} -.CodeMirror-overlayscroll-vertical div { - right: 0; - width: 100%; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.js deleted file mode 100644 index f78353a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.js +++ /dev/null @@ -1,147 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function Bar(cls, orientation, scroll) { - this.orientation = orientation; - this.scroll = scroll; - this.screen = this.total = this.size = 1; - this.pos = 0; - - this.node = document.createElement("div"); - this.node.className = cls + "-" + orientation; - this.inner = this.node.appendChild(document.createElement("div")); - - var self = this; - CodeMirror.on(this.inner, "mousedown", function(e) { - if (e.which != 1) return; - CodeMirror.e_preventDefault(e); - var axis = self.orientation == "horizontal" ? "pageX" : "pageY"; - var start = e[axis], startpos = self.pos; - function done() { - CodeMirror.off(document, "mousemove", move); - CodeMirror.off(document, "mouseup", done); - } - function move(e) { - if (e.which != 1) return done(); - self.moveTo(startpos + (e[axis] - start) * (self.total / self.size)); - } - CodeMirror.on(document, "mousemove", move); - CodeMirror.on(document, "mouseup", done); - }); - - CodeMirror.on(this.node, "click", function(e) { - CodeMirror.e_preventDefault(e); - var innerBox = self.inner.getBoundingClientRect(), where; - if (self.orientation == "horizontal") - where = e.clientX < innerBox.left ? -1 : e.clientX > innerBox.right ? 1 : 0; - else - where = e.clientY < innerBox.top ? -1 : e.clientY > innerBox.bottom ? 1 : 0; - self.moveTo(self.pos + where * self.screen); - }); - - function onWheel(e) { - var moved = CodeMirror.wheelEventPixels(e)[self.orientation == "horizontal" ? "x" : "y"]; - var oldPos = self.pos; - self.moveTo(self.pos + moved); - if (self.pos != oldPos) CodeMirror.e_preventDefault(e); - } - CodeMirror.on(this.node, "mousewheel", onWheel); - CodeMirror.on(this.node, "DOMMouseScroll", onWheel); - } - - Bar.prototype.moveTo = function(pos, update) { - if (pos < 0) pos = 0; - if (pos > this.total - this.screen) pos = this.total - this.screen; - if (pos == this.pos) return; - this.pos = pos; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - (pos * (this.size / this.total)) + "px"; - if (update !== false) this.scroll(pos, this.orientation); - }; - - var minButtonSize = 10; - - Bar.prototype.update = function(scrollSize, clientSize, barSize) { - this.screen = clientSize; - this.total = scrollSize; - this.size = barSize; - - var buttonSize = this.screen * (this.size / this.total); - if (buttonSize < minButtonSize) { - this.size -= minButtonSize - buttonSize; - buttonSize = minButtonSize; - } - this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = - buttonSize + "px"; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - this.pos * (this.size / this.total) + "px"; - }; - - function SimpleScrollbars(cls, place, scroll) { - this.addClass = cls; - this.horiz = new Bar(cls, "horizontal", scroll); - place(this.horiz.node); - this.vert = new Bar(cls, "vertical", scroll); - place(this.vert.node); - this.width = null; - } - - SimpleScrollbars.prototype.update = function(measure) { - if (this.width == null) { - var style = window.getComputedStyle ? window.getComputedStyle(this.horiz.node) : this.horiz.node.currentStyle; - if (style) this.width = parseInt(style.height); - } - var width = this.width || 0; - - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - this.vert.node.style.display = needsV ? "block" : "none"; - this.horiz.node.style.display = needsH ? "block" : "none"; - - if (needsV) { - this.vert.update(measure.scrollHeight, measure.clientHeight, - measure.viewHeight - (needsH ? width : 0)); - this.vert.node.style.display = "block"; - this.vert.node.style.bottom = needsH ? width + "px" : "0"; - } - if (needsH) { - this.horiz.update(measure.scrollWidth, measure.clientWidth, - measure.viewWidth - (needsV ? width : 0) - measure.barLeft); - this.horiz.node.style.right = needsV ? width + "px" : "0"; - this.horiz.node.style.left = measure.barLeft + "px"; - } - - return {right: needsV ? width : 0, bottom: needsH ? width : 0}; - }; - - SimpleScrollbars.prototype.setScrollTop = function(pos) { - this.vert.moveTo(pos, false); - }; - - SimpleScrollbars.prototype.setScrollLeft = function(pos) { - this.horiz.moveTo(pos, false); - }; - - SimpleScrollbars.prototype.clear = function() { - var parent = this.horiz.node.parentNode; - parent.removeChild(this.horiz.node); - parent.removeChild(this.vert.node); - }; - - CodeMirror.scrollbarModel.simple = function(place, scroll) { - return new SimpleScrollbars("CodeMirror-simplescroll", place, scroll); - }; - CodeMirror.scrollbarModel.overlay = function(place, scroll) { - return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll); - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/match-highlighter.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/match-highlighter.js deleted file mode 100644 index e9a2272..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/match-highlighter.js +++ /dev/null @@ -1,128 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Highlighting text that matches the selection -// -// Defines an option highlightSelectionMatches, which, when enabled, -// will style strings that match the selection throughout the -// document. -// -// The option can be set to true to simply enable it, or to a -// {minChars, style, wordsOnly, showToken, delay} object to explicitly -// configure it. minChars is the minimum amount of characters that should be -// selected for the behavior to occur, and style is the token style to -// apply to the matches. This will be prefixed by "cm-" to create an -// actual CSS class name. If wordsOnly is enabled, the matches will be -// highlighted only if the selected text is a word. showToken, when enabled, -// will cause the current token to be highlighted when nothing is selected. -// delay is used to specify how much time to wait, in milliseconds, before -// highlighting the matches. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var DEFAULT_MIN_CHARS = 2; - var DEFAULT_TOKEN_STYLE = "matchhighlight"; - var DEFAULT_DELAY = 100; - var DEFAULT_WORDS_ONLY = false; - - function State(options) { - if (typeof options == "object") { - this.minChars = options.minChars; - this.style = options.style; - this.showToken = options.showToken; - this.delay = options.delay; - this.wordsOnly = options.wordsOnly; - } - if (this.style == null) this.style = DEFAULT_TOKEN_STYLE; - if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS; - if (this.delay == null) this.delay = DEFAULT_DELAY; - if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY; - this.overlay = this.timeout = null; - } - - CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - var over = cm.state.matchHighlighter.overlay; - if (over) cm.removeOverlay(over); - clearTimeout(cm.state.matchHighlighter.timeout); - cm.state.matchHighlighter = null; - cm.off("cursorActivity", cursorActivity); - } - if (val) { - cm.state.matchHighlighter = new State(val); - highlightMatches(cm); - cm.on("cursorActivity", cursorActivity); - } - }); - - function cursorActivity(cm) { - var state = cm.state.matchHighlighter; - clearTimeout(state.timeout); - state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay); - } - - function highlightMatches(cm) { - cm.operation(function() { - var state = cm.state.matchHighlighter; - if (state.overlay) { - cm.removeOverlay(state.overlay); - state.overlay = null; - } - if (!cm.somethingSelected() && state.showToken) { - var re = state.showToken === true ? /[\w$]/ : state.showToken; - var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start; - while (start && re.test(line.charAt(start - 1))) --start; - while (end < line.length && re.test(line.charAt(end))) ++end; - if (start < end) - cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style)); - return; - } - var from = cm.getCursor("from"), to = cm.getCursor("to"); - if (from.line != to.line) return; - if (state.wordsOnly && !isWord(cm, from, to)) return; - var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, ""); - if (selection.length >= state.minChars) - cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style)); - }); - } - - function isWord(cm, from, to) { - var str = cm.getRange(from, to); - if (str.match(/^\w+$/) !== null) { - if (from.ch > 0) { - var pos = {line: from.line, ch: from.ch - 1}; - var chr = cm.getRange(pos, from); - if (chr.match(/\W/) === null) return false; - } - if (to.ch < cm.getLine(from.line).length) { - var pos = {line: to.line, ch: to.ch + 1}; - var chr = cm.getRange(to, pos); - if (chr.match(/\W/) === null) return false; - } - return true; - } else return false; - } - - function boundariesAround(stream, re) { - return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) && - (stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos))); - } - - function makeOverlay(query, hasBoundary, style) { - return {token: function(stream) { - if (stream.match(query) && - (!hasBoundary || boundariesAround(stream, hasBoundary))) - return style; - stream.next(); - stream.skipTo(query.charAt(0)) || stream.skipToEnd(); - }}; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.css deleted file mode 100644 index 77932cc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.css +++ /dev/null @@ -1,8 +0,0 @@ -.CodeMirror-search-match { - background: gold; - border-top: 1px solid orange; - border-bottom: 1px solid orange; - -moz-box-sizing: border-box; - box-sizing: border-box; - opacity: .5; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.js deleted file mode 100644 index 8d19228..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.js +++ /dev/null @@ -1,97 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./searchcursor"), require("../scroll/annotatescrollbar")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./searchcursor", "../scroll/annotatescrollbar"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, options) { - if (typeof options == "string") options = {className: options}; - if (!options) options = {}; - return new SearchAnnotation(this, query, caseFold, options); - }); - - function SearchAnnotation(cm, query, caseFold, options) { - this.cm = cm; - this.options = options; - var annotateOptions = {listenForChanges: false}; - for (var prop in options) annotateOptions[prop] = options[prop]; - if (!annotateOptions.className) annotateOptions.className = "CodeMirror-search-match"; - this.annotation = cm.annotateScrollbar(annotateOptions); - this.query = query; - this.caseFold = caseFold; - this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1}; - this.matches = []; - this.update = null; - - this.findMatches(); - this.annotation.update(this.matches); - - var self = this; - cm.on("change", this.changeHandler = function(_cm, change) { self.onChange(change); }); - } - - var MAX_MATCHES = 1000; - - SearchAnnotation.prototype.findMatches = function() { - if (!this.gap) return; - for (var i = 0; i < this.matches.length; i++) { - var match = this.matches[i]; - if (match.from.line >= this.gap.to) break; - if (match.to.line >= this.gap.from) this.matches.splice(i--, 1); - } - var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), this.caseFold); - var maxMatches = this.options && this.options.maxMatches || MAX_MATCHES; - while (cursor.findNext()) { - var match = {from: cursor.from(), to: cursor.to()}; - if (match.from.line >= this.gap.to) break; - this.matches.splice(i++, 0, match); - if (this.matches.length > maxMatches) break; - } - this.gap = null; - }; - - function offsetLine(line, changeStart, sizeChange) { - if (line <= changeStart) return line; - return Math.max(changeStart, line + sizeChange); - } - - SearchAnnotation.prototype.onChange = function(change) { - var startLine = change.from.line; - var endLine = CodeMirror.changeEnd(change).line; - var sizeChange = endLine - change.to.line; - if (this.gap) { - this.gap.from = Math.min(offsetLine(this.gap.from, startLine, sizeChange), change.from.line); - this.gap.to = Math.max(offsetLine(this.gap.to, startLine, sizeChange), change.from.line); - } else { - this.gap = {from: change.from.line, to: endLine + 1}; - } - - if (sizeChange) for (var i = 0; i < this.matches.length; i++) { - var match = this.matches[i]; - var newFrom = offsetLine(match.from.line, startLine, sizeChange); - if (newFrom != match.from.line) match.from = CodeMirror.Pos(newFrom, match.from.ch); - var newTo = offsetLine(match.to.line, startLine, sizeChange); - if (newTo != match.to.line) match.to = CodeMirror.Pos(newTo, match.to.ch); - } - clearTimeout(this.update); - var self = this; - this.update = setTimeout(function() { self.updateAfterChange(); }, 250); - }; - - SearchAnnotation.prototype.updateAfterChange = function() { - this.findMatches(); - this.annotation.update(this.matches); - }; - - SearchAnnotation.prototype.clear = function() { - this.cm.off("change", this.changeHandler); - this.annotation.clear(); - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/search.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/search.js deleted file mode 100644 index ed3c477..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/search.js +++ /dev/null @@ -1,202 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Define search commands. Depends on dialog.js or another -// implementation of the openDialog method. - -// Replace works a little oddly -- it will do the replace on the next -// Ctrl-G (or whatever is bound to findNext) press. You prevent a -// replace by making sure the match is no longer selected when hitting -// Ctrl-G. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function searchOverlay(query, caseInsensitive) { - if (typeof query == "string") - query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g"); - else if (!query.global) - query = new RegExp(query.source, query.ignoreCase ? "gi" : "g"); - - return {token: function(stream) { - query.lastIndex = stream.pos; - var match = query.exec(stream.string); - if (match && match.index == stream.pos) { - stream.pos += match[0].length; - return "searching"; - } else if (match) { - stream.pos = match.index; - } else { - stream.skipToEnd(); - } - }}; - } - - function SearchState() { - this.posFrom = this.posTo = this.lastQuery = this.query = null; - this.overlay = null; - } - - function getSearchState(cm) { - return cm.state.search || (cm.state.search = new SearchState()); - } - - function queryCaseInsensitive(query) { - return typeof query == "string" && query == query.toLowerCase(); - } - - function getSearchCursor(cm, query, pos) { - // Heuristic: if the query string is all lowercase, do a case insensitive search. - return cm.getSearchCursor(query, pos, queryCaseInsensitive(query)); - } - - function persistentDialog(cm, text, deflt, f) { - cm.openDialog(text, f, { - value: deflt, - selectValueOnOpen: true, - closeOnEnter: false, - onClose: function() { clearSearch(cm); } - }); - } - - function dialog(cm, text, shortText, deflt, f) { - if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true}); - else f(prompt(shortText, deflt)); - } - - function confirmDialog(cm, text, shortText, fs) { - if (cm.openConfirm) cm.openConfirm(text, fs); - else if (confirm(shortText)) fs[0](); - } - - function parseQuery(query) { - var isRE = query.match(/^\/(.*)\/([a-z]*)$/); - if (isRE) { - try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); } - catch(e) {} // Not a regular expression after all, do a string search - } - if (typeof query == "string" ? query == "" : query.test("")) - query = /x^/; - return query; - } - - var queryDialog = - 'Search: (Use /re/ syntax for regexp search)'; - - function startSearch(cm, state, query) { - state.queryText = query; - state.query = parseQuery(query); - cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query)); - state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query)); - cm.addOverlay(state.overlay); - if (cm.showMatchesOnScrollbar) { - if (state.annotate) { state.annotate.clear(); state.annotate = null; } - state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query)); - } - } - - function doSearch(cm, rev, persistent) { - var state = getSearchState(cm); - if (state.query) return findNext(cm, rev); - var q = cm.getSelection() || state.lastQuery; - if (persistent && cm.openDialog) { - persistentDialog(cm, queryDialog, q, function(query, event) { - CodeMirror.e_stop(event); - if (!query) return; - if (query != state.queryText) startSearch(cm, state, query); - findNext(cm, event.shiftKey); - }); - } else { - dialog(cm, queryDialog, "Search for:", q, function(query) { - if (query && !state.query) cm.operation(function() { - startSearch(cm, state, query); - state.posFrom = state.posTo = cm.getCursor(); - findNext(cm, rev); - }); - }); - } - } - - function findNext(cm, rev) {cm.operation(function() { - var state = getSearchState(cm); - var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo); - if (!cursor.find(rev)) { - cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0)); - if (!cursor.find(rev)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20); - state.posFrom = cursor.from(); state.posTo = cursor.to(); - });} - - function clearSearch(cm) {cm.operation(function() { - var state = getSearchState(cm); - state.lastQuery = state.query; - if (!state.query) return; - state.query = state.queryText = null; - cm.removeOverlay(state.overlay); - if (state.annotate) { state.annotate.clear(); state.annotate = null; } - });} - - var replaceQueryDialog = - 'Replace: (Use /re/ syntax for regexp search)'; - var replacementQueryDialog = 'With: '; - var doReplaceConfirm = "Replace? "; - - function replace(cm, all) { - if (cm.getOption("readOnly")) return; - var query = cm.getSelection() || getSearchState(cm).lastQuery; - dialog(cm, replaceQueryDialog, "Replace:", query, function(query) { - if (!query) return; - query = parseQuery(query); - dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) { - if (all) { - cm.operation(function() { - for (var cursor = getSearchCursor(cm, query); cursor.findNext();) { - if (typeof query != "string") { - var match = cm.getRange(cursor.from(), cursor.to()).match(query); - cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];})); - } else cursor.replace(text); - } - }); - } else { - clearSearch(cm); - var cursor = getSearchCursor(cm, query, cm.getCursor()); - var advance = function() { - var start = cursor.from(), match; - if (!(match = cursor.findNext())) { - cursor = getSearchCursor(cm, query); - if (!(match = cursor.findNext()) || - (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return; - } - cm.setSelection(cursor.from(), cursor.to()); - cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); - confirmDialog(cm, doReplaceConfirm, "Replace?", - [function() {doReplace(match);}, advance]); - }; - var doReplace = function(match) { - cursor.replace(typeof query == "string" ? text : - text.replace(/\$(\d)/g, function(_, i) {return match[i];})); - advance(); - }; - advance(); - } - }); - }); - } - - CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; - CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);}; - CodeMirror.commands.findNext = doSearch; - CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; - CodeMirror.commands.clearSearch = clearSearch; - CodeMirror.commands.replace = replace; - CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);}; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/searchcursor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/searchcursor.js deleted file mode 100644 index b70242e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/searchcursor.js +++ /dev/null @@ -1,189 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var Pos = CodeMirror.Pos; - - function SearchCursor(doc, query, pos, caseFold) { - this.atOccurrence = false; this.doc = doc; - if (caseFold == null && typeof query == "string") caseFold = false; - - pos = pos ? doc.clipPos(pos) : Pos(0, 0); - this.pos = {from: pos, to: pos}; - - // The matches method is filled in based on the type of query. - // It takes a position and a direction, and returns an object - // describing the next occurrence of the query, or null if no - // more matches were found. - if (typeof query != "string") { // Regexp match - if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g"); - this.matches = function(reverse, pos) { - if (reverse) { - query.lastIndex = 0; - var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start; - for (;;) { - query.lastIndex = cutOff; - var newMatch = query.exec(line); - if (!newMatch) break; - match = newMatch; - start = match.index; - cutOff = match.index + (match[0].length || 1); - if (cutOff == line.length) break; - } - var matchLen = (match && match[0].length) || 0; - if (!matchLen) { - if (start == 0 && line.length == 0) {match = undefined;} - else if (start != doc.getLine(pos.line).length) { - matchLen++; - } - } - } else { - query.lastIndex = pos.ch; - var line = doc.getLine(pos.line), match = query.exec(line); - var matchLen = (match && match[0].length) || 0; - var start = match && match.index; - if (start + matchLen != line.length && !matchLen) matchLen = 1; - } - if (match && matchLen) - return {from: Pos(pos.line, start), - to: Pos(pos.line, start + matchLen), - match: match}; - }; - } else { // String query - var origQuery = query; - if (caseFold) query = query.toLowerCase(); - var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; - var target = query.split("\n"); - // Different methods for single-line and multi-line queries - if (target.length == 1) { - if (!query.length) { - // Empty string would match anything and never progress, so - // we define it to match nothing instead. - this.matches = function() {}; - } else { - this.matches = function(reverse, pos) { - if (reverse) { - var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig); - var match = line.lastIndexOf(query); - if (match > -1) { - match = adjustPos(orig, line, match); - return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)}; - } - } else { - var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig); - var match = line.indexOf(query); - if (match > -1) { - match = adjustPos(orig, line, match) + pos.ch; - return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)}; - } - } - }; - } - } else { - var origTarget = origQuery.split("\n"); - this.matches = function(reverse, pos) { - var last = target.length - 1; - if (reverse) { - if (pos.line - (target.length - 1) < doc.firstLine()) return; - if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return; - var to = Pos(pos.line, origTarget[last].length); - for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln) - if (target[i] != fold(doc.getLine(ln))) return; - var line = doc.getLine(ln), cut = line.length - origTarget[0].length; - if (fold(line.slice(cut)) != target[0]) return; - return {from: Pos(ln, cut), to: to}; - } else { - if (pos.line + (target.length - 1) > doc.lastLine()) return; - var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length; - if (fold(line.slice(cut)) != target[0]) return; - var from = Pos(pos.line, cut); - for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln) - if (target[i] != fold(doc.getLine(ln))) return; - if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return; - return {from: from, to: Pos(ln, origTarget[last].length)}; - } - }; - } - } - } - - SearchCursor.prototype = { - findNext: function() {return this.find(false);}, - findPrevious: function() {return this.find(true);}, - - find: function(reverse) { - var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to); - function savePosAndFail(line) { - var pos = Pos(line, 0); - self.pos = {from: pos, to: pos}; - self.atOccurrence = false; - return false; - } - - for (;;) { - if (this.pos = this.matches(reverse, pos)) { - this.atOccurrence = true; - return this.pos.match || true; - } - if (reverse) { - if (!pos.line) return savePosAndFail(0); - pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length); - } - else { - var maxLine = this.doc.lineCount(); - if (pos.line == maxLine - 1) return savePosAndFail(maxLine); - pos = Pos(pos.line + 1, 0); - } - } - }, - - from: function() {if (this.atOccurrence) return this.pos.from;}, - to: function() {if (this.atOccurrence) return this.pos.to;}, - - replace: function(newText, origin) { - if (!this.atOccurrence) return; - var lines = CodeMirror.splitLines(newText); - this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin); - this.pos.to = Pos(this.pos.from.line + lines.length - 1, - lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0)); - } - }; - - // Maps a position in a case-folded line back to a position in the original line - // (compensating for codepoints increasing in number during folding) - function adjustPos(orig, folded, pos) { - if (orig.length == folded.length) return pos; - for (var pos1 = Math.min(pos, orig.length);;) { - var len1 = orig.slice(0, pos1).toLowerCase().length; - if (len1 < pos) ++pos1; - else if (len1 > pos) --pos1; - else return pos1; - } - } - - CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { - return new SearchCursor(this.doc, query, pos, caseFold); - }); - CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) { - return new SearchCursor(this, query, pos, caseFold); - }); - - CodeMirror.defineExtension("selectMatches", function(query, caseFold) { - var ranges = []; - var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold); - while (cur.findNext()) { - if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break; - ranges.push({anchor: cur.from(), head: cur.to()}); - } - if (ranges.length) - this.setSelections(ranges, 0); - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/active-line.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/active-line.js deleted file mode 100644 index 22da2e0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/active-line.js +++ /dev/null @@ -1,71 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Because sometimes you need to style the cursor's line. -// -// Adds an option 'styleActiveLine' which, when enabled, gives the -// active line's wrapping
                the CSS class "CodeMirror-activeline", -// and gives its background
                the class "CodeMirror-activeline-background". - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var WRAP_CLASS = "CodeMirror-activeline"; - var BACK_CLASS = "CodeMirror-activeline-background"; - - CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { - var prev = old && old != CodeMirror.Init; - if (val && !prev) { - cm.state.activeLines = []; - updateActiveLines(cm, cm.listSelections()); - cm.on("beforeSelectionChange", selectionChange); - } else if (!val && prev) { - cm.off("beforeSelectionChange", selectionChange); - clearActiveLines(cm); - delete cm.state.activeLines; - } - }); - - function clearActiveLines(cm) { - for (var i = 0; i < cm.state.activeLines.length; i++) { - cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); - cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); - } - } - - function sameArray(a, b) { - if (a.length != b.length) return false; - for (var i = 0; i < a.length; i++) - if (a[i] != b[i]) return false; - return true; - } - - function updateActiveLines(cm, ranges) { - var active = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) continue; - var line = cm.getLineHandleVisualStart(range.head.line); - if (active[active.length - 1] != line) active.push(line); - } - if (sameArray(cm.state.activeLines, active)) return; - cm.operation(function() { - clearActiveLines(cm); - for (var i = 0; i < active.length; i++) { - cm.addLineClass(active[i], "wrap", WRAP_CLASS); - cm.addLineClass(active[i], "background", BACK_CLASS); - } - cm.state.activeLines = active; - }); - } - - function selectionChange(cm, sel) { - updateActiveLines(cm, sel.ranges); - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/mark-selection.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/mark-selection.js deleted file mode 100644 index 5c42d21..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/mark-selection.js +++ /dev/null @@ -1,118 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Because sometimes you need to mark the selected *text*. -// -// Adds an option 'styleSelectedText' which, when enabled, gives -// selected text the CSS class given as option value, or -// "CodeMirror-selectedtext" when the value is not a string. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) { - var prev = old && old != CodeMirror.Init; - if (val && !prev) { - cm.state.markedSelection = []; - cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext"; - reset(cm); - cm.on("cursorActivity", onCursorActivity); - cm.on("change", onChange); - } else if (!val && prev) { - cm.off("cursorActivity", onCursorActivity); - cm.off("change", onChange); - clear(cm); - cm.state.markedSelection = cm.state.markedSelectionStyle = null; - } - }); - - function onCursorActivity(cm) { - cm.operation(function() { update(cm); }); - } - - function onChange(cm) { - if (cm.state.markedSelection.length) - cm.operation(function() { clear(cm); }); - } - - var CHUNK_SIZE = 8; - var Pos = CodeMirror.Pos; - var cmp = CodeMirror.cmpPos; - - function coverRange(cm, from, to, addAt) { - if (cmp(from, to) == 0) return; - var array = cm.state.markedSelection; - var cls = cm.state.markedSelectionStyle; - for (var line = from.line;;) { - var start = line == from.line ? from : Pos(line, 0); - var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line; - var end = atEnd ? to : Pos(endLine, 0); - var mark = cm.markText(start, end, {className: cls}); - if (addAt == null) array.push(mark); - else array.splice(addAt++, 0, mark); - if (atEnd) break; - line = endLine; - } - } - - function clear(cm) { - var array = cm.state.markedSelection; - for (var i = 0; i < array.length; ++i) array[i].clear(); - array.length = 0; - } - - function reset(cm) { - clear(cm); - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) - coverRange(cm, ranges[i].from(), ranges[i].to()); - } - - function update(cm) { - if (!cm.somethingSelected()) return clear(cm); - if (cm.listSelections().length > 1) return reset(cm); - - var from = cm.getCursor("start"), to = cm.getCursor("end"); - - var array = cm.state.markedSelection; - if (!array.length) return coverRange(cm, from, to); - - var coverStart = array[0].find(), coverEnd = array[array.length - 1].find(); - if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE || - cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0) - return reset(cm); - - while (cmp(from, coverStart.from) > 0) { - array.shift().clear(); - coverStart = array[0].find(); - } - if (cmp(from, coverStart.from) < 0) { - if (coverStart.to.line - from.line < CHUNK_SIZE) { - array.shift().clear(); - coverRange(cm, from, coverStart.to, 0); - } else { - coverRange(cm, from, coverStart.from, 0); - } - } - - while (cmp(to, coverEnd.to) < 0) { - array.pop().clear(); - coverEnd = array[array.length - 1].find(); - } - if (cmp(to, coverEnd.to) > 0) { - if (to.line - coverEnd.from.line < CHUNK_SIZE) { - array.pop().clear(); - coverRange(cm, coverEnd.from, to); - } else { - coverRange(cm, coverEnd.to, to); - } - } - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/selection-pointer.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/selection-pointer.js deleted file mode 100644 index ef5e404..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/selection-pointer.js +++ /dev/null @@ -1,98 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("selectionPointer", false, function(cm, val) { - var data = cm.state.selectionPointer; - if (data) { - CodeMirror.off(cm.getWrapperElement(), "mousemove", data.mousemove); - CodeMirror.off(cm.getWrapperElement(), "mouseout", data.mouseout); - CodeMirror.off(window, "scroll", data.windowScroll); - cm.off("cursorActivity", reset); - cm.off("scroll", reset); - cm.state.selectionPointer = null; - cm.display.lineDiv.style.cursor = ""; - } - if (val) { - data = cm.state.selectionPointer = { - value: typeof val == "string" ? val : "default", - mousemove: function(event) { mousemove(cm, event); }, - mouseout: function(event) { mouseout(cm, event); }, - windowScroll: function() { reset(cm); }, - rects: null, - mouseX: null, mouseY: null, - willUpdate: false - }; - CodeMirror.on(cm.getWrapperElement(), "mousemove", data.mousemove); - CodeMirror.on(cm.getWrapperElement(), "mouseout", data.mouseout); - CodeMirror.on(window, "scroll", data.windowScroll); - cm.on("cursorActivity", reset); - cm.on("scroll", reset); - } - }); - - function mousemove(cm, event) { - var data = cm.state.selectionPointer; - if (event.buttons == null ? event.which : event.buttons) { - data.mouseX = data.mouseY = null; - } else { - data.mouseX = event.clientX; - data.mouseY = event.clientY; - } - scheduleUpdate(cm); - } - - function mouseout(cm, event) { - if (!cm.getWrapperElement().contains(event.relatedTarget)) { - var data = cm.state.selectionPointer; - data.mouseX = data.mouseY = null; - scheduleUpdate(cm); - } - } - - function reset(cm) { - cm.state.selectionPointer.rects = null; - scheduleUpdate(cm); - } - - function scheduleUpdate(cm) { - if (!cm.state.selectionPointer.willUpdate) { - cm.state.selectionPointer.willUpdate = true; - setTimeout(function() { - update(cm); - cm.state.selectionPointer.willUpdate = false; - }, 50); - } - } - - function update(cm) { - var data = cm.state.selectionPointer; - if (!data) return; - if (data.rects == null && data.mouseX != null) { - data.rects = []; - if (cm.somethingSelected()) { - for (var sel = cm.display.selectionDiv.firstChild; sel; sel = sel.nextSibling) - data.rects.push(sel.getBoundingClientRect()); - } - } - var inside = false; - if (data.mouseX != null) for (var i = 0; i < data.rects.length; i++) { - var rect = data.rects[i]; - if (rect.left <= data.mouseX && rect.right >= data.mouseX && - rect.top <= data.mouseY && rect.bottom >= data.mouseY) - inside = true; - } - var cursor = inside ? data.value : ""; - if (cm.display.lineDiv.style.cursor != cursor) - cm.display.lineDiv.style.cursor = cursor; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.css deleted file mode 100644 index c4b8a2f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.css +++ /dev/null @@ -1,87 +0,0 @@ -.CodeMirror-Tern-completion { - padding-left: 22px; - position: relative; - line-height: 1.5; -} -.CodeMirror-Tern-completion:before { - position: absolute; - left: 2px; - bottom: 2px; - border-radius: 50%; - font-size: 12px; - font-weight: bold; - height: 15px; - width: 15px; - line-height: 16px; - text-align: center; - color: white; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.CodeMirror-Tern-completion-unknown:before { - content: "?"; - background: #4bb; -} -.CodeMirror-Tern-completion-object:before { - content: "O"; - background: #77c; -} -.CodeMirror-Tern-completion-fn:before { - content: "F"; - background: #7c7; -} -.CodeMirror-Tern-completion-array:before { - content: "A"; - background: #c66; -} -.CodeMirror-Tern-completion-number:before { - content: "1"; - background: #999; -} -.CodeMirror-Tern-completion-string:before { - content: "S"; - background: #999; -} -.CodeMirror-Tern-completion-bool:before { - content: "B"; - background: #999; -} - -.CodeMirror-Tern-completion-guess { - color: #999; -} - -.CodeMirror-Tern-tooltip { - border: 1px solid silver; - border-radius: 3px; - color: #444; - padding: 2px 5px; - font-size: 90%; - font-family: monospace; - background-color: white; - white-space: pre-wrap; - - max-width: 40em; - position: absolute; - z-index: 10; - -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); - box-shadow: 2px 3px 5px rgba(0,0,0,.2); - - transition: opacity 1s; - -moz-transition: opacity 1s; - -webkit-transition: opacity 1s; - -o-transition: opacity 1s; - -ms-transition: opacity 1s; -} - -.CodeMirror-Tern-hint-doc { - max-width: 25em; - margin-top: -3px; -} - -.CodeMirror-Tern-fname { color: black; } -.CodeMirror-Tern-farg { color: #70a; } -.CodeMirror-Tern-farg-current { text-decoration: underline; } -.CodeMirror-Tern-type { color: #07c; } -.CodeMirror-Tern-fhint-guess { opacity: .7; } diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.js deleted file mode 100644 index 42c3cde..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.js +++ /dev/null @@ -1,699 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Glue code between CodeMirror and Tern. -// -// Create a CodeMirror.TernServer to wrap an actual Tern server, -// register open documents (CodeMirror.Doc instances) with it, and -// call its methods to activate the assisting functions that Tern -// provides. -// -// Options supported (all optional): -// * defs: An array of JSON definition data structures. -// * plugins: An object mapping plugin names to configuration -// options. -// * getFile: A function(name, c) that can be used to access files in -// the project that haven't been loaded yet. Simply do c(null) to -// indicate that a file is not available. -// * fileFilter: A function(value, docName, doc) that will be applied -// to documents before passing them on to Tern. -// * switchToDoc: A function(name, doc) that should, when providing a -// multi-file view, switch the view or focus to the named file. -// * showError: A function(editor, message) that can be used to -// override the way errors are displayed. -// * completionTip: Customize the content in tooltips for completions. -// Is passed a single argument—the completion's data as returned by -// Tern—and may return a string, DOM node, or null to indicate that -// no tip should be shown. By default the docstring is shown. -// * typeTip: Like completionTip, but for the tooltips shown for type -// queries. -// * responseFilter: A function(doc, query, request, error, data) that -// will be applied to the Tern responses before treating them -// -// -// It is possible to run the Tern server in a web worker by specifying -// these additional options: -// * useWorker: Set to true to enable web worker mode. You'll probably -// want to feature detect the actual value you use here, for example -// !!window.Worker. -// * workerScript: The main script of the worker. Point this to -// wherever you are hosting worker.js from this directory. -// * workerDeps: An array of paths pointing (relative to workerScript) -// to the Acorn and Tern libraries and any Tern plugins you want to -// load. Or, if you minified those into a single script and included -// them in the workerScript, simply leave this undefined. - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - // declare global: tern - - CodeMirror.TernServer = function(options) { - var self = this; - this.options = options || {}; - var plugins = this.options.plugins || (this.options.plugins = {}); - if (!plugins.doc_comment) plugins.doc_comment = true; - this.docs = Object.create(null); - if (this.options.useWorker) { - this.server = new WorkerServer(this); - } else { - this.server = new tern.Server({ - getFile: function(name, c) { return getFile(self, name, c); }, - async: true, - defs: this.options.defs || [], - plugins: plugins - }); - } - this.trackChange = function(doc, change) { trackChange(self, doc, change); }; - - this.cachedArgHints = null; - this.activeArgHints = null; - this.jumpStack = []; - - this.getHint = function(cm, c) { return hint(self, cm, c); }; - this.getHint.async = true; - }; - - CodeMirror.TernServer.prototype = { - addDoc: function(name, doc) { - var data = {doc: doc, name: name, changed: null}; - this.server.addFile(name, docValue(this, data)); - CodeMirror.on(doc, "change", this.trackChange); - return this.docs[name] = data; - }, - - delDoc: function(id) { - var found = resolveDoc(this, id); - if (!found) return; - CodeMirror.off(found.doc, "change", this.trackChange); - delete this.docs[found.name]; - this.server.delFile(found.name); - }, - - hideDoc: function(id) { - closeArgHints(this); - var found = resolveDoc(this, id); - if (found && found.changed) sendDoc(this, found); - }, - - complete: function(cm) { - cm.showHint({hint: this.getHint}); - }, - - showType: function(cm, pos, c) { showContextInfo(this, cm, pos, "type", c); }, - - showDocs: function(cm, pos, c) { showContextInfo(this, cm, pos, "documentation", c); }, - - updateArgHints: function(cm) { updateArgHints(this, cm); }, - - jumpToDef: function(cm) { jumpToDef(this, cm); }, - - jumpBack: function(cm) { jumpBack(this, cm); }, - - rename: function(cm) { rename(this, cm); }, - - selectName: function(cm) { selectName(this, cm); }, - - request: function (cm, query, c, pos) { - var self = this; - var doc = findDoc(this, cm.getDoc()); - var request = buildRequest(this, doc, query, pos); - var extraOptions = request.query && this.options.queryOptions && this.options.queryOptions[request.query.type] - if (extraOptions) for (var prop in extraOptions) request.query[prop] = extraOptions[prop]; - - this.server.request(request, function (error, data) { - if (!error && self.options.responseFilter) - data = self.options.responseFilter(doc, query, request, error, data); - c(error, data); - }); - }, - - destroy: function () { - if (this.worker) { - this.worker.terminate(); - this.worker = null; - } - } - }; - - var Pos = CodeMirror.Pos; - var cls = "CodeMirror-Tern-"; - var bigDoc = 250; - - function getFile(ts, name, c) { - var buf = ts.docs[name]; - if (buf) - c(docValue(ts, buf)); - else if (ts.options.getFile) - ts.options.getFile(name, c); - else - c(null); - } - - function findDoc(ts, doc, name) { - for (var n in ts.docs) { - var cur = ts.docs[n]; - if (cur.doc == doc) return cur; - } - if (!name) for (var i = 0;; ++i) { - n = "[doc" + (i || "") + "]"; - if (!ts.docs[n]) { name = n; break; } - } - return ts.addDoc(name, doc); - } - - function resolveDoc(ts, id) { - if (typeof id == "string") return ts.docs[id]; - if (id instanceof CodeMirror) id = id.getDoc(); - if (id instanceof CodeMirror.Doc) return findDoc(ts, id); - } - - function trackChange(ts, doc, change) { - var data = findDoc(ts, doc); - - var argHints = ts.cachedArgHints; - if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) <= 0) - ts.cachedArgHints = null; - - var changed = data.changed; - if (changed == null) - data.changed = changed = {from: change.from.line, to: change.from.line}; - var end = change.from.line + (change.text.length - 1); - if (change.from.line < changed.to) changed.to = changed.to - (change.to.line - end); - if (end >= changed.to) changed.to = end + 1; - if (changed.from > change.from.line) changed.from = change.from.line; - - if (doc.lineCount() > bigDoc && change.to - changed.from > 100) setTimeout(function() { - if (data.changed && data.changed.to - data.changed.from > 100) sendDoc(ts, data); - }, 200); - } - - function sendDoc(ts, doc) { - ts.server.request({files: [{type: "full", name: doc.name, text: docValue(ts, doc)}]}, function(error) { - if (error) window.console.error(error); - else doc.changed = null; - }); - } - - // Completion - - function hint(ts, cm, c) { - ts.request(cm, {type: "completions", types: true, docs: true, urls: true}, function(error, data) { - if (error) return showError(ts, cm, error); - var completions = [], after = ""; - var from = data.start, to = data.end; - if (cm.getRange(Pos(from.line, from.ch - 2), from) == "[\"" && - cm.getRange(to, Pos(to.line, to.ch + 2)) != "\"]") - after = "\"]"; - - for (var i = 0; i < data.completions.length; ++i) { - var completion = data.completions[i], className = typeToIcon(completion.type); - if (data.guess) className += " " + cls + "guess"; - completions.push({text: completion.name + after, - displayText: completion.displayName || completion.name, - className: className, - data: completion}); - } - - var obj = {from: from, to: to, list: completions}; - var tooltip = null; - CodeMirror.on(obj, "close", function() { remove(tooltip); }); - CodeMirror.on(obj, "update", function() { remove(tooltip); }); - CodeMirror.on(obj, "select", function(cur, node) { - remove(tooltip); - var content = ts.options.completionTip ? ts.options.completionTip(cur.data) : cur.data.doc; - if (content) { - tooltip = makeTooltip(node.parentNode.getBoundingClientRect().right + window.pageXOffset, - node.getBoundingClientRect().top + window.pageYOffset, content); - tooltip.className += " " + cls + "hint-doc"; - } - }); - c(obj); - }); - } - - function typeToIcon(type) { - var suffix; - if (type == "?") suffix = "unknown"; - else if (type == "number" || type == "string" || type == "bool") suffix = type; - else if (/^fn\(/.test(type)) suffix = "fn"; - else if (/^\[/.test(type)) suffix = "array"; - else suffix = "object"; - return cls + "completion " + cls + "completion-" + suffix; - } - - // Type queries - - function showContextInfo(ts, cm, pos, queryName, c) { - ts.request(cm, queryName, function(error, data) { - if (error) return showError(ts, cm, error); - if (ts.options.typeTip) { - var tip = ts.options.typeTip(data); - } else { - var tip = elt("span", null, elt("strong", null, data.type || "not found")); - if (data.doc) - tip.appendChild(document.createTextNode(" — " + data.doc)); - if (data.url) { - tip.appendChild(document.createTextNode(" ")); - var child = tip.appendChild(elt("a", null, "[docs]")); - child.href = data.url; - child.target = "_blank"; - } - } - tempTooltip(cm, tip); - if (c) c(); - }, pos); - } - - // Maintaining argument hints - - function updateArgHints(ts, cm) { - closeArgHints(ts); - - if (cm.somethingSelected()) return; - var state = cm.getTokenAt(cm.getCursor()).state; - var inner = CodeMirror.innerMode(cm.getMode(), state); - if (inner.mode.name != "javascript") return; - var lex = inner.state.lexical; - if (lex.info != "call") return; - - var ch, argPos = lex.pos || 0, tabSize = cm.getOption("tabSize"); - for (var line = cm.getCursor().line, e = Math.max(0, line - 9), found = false; line >= e; --line) { - var str = cm.getLine(line), extra = 0; - for (var pos = 0;;) { - var tab = str.indexOf("\t", pos); - if (tab == -1) break; - extra += tabSize - (tab + extra) % tabSize - 1; - pos = tab + 1; - } - ch = lex.column - extra; - if (str.charAt(ch) == "(") {found = true; break;} - } - if (!found) return; - - var start = Pos(line, ch); - var cache = ts.cachedArgHints; - if (cache && cache.doc == cm.getDoc() && cmpPos(start, cache.start) == 0) - return showArgHints(ts, cm, argPos); - - ts.request(cm, {type: "type", preferFunction: true, end: start}, function(error, data) { - if (error || !data.type || !(/^fn\(/).test(data.type)) return; - ts.cachedArgHints = { - start: pos, - type: parseFnType(data.type), - name: data.exprName || data.name || "fn", - guess: data.guess, - doc: cm.getDoc() - }; - showArgHints(ts, cm, argPos); - }); - } - - function showArgHints(ts, cm, pos) { - closeArgHints(ts); - - var cache = ts.cachedArgHints, tp = cache.type; - var tip = elt("span", cache.guess ? cls + "fhint-guess" : null, - elt("span", cls + "fname", cache.name), "("); - for (var i = 0; i < tp.args.length; ++i) { - if (i) tip.appendChild(document.createTextNode(", ")); - var arg = tp.args[i]; - tip.appendChild(elt("span", cls + "farg" + (i == pos ? " " + cls + "farg-current" : ""), arg.name || "?")); - if (arg.type != "?") { - tip.appendChild(document.createTextNode(":\u00a0")); - tip.appendChild(elt("span", cls + "type", arg.type)); - } - } - tip.appendChild(document.createTextNode(tp.rettype ? ") ->\u00a0" : ")")); - if (tp.rettype) tip.appendChild(elt("span", cls + "type", tp.rettype)); - var place = cm.cursorCoords(null, "page"); - ts.activeArgHints = makeTooltip(place.right + 1, place.bottom, tip); - } - - function parseFnType(text) { - var args = [], pos = 3; - - function skipMatching(upto) { - var depth = 0, start = pos; - for (;;) { - var next = text.charAt(pos); - if (upto.test(next) && !depth) return text.slice(start, pos); - if (/[{\[\(]/.test(next)) ++depth; - else if (/[}\]\)]/.test(next)) --depth; - ++pos; - } - } - - // Parse arguments - if (text.charAt(pos) != ")") for (;;) { - var name = text.slice(pos).match(/^([^, \(\[\{]+): /); - if (name) { - pos += name[0].length; - name = name[1]; - } - args.push({name: name, type: skipMatching(/[\),]/)}); - if (text.charAt(pos) == ")") break; - pos += 2; - } - - var rettype = text.slice(pos).match(/^\) -> (.*)$/); - - return {args: args, rettype: rettype && rettype[1]}; - } - - // Moving to the definition of something - - function jumpToDef(ts, cm) { - function inner(varName) { - var req = {type: "definition", variable: varName || null}; - var doc = findDoc(ts, cm.getDoc()); - ts.server.request(buildRequest(ts, doc, req), function(error, data) { - if (error) return showError(ts, cm, error); - if (!data.file && data.url) { window.open(data.url); return; } - - if (data.file) { - var localDoc = ts.docs[data.file], found; - if (localDoc && (found = findContext(localDoc.doc, data))) { - ts.jumpStack.push({file: doc.name, - start: cm.getCursor("from"), - end: cm.getCursor("to")}); - moveTo(ts, doc, localDoc, found.start, found.end); - return; - } - } - showError(ts, cm, "Could not find a definition."); - }); - } - - if (!atInterestingExpression(cm)) - dialog(cm, "Jump to variable", function(name) { if (name) inner(name); }); - else - inner(); - } - - function jumpBack(ts, cm) { - var pos = ts.jumpStack.pop(), doc = pos && ts.docs[pos.file]; - if (!doc) return; - moveTo(ts, findDoc(ts, cm.getDoc()), doc, pos.start, pos.end); - } - - function moveTo(ts, curDoc, doc, start, end) { - doc.doc.setSelection(start, end); - if (curDoc != doc && ts.options.switchToDoc) { - closeArgHints(ts); - ts.options.switchToDoc(doc.name, doc.doc); - } - } - - // The {line,ch} representation of positions makes this rather awkward. - function findContext(doc, data) { - var before = data.context.slice(0, data.contextOffset).split("\n"); - var startLine = data.start.line - (before.length - 1); - var start = Pos(startLine, (before.length == 1 ? data.start.ch : doc.getLine(startLine).length) - before[0].length); - - var text = doc.getLine(startLine).slice(start.ch); - for (var cur = startLine + 1; cur < doc.lineCount() && text.length < data.context.length; ++cur) - text += "\n" + doc.getLine(cur); - if (text.slice(0, data.context.length) == data.context) return data; - - var cursor = doc.getSearchCursor(data.context, 0, false); - var nearest, nearestDist = Infinity; - while (cursor.findNext()) { - var from = cursor.from(), dist = Math.abs(from.line - start.line) * 10000; - if (!dist) dist = Math.abs(from.ch - start.ch); - if (dist < nearestDist) { nearest = from; nearestDist = dist; } - } - if (!nearest) return null; - - if (before.length == 1) - nearest.ch += before[0].length; - else - nearest = Pos(nearest.line + (before.length - 1), before[before.length - 1].length); - if (data.start.line == data.end.line) - var end = Pos(nearest.line, nearest.ch + (data.end.ch - data.start.ch)); - else - var end = Pos(nearest.line + (data.end.line - data.start.line), data.end.ch); - return {start: nearest, end: end}; - } - - function atInterestingExpression(cm) { - var pos = cm.getCursor("end"), tok = cm.getTokenAt(pos); - if (tok.start < pos.ch && tok.type == "comment") return false; - return /[\w)\]]/.test(cm.getLine(pos.line).slice(Math.max(pos.ch - 1, 0), pos.ch + 1)); - } - - // Variable renaming - - function rename(ts, cm) { - var token = cm.getTokenAt(cm.getCursor()); - if (!/\w/.test(token.string)) return showError(ts, cm, "Not at a variable"); - dialog(cm, "New name for " + token.string, function(newName) { - ts.request(cm, {type: "rename", newName: newName, fullDocs: true}, function(error, data) { - if (error) return showError(ts, cm, error); - applyChanges(ts, data.changes); - }); - }); - } - - function selectName(ts, cm) { - var name = findDoc(ts, cm.doc).name; - ts.request(cm, {type: "refs"}, function(error, data) { - if (error) return showError(ts, cm, error); - var ranges = [], cur = 0; - for (var i = 0; i < data.refs.length; i++) { - var ref = data.refs[i]; - if (ref.file == name) { - ranges.push({anchor: ref.start, head: ref.end}); - if (cmpPos(cur, ref.start) >= 0 && cmpPos(cur, ref.end) <= 0) - cur = ranges.length - 1; - } - } - cm.setSelections(ranges, cur); - }); - } - - var nextChangeOrig = 0; - function applyChanges(ts, changes) { - var perFile = Object.create(null); - for (var i = 0; i < changes.length; ++i) { - var ch = changes[i]; - (perFile[ch.file] || (perFile[ch.file] = [])).push(ch); - } - for (var file in perFile) { - var known = ts.docs[file], chs = perFile[file];; - if (!known) continue; - chs.sort(function(a, b) { return cmpPos(b.start, a.start); }); - var origin = "*rename" + (++nextChangeOrig); - for (var i = 0; i < chs.length; ++i) { - var ch = chs[i]; - known.doc.replaceRange(ch.text, ch.start, ch.end, origin); - } - } - } - - // Generic request-building helper - - function buildRequest(ts, doc, query, pos) { - var files = [], offsetLines = 0, allowFragments = !query.fullDocs; - if (!allowFragments) delete query.fullDocs; - if (typeof query == "string") query = {type: query}; - query.lineCharPositions = true; - if (query.end == null) { - query.end = pos || doc.doc.getCursor("end"); - if (doc.doc.somethingSelected()) - query.start = doc.doc.getCursor("start"); - } - var startPos = query.start || query.end; - - if (doc.changed) { - if (doc.doc.lineCount() > bigDoc && allowFragments !== false && - doc.changed.to - doc.changed.from < 100 && - doc.changed.from <= startPos.line && doc.changed.to > query.end.line) { - files.push(getFragmentAround(doc, startPos, query.end)); - query.file = "#0"; - var offsetLines = files[0].offsetLines; - if (query.start != null) query.start = Pos(query.start.line - -offsetLines, query.start.ch); - query.end = Pos(query.end.line - offsetLines, query.end.ch); - } else { - files.push({type: "full", - name: doc.name, - text: docValue(ts, doc)}); - query.file = doc.name; - doc.changed = null; - } - } else { - query.file = doc.name; - } - for (var name in ts.docs) { - var cur = ts.docs[name]; - if (cur.changed && cur != doc) { - files.push({type: "full", name: cur.name, text: docValue(ts, cur)}); - cur.changed = null; - } - } - - return {query: query, files: files}; - } - - function getFragmentAround(data, start, end) { - var doc = data.doc; - var minIndent = null, minLine = null, endLine, tabSize = 4; - for (var p = start.line - 1, min = Math.max(0, p - 50); p >= min; --p) { - var line = doc.getLine(p), fn = line.search(/\bfunction\b/); - if (fn < 0) continue; - var indent = CodeMirror.countColumn(line, null, tabSize); - if (minIndent != null && minIndent <= indent) continue; - minIndent = indent; - minLine = p; - } - if (minLine == null) minLine = min; - var max = Math.min(doc.lastLine(), end.line + 20); - if (minIndent == null || minIndent == CodeMirror.countColumn(doc.getLine(start.line), null, tabSize)) - endLine = max; - else for (endLine = end.line + 1; endLine < max; ++endLine) { - var indent = CodeMirror.countColumn(doc.getLine(endLine), null, tabSize); - if (indent <= minIndent) break; - } - var from = Pos(minLine, 0); - - return {type: "part", - name: data.name, - offsetLines: from.line, - text: doc.getRange(from, Pos(endLine, 0))}; - } - - // Generic utilities - - var cmpPos = CodeMirror.cmpPos; - - function elt(tagname, cls /*, ... elts*/) { - var e = document.createElement(tagname); - if (cls) e.className = cls; - for (var i = 2; i < arguments.length; ++i) { - var elt = arguments[i]; - if (typeof elt == "string") elt = document.createTextNode(elt); - e.appendChild(elt); - } - return e; - } - - function dialog(cm, text, f) { - if (cm.openDialog) - cm.openDialog(text + ": ", f); - else - f(prompt(text, "")); - } - - // Tooltips - - function tempTooltip(cm, content) { - if (cm.state.ternTooltip) remove(cm.state.ternTooltip); - var where = cm.cursorCoords(); - var tip = cm.state.ternTooltip = makeTooltip(where.right + 1, where.bottom, content); - function maybeClear() { - old = true; - if (!mouseOnTip) clear(); - } - function clear() { - cm.state.ternTooltip = null; - if (!tip.parentNode) return; - cm.off("cursorActivity", clear); - cm.off('blur', clear); - cm.off('scroll', clear); - fadeOut(tip); - } - var mouseOnTip = false, old = false; - CodeMirror.on(tip, "mousemove", function() { mouseOnTip = true; }); - CodeMirror.on(tip, "mouseout", function(e) { - if (!CodeMirror.contains(tip, e.relatedTarget || e.toElement)) { - if (old) clear(); - else mouseOnTip = false; - } - }); - setTimeout(maybeClear, 1700); - cm.on("cursorActivity", clear); - cm.on('blur', clear); - cm.on('scroll', clear); - } - - function makeTooltip(x, y, content) { - var node = elt("div", cls + "tooltip", content); - node.style.left = x + "px"; - node.style.top = y + "px"; - document.body.appendChild(node); - return node; - } - - function remove(node) { - var p = node && node.parentNode; - if (p) p.removeChild(node); - } - - function fadeOut(tooltip) { - tooltip.style.opacity = "0"; - setTimeout(function() { remove(tooltip); }, 1100); - } - - function showError(ts, cm, msg) { - if (ts.options.showError) - ts.options.showError(cm, msg); - else - tempTooltip(cm, String(msg)); - } - - function closeArgHints(ts) { - if (ts.activeArgHints) { remove(ts.activeArgHints); ts.activeArgHints = null; } - } - - function docValue(ts, doc) { - var val = doc.doc.getValue(); - if (ts.options.fileFilter) val = ts.options.fileFilter(val, doc.name, doc.doc); - return val; - } - - // Worker wrapper - - function WorkerServer(ts) { - var worker = ts.worker = new Worker(ts.options.workerScript); - worker.postMessage({type: "init", - defs: ts.options.defs, - plugins: ts.options.plugins, - scripts: ts.options.workerDeps}); - var msgId = 0, pending = {}; - - function send(data, c) { - if (c) { - data.id = ++msgId; - pending[msgId] = c; - } - worker.postMessage(data); - } - worker.onmessage = function(e) { - var data = e.data; - if (data.type == "getFile") { - getFile(ts, data.name, function(err, text) { - send({type: "getFile", err: String(err), text: text, id: data.id}); - }); - } else if (data.type == "debug") { - window.console.log(data.message); - } else if (data.id && pending[data.id]) { - pending[data.id](data.err, data.body); - delete pending[data.id]; - } - }; - worker.onerror = function(e) { - for (var id in pending) pending[id](e); - pending = {}; - }; - - this.addFile = function(name, text) { send({type: "add", name: name, text: text}); }; - this.delFile = function(name) { send({type: "del", name: name}); }; - this.request = function(body, c) { send({type: "req", body: body}, c); }; - } -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/worker.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/worker.js deleted file mode 100644 index 887f906..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/worker.js +++ /dev/null @@ -1,44 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// declare global: tern, server - -var server; - -this.onmessage = function(e) { - var data = e.data; - switch (data.type) { - case "init": return startServer(data.defs, data.plugins, data.scripts); - case "add": return server.addFile(data.name, data.text); - case "del": return server.delFile(data.name); - case "req": return server.request(data.body, function(err, reqData) { - postMessage({id: data.id, body: reqData, err: err && String(err)}); - }); - case "getFile": - var c = pending[data.id]; - delete pending[data.id]; - return c(data.err, data.text); - default: throw new Error("Unknown message type: " + data.type); - } -}; - -var nextId = 0, pending = {}; -function getFile(file, c) { - postMessage({type: "getFile", name: file, id: ++nextId}); - pending[nextId] = c; -} - -function startServer(defs, plugins, scripts) { - if (scripts) importScripts.apply(null, scripts); - - server = new tern.Server({ - getFile: getFile, - async: true, - defs: defs, - plugins: plugins - }); -} - -this.console = { - log: function(v) { postMessage({type: "debug", message: v}); } -}; diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/wrap/hardwrap.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/wrap/hardwrap.js deleted file mode 100644 index fe9b4dd..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/wrap/hardwrap.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - - function findParagraph(cm, pos, options) { - var startRE = options.paragraphStart || cm.getHelper(pos, "paragraphStart"); - for (var start = pos.line, first = cm.firstLine(); start > first; --start) { - var line = cm.getLine(start); - if (startRE && startRE.test(line)) break; - if (!/\S/.test(line)) { ++start; break; } - } - var endRE = options.paragraphEnd || cm.getHelper(pos, "paragraphEnd"); - for (var end = pos.line + 1, last = cm.lastLine(); end <= last; ++end) { - var line = cm.getLine(end); - if (endRE && endRE.test(line)) { ++end; break; } - if (!/\S/.test(line)) break; - } - return {from: start, to: end}; - } - - function findBreakPoint(text, column, wrapOn, killTrailingSpace) { - for (var at = column; at > 0; --at) - if (wrapOn.test(text.slice(at - 1, at + 1))) break; - if (at == 0) at = column; - var endOfText = at; - if (killTrailingSpace) - while (text.charAt(endOfText - 1) == " ") --endOfText; - return {from: endOfText, to: at}; - } - - function wrapRange(cm, from, to, options) { - from = cm.clipPos(from); to = cm.clipPos(to); - var column = options.column || 80; - var wrapOn = options.wrapOn || /\s\S|-[^\.\d]/; - var killTrailing = options.killTrailingSpace !== false; - var changes = [], curLine = "", curNo = from.line; - var lines = cm.getRange(from, to, false); - if (!lines.length) return null; - var leadingSpace = lines[0].match(/^[ \t]*/)[0]; - - for (var i = 0; i < lines.length; ++i) { - var text = lines[i], oldLen = curLine.length, spaceInserted = 0; - if (curLine && text && !wrapOn.test(curLine.charAt(curLine.length - 1) + text.charAt(0))) { - curLine += " "; - spaceInserted = 1; - } - var spaceTrimmed = ""; - if (i) { - spaceTrimmed = text.match(/^\s*/)[0]; - text = text.slice(spaceTrimmed.length); - } - curLine += text; - if (i) { - var firstBreak = curLine.length > column && leadingSpace == spaceTrimmed && - findBreakPoint(curLine, column, wrapOn, killTrailing); - // If this isn't broken, or is broken at a different point, remove old break - if (!firstBreak || firstBreak.from != oldLen || firstBreak.to != oldLen + spaceInserted) { - changes.push({text: [spaceInserted ? " " : ""], - from: Pos(curNo, oldLen), - to: Pos(curNo + 1, spaceTrimmed.length)}); - } else { - curLine = leadingSpace + text; - ++curNo; - } - } - while (curLine.length > column) { - var bp = findBreakPoint(curLine, column, wrapOn, killTrailing); - changes.push({text: ["", leadingSpace], - from: Pos(curNo, bp.from), - to: Pos(curNo, bp.to)}); - curLine = leadingSpace + curLine.slice(bp.to); - ++curNo; - } - } - if (changes.length) cm.operation(function() { - for (var i = 0; i < changes.length; ++i) { - var change = changes[i]; - cm.replaceRange(change.text, change.from, change.to); - } - }); - return changes.length ? {from: changes[0].from, to: CodeMirror.changeEnd(changes[changes.length - 1])} : null; - } - - CodeMirror.defineExtension("wrapParagraph", function(pos, options) { - options = options || {}; - if (!pos) pos = this.getCursor(); - var para = findParagraph(this, pos, options); - return wrapRange(this, Pos(para.from, 0), Pos(para.to - 1), options); - }); - - CodeMirror.commands.wrapLines = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(), at = cm.lastLine() + 1; - for (var i = ranges.length - 1; i >= 0; i--) { - var range = ranges[i], span; - if (range.empty()) { - var para = findParagraph(cm, range.head, {}); - span = {from: Pos(para.from, 0), to: Pos(para.to - 1)}; - } else { - span = {from: range.from(), to: range.to()}; - } - if (span.to.line >= at) continue; - at = span.from.line; - wrapRange(cm, span.from, span.to, {}); - } - }); - }; - - CodeMirror.defineExtension("wrapRange", function(from, to, options) { - return wrapRange(this, from, to, options || {}); - }); - - CodeMirror.defineExtension("wrapParagraphsInRange", function(from, to, options) { - options = options || {}; - var cm = this, paras = []; - for (var line = from.line; line <= to.line;) { - var para = findParagraph(cm, Pos(line, 0), options); - paras.push(para); - line = para.to; - } - var madeChange = false; - if (paras.length) cm.operation(function() { - for (var i = paras.length - 1; i >= 0; --i) - madeChange = madeChange || wrapRange(cm, Pos(paras[i].from, 0), Pos(paras[i].to - 1), options); - }); - return madeChange; - }); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/authors.sh b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/authors.sh deleted file mode 100644 index b3ee99c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/authors.sh +++ /dev/null @@ -1,6 +0,0 @@ -# Combine existing list of authors with everyone known in git, sort, add header. -tail --lines=+3 AUTHORS > AUTHORS.tmp -git log --format='%aN' >> AUTHORS.tmp -echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS -sort -u AUTHORS.tmp >> AUTHORS -rm -f AUTHORS.tmp diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/compress b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/compress deleted file mode 100644 index 809fbe8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/compress +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env node - -// Compression helper for CodeMirror -// -// Example: -// -// bin/compress codemirror runmode javascript xml -// -// Will take lib/codemirror.js, addon/runmode/runmode.js, -// mode/javascript/javascript.js, and mode/xml/xml.js, run them though -// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit -// out the result. -// -// bin/compress codemirror --local /path/to/bin/UglifyJS -// -// Will use a local minifier instead of the online default one. -// -// Script files are specified without .js ending. Prefixing them with -// their full (local) path is optional. So you may say lib/codemirror -// or mode/xml/xml to be more precise. In fact, even the .js suffix -// may be speficied, if wanted. - -"use strict"; - -var fs = require("fs"); - -function help(ok) { - console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files..."); - process.exit(ok ? 0 : 1); -} - -var local = null, args = [], extraArgs = null, files = [], blob = ""; - -for (var i = 2; i < process.argv.length; ++i) { - var arg = process.argv[i]; - if (arg == "--local" && i + 1 < process.argv.length) { - var parts = process.argv[++i].split(/\s+/); - local = parts[0]; - extraArgs = parts.slice(1); - if (!extraArgs.length) extraArgs = ["-c", "-m"]; - } else if (arg == "--help") { - help(true); - } else if (arg[0] != "-") { - files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))}); - } else help(false); -} - -function walk(dir) { - fs.readdirSync(dir).forEach(function(fname) { - if (/^[_\.]/.test(fname)) return; - var file = dir + fname; - if (fs.statSync(file).isDirectory()) return walk(file + "/"); - if (files.some(function(spec, i) { - var match = spec.re.test(file); - if (match) files.splice(i, 1); - return match; - })) { - if (local) args.push(file); - else blob += fs.readFileSync(file, "utf8"); - } - }); -} - -walk("lib/"); -walk("addon/"); -walk("mode/"); - -if (!local && !blob) help(false); - -if (files.length) { - console.log("Some speficied files were not found: " + - files.map(function(a){return a.name;}).join(", ")); - process.exit(1); -} - -if (local) { - require("child_process").spawn(local, args.concat(extraArgs), {stdio: ["ignore", process.stdout, process.stderr]}); -} else { - var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8"); - var req = require("http").request({ - host: "marijnhaverbeke.nl", - port: 80, - method: "POST", - path: "/uglifyjs", - headers: {"content-type": "application/x-www-form-urlencoded", - "content-length": data.length} - }); - req.on("response", function(resp) { - resp.on("data", function (chunk) { process.stdout.write(chunk); }); - }); - req.end(data); -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/lint b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/lint deleted file mode 100644 index 47f45f3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/lint +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -process.exit(require("../test/lint").ok ? 0 : 1); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/release b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/release deleted file mode 100644 index b782739..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/release +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env node - -var fs = require("fs"), child = require("child_process"); - -var number, bumpOnly; - -for (var i = 2; i < process.argv.length; i++) { - if (process.argv[i] == "-bump") bumpOnly = true; - else if (/^\d+\.\d+\.\d+$/.test(process.argv[i])) number = process.argv[i]; - else { console.log("Bogus command line arg: " + process.argv[i]); process.exit(1); } -} - -if (!number) { console.log("Must give a version"); process.exit(1); } - -function rewrite(file, f) { - fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8"); -} - -rewrite("lib/codemirror.js", function(lib) { - return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/, - "CodeMirror.version = \"" + number + "\""); -}); -function rewriteJSON(pack) { - return pack.replace(/"version":"\d+\.\d+\.\d+"/, "\"version\":\"" + number + "\""); -} -rewrite("package.json", rewriteJSON); -rewrite("doc/manual.html", function(manual) { - return manual.replace(/>version \d+\.\d+\.\d+<\/span>/, ">version " + number + ""); -}); - -if (bumpOnly) process.exit(0); - -child.exec("bash bin/authors.sh", function(){}); - -var simple = number.slice(0, number.lastIndexOf(".")); - -rewrite("doc/compress.html", function(cmp) { - return cmp.replace(/\n "); -}); - -rewrite("index.html", function(index) { - return index.replace(/\.zip">\d+\.\d+<\/a>/, - ".zip\">" + simple + ""); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/source-highlight b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/source-highlight deleted file mode 100644 index 6d15f1a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/source-highlight +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node - -// Simple command-line code highlighting tool. Reads code from stdin, -// spits html to stdout. For example: -// -// echo 'function foo(a) { return a; }' | bin/source-highlight -s javascript -// bin/source-highlight -s - -var fs = require("fs"); - -var CodeMirror = require("../addon/runmode/runmode.node.js"); -require("../mode/meta.js"); - -var sPos = process.argv.indexOf("-s"); -if (sPos == -1 || sPos == process.argv.length - 1) { - console.error("Usage: source-highlight -s language"); - process.exit(1); -} -var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang; -CodeMirror.modeInfo.forEach(function(info) { - if (info.mime == lang) { - modeName = info.mode; - } else if (info.name.toLowerCase() == lang) { - modeName = info.mode; - lang = info.mime; - } -}); - -if (!CodeMirror.modes[modeName]) - require("../mode/" + modeName + "/" + modeName + ".js"); - -function esc(str) { - return str.replace(/[<&]/g, function(ch) { return ch == "&" ? "&" : "<"; }); -} - -var code = fs.readFileSync("/dev/stdin", "utf8"); -var curStyle = null, accum = ""; -function flush() { - if (curStyle) process.stdout.write("" + esc(accum) + ""); - else process.stdout.write(esc(accum)); -} - -CodeMirror.runMode(code, lang, function(text, style) { - if (style != curStyle) { - flush(); - curStyle = style; accum = text; - } else { - accum += text; - } -}); -flush(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bower.json b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bower.json deleted file mode 100644 index 903d9f5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "codemirror", - "main": ["lib/codemirror.js", "lib/codemirror.css"], - "ignore": [ - "**/.*", - "node_modules", - "components", - "bin", - "demo", - "doc", - "test", - "index.html", - "package.json", - "mode/*/*test.js", - "mode/*/*.html" - ] -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/activeline.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/activeline.html deleted file mode 100644 index 741f6c4..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/activeline.html +++ /dev/null @@ -1,78 +0,0 @@ - - -CodeMirror: Active Line Demo - - - - - - - - - - -
                -

                Active Line Demo

                - - - - -

                Styling the current cursor line.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/anywordhint.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/anywordhint.html deleted file mode 100644 index 0a7caec..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/anywordhint.html +++ /dev/null @@ -1,79 +0,0 @@ - - -CodeMirror: Any Word Completion Demo - - - - - - - - - - - -
                -

                Any Word Completion Demo

                -
                - -

                Press ctrl-space to activate autocompletion. The -completion uses -the anyword-hint.js -module, which simply looks at nearby words in the buffer and completes -to those.

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/bidi.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/bidi.html deleted file mode 100644 index 6dd73be..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/bidi.html +++ /dev/null @@ -1,74 +0,0 @@ - - -CodeMirror: Bi-directional Text Demo - - - - - - - - - -
                -

                Bi-directional Text Demo

                -
                - - - -

                Demonstration of bi-directional text support. See - the related - blog post for more background.

                - -

                Note: There is - a known - bug with cursor motion and mouse clicks in bi-directional lines - that are line wrapped.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/btree.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/btree.html deleted file mode 100644 index fc4997f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/btree.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: B-Tree visualization - - - - - - - - -
                -

                B-Tree visualization

                -
                -
                -
                -
                - - - -

                - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/buffers.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/buffers.html deleted file mode 100644 index 16ffc7d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/buffers.html +++ /dev/null @@ -1,109 +0,0 @@ - - -CodeMirror: Multiple Buffer & Split View Demo - - - - - - - - - - -
                -

                Multiple Buffer & Split View Demo

                - - -
                -
                - Select buffer: -     -
                -
                -
                - Select buffer: -     -
                - - - -

                Demonstration of - using linked documents - to provide a split view on a document, and - using swapDoc - to use a single editor to display multiple documents.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/changemode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/changemode.html deleted file mode 100644 index 9405932..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/changemode.html +++ /dev/null @@ -1,58 +0,0 @@ - - -CodeMirror: Mode-Changing Demo - - - - - - - - - - -
                -

                Mode-Changing Demo

                -
                - -

                On changes to the content of the above editor, a (crude) script -tries to auto-detect the language used, and switches the editor to -either JavaScript or Scheme mode based on that.

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closebrackets.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closebrackets.html deleted file mode 100644 index d702f52..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closebrackets.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: Closebrackets Demo - - - - - - - - - - -
                -

                Closebrackets Demo

                -
                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closetag.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closetag.html deleted file mode 100644 index 79959d2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closetag.html +++ /dev/null @@ -1,41 +0,0 @@ - - -CodeMirror: Close-Tag Demo - - - - - - - - - - - - - - -
                -

                Close-Tag Demo

                -
                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/complete.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/complete.html deleted file mode 100644 index cdf49db..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/complete.html +++ /dev/null @@ -1,79 +0,0 @@ - - -CodeMirror: Autocomplete Demo - - - - - - - - - - - - -
                -

                Autocomplete Demo

                -
                - -

                Press ctrl-space to activate autocompletion. Built -on top of the show-hint -and javascript-hint -addons.

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/emacs.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/emacs.html deleted file mode 100644 index c626b8d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/emacs.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Emacs bindings demo - - - - - - - - - - - - - - - - -
                -

                Emacs bindings demo

                -
                - -

                The emacs keybindings are enabled by -including keymap/emacs.js and setting -the keyMap option to "emacs". Because -CodeMirror's internal API is quite different from Emacs, they are only -a loose approximation of actual emacs bindings, though.

                - -

                Also note that a lot of browsers disallow certain keys from being -captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the -result that idiomatic use of Emacs keys will constantly close your tab -or open a new window.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/folding.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/folding.html deleted file mode 100644 index 81cbf98..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/folding.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - CodeMirror: Code Folding Demo - - - - - - - - - - - - - - - - - - - - - -
                -

                Code Folding Demo

                -
                -
                JavaScript:
                -
                -
                HTML:
                -
                -
                Markdown:
                -
                -
                - -
                - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/fullscreen.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/fullscreen.html deleted file mode 100644 index 1fbdc48..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/fullscreen.html +++ /dev/null @@ -1,83 +0,0 @@ - - -CodeMirror: Full Screen Editing - - - - - - - - - - - - -
                -

                Full Screen Editing

                -
                - - -

                Demonstration of - the fullscreen - addon. Press F11 when cursor is in the editor to - toggle full screen editing. Esc can also be used - to exit full screen editing.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/hardwrap.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/hardwrap.html deleted file mode 100644 index f1a870b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/hardwrap.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: Hard-wrapping Demo - - - - - - - - - - -
                -

                Hard-wrapping Demo

                -
                - -

                Demonstration of -the hardwrap addon. -The above editor has its change event hooked up to -the wrapParagraphsInRange method, so that the paragraphs -are reflown as you are typing.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/html5complete.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/html5complete.html deleted file mode 100644 index 411baae..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/html5complete.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - CodeMirror: HTML completion demo - - - - - - - - - - - - - - - - - - - -
                -

                HTML completion demo

                - -

                Shows the XML completer - parameterized with information about the tags in HTML. - Press ctrl-space to activate completion.

                - -
                - - -
                - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/indentwrap.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/indentwrap.html deleted file mode 100644 index 3d3d0af..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/indentwrap.html +++ /dev/null @@ -1,59 +0,0 @@ - - -CodeMirror: Indented wrapped line demo - - - - - - - - - -
                -

                Indented wrapped line demo

                -
                - -

                This page uses a hack on top of the "renderLine" - event to make wrapped text line up with the base indentation of - the line.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/lint.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/lint.html deleted file mode 100644 index 29936a8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/lint.html +++ /dev/null @@ -1,171 +0,0 @@ - - -CodeMirror: Linter Demo - - - - - - - - - - - - - - - - - - -
                -

                Linter Demo

                - - -

                - -

                - -

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/loadmode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/loadmode.html deleted file mode 100644 index 809cd90..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/loadmode.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: Lazy Mode Loading Demo - - - - - - - - - - -
                -

                Lazy Mode Loading Demo

                -

                Current mode: text/plain

                -
                -

                Filename, mime, or mode name:

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/marker.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/marker.html deleted file mode 100644 index 3a8b850..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/marker.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: Breakpoint Demo - - - - - - - - - -
                -

                Breakpoint Demo

                -
                - -

                Click the line-number gutter to add or remove 'breakpoints'.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/markselection.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/markselection.html deleted file mode 100644 index d4c8a7a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/markselection.html +++ /dev/null @@ -1,52 +0,0 @@ - - -CodeMirror: Selection Marking Demo - - - - - - - - - - -
                -

                Selection Marking Demo

                -
                - - - -

                Simple addon to easily mark (and style) selected text. Docs.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchhighlighter.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchhighlighter.html deleted file mode 100644 index c601090..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchhighlighter.html +++ /dev/null @@ -1,47 +0,0 @@ - - -CodeMirror: Match Highlighter Demo - - - - - - - - - - -
                -

                Match Highlighter Demo

                -
                - - - -

                Search and highlight occurences of the selected text.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchtags.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchtags.html deleted file mode 100644 index 175639a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchtags.html +++ /dev/null @@ -1,48 +0,0 @@ - - -CodeMirror: Tag Matcher Demo - - - - - - - - - - - -
                -

                Tag Matcher Demo

                - - -
                - - - -

                Put the cursor on or inside a pair of tags to highlight them. - Press Ctrl-J to jump to the tag that matches the one under the - cursor.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/merge.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/merge.html deleted file mode 100644 index c60e653..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/merge.html +++ /dev/null @@ -1,122 +0,0 @@ - - -CodeMirror: merge view demo - - - - - - - - - - - - - - - -
                -

                merge view demo

                - - -
                - -

                The merge -addon provides an interface for displaying and merging diffs, -either two-way -or three-way. -The left (or center) pane is editable, and the differences with the -other pane(s) are optionally shown live as you edit -it. In the two-way configuration, there are also options to pad changed -sections to align them, and to collapse unchanged -stretches of text.

                - -

                This addon depends on -the google-diff-match-patch -library to compute the diffs.

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/multiplex.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/multiplex.html deleted file mode 100644 index ca8c80a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/multiplex.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Multiplexing Parser Demo - - - - - - - - - - -
                -

                Multiplexing Parser Demo

                -
                - - - -

                Demonstration of a multiplexing mode, which, at certain - boundary strings, switches to one or more inner modes. The out - (HTML) mode does not get fed the content of the << - >> blocks. See - the manual and - the source for more - information.

                - -

                - Parsing/Highlighting Tests: - normal, - verbose. -

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/mustache.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/mustache.html deleted file mode 100644 index ae4e6a8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/mustache.html +++ /dev/null @@ -1,69 +0,0 @@ - - -CodeMirror: Overlay Parser Demo - - - - - - - - - - -
                -

                Overlay Parser Demo

                -
                - - - -

                Demonstration of a mode that parses HTML, highlighting - the Mustache templating - directives inside of it by using the code - in overlay.js. View - source to see the 15 lines of code needed to accomplish this.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/panel.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/panel.html deleted file mode 100644 index b3b0b7c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/panel.html +++ /dev/null @@ -1,136 +0,0 @@ - - -CodeMirror: Panel Demo - - - - - - - - - - - - - -
                - -

                Panel Demo

                - -
                - -
                - -

                - The panel - addon allows you to display panels above or below an editor. -
                - Click the links below to add panels at the given position: -

                - -
                -

                - top - after-top - before-bottom - bottom -

                -

                - You can also replace an existing panel: -

                -
                - - -
                - - - -
                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/placeholder.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/placeholder.html deleted file mode 100644 index 432331a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/placeholder.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: Placeholder demo - - - - - - - - - -
                -

                Placeholder demo

                -
                - -

                The placeholder - plug-in adds an option placeholder that can be set to - make text appear in the editor when it is empty and not focused. - If the source textarea has a placeholder attribute, - it will automatically be inherited.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/preview.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/preview.html deleted file mode 100644 index 19e1530..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/preview.html +++ /dev/null @@ -1,87 +0,0 @@ - - -CodeMirror: HTML5 preview - - - - - - - - - - - - -
                -

                HTML5 preview

                - - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/requirejs.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/requirejs.html deleted file mode 100644 index 438ef9f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/requirejs.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - CodeMirror: HTML completion demo - - - - - - - - - - - - -
                -

                RequireJS module loading demo

                - -

                This demo does the same thing as - the HTML5 completion demo, but - loads its dependencies - with Require.js, rather than - explicitly. Press ctrl-space to activate - completion.

                - -
                - - - - -
                - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/resize.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/resize.html deleted file mode 100644 index 1c1ef39..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/resize.html +++ /dev/null @@ -1,51 +0,0 @@ - - -CodeMirror: Autoresize Demo - - - - - - - - - -
                -

                Autoresize Demo

                -
                - -

                By setting an editor's height style -to auto and giving -the viewportMargin -a value of Infinity, CodeMirror can be made to -automatically resize to fit its content.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/rulers.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/rulers.html deleted file mode 100644 index 2ac4111..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/rulers.html +++ /dev/null @@ -1,49 +0,0 @@ - - -CodeMirror: Ruler Demo - - - - - - - - - -
                -

                Ruler Demo

                - - - -

                Demonstration of -the rulers addon, which -displays vertical lines at given column offsets.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/runmode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/runmode.html deleted file mode 100644 index 257f03d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/runmode.html +++ /dev/null @@ -1,62 +0,0 @@ - - -CodeMirror: Mode Runner Demo - - - - - - - - - -
                -

                Mode Runner Demo

                - - -
                - -
                
                -
                -    
                -
                -    

                Running a CodeMirror mode outside of the editor. - The CodeMirror.runMode function, defined - in lib/runmode.js takes the following arguments:

                - -
                -
                text (string)
                -
                The document to run through the highlighter.
                -
                mode (mode spec)
                -
                The mode to use (must be loaded as normal).
                -
                output (function or DOM node)
                -
                If this is a function, it will be called for each token with - two arguments, the token's text and the token's style class (may - be null for unstyled tokens). If it is a DOM node, - the tokens will be converted to span elements as in - an editor, and inserted into the node - (through innerHTML).
                -
                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/search.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/search.html deleted file mode 100644 index 21c3425..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/search.html +++ /dev/null @@ -1,95 +0,0 @@ - - -CodeMirror: Search/Replace Demo - - - - - - - - - - - - - - - - -
                -

                Search/Replace Demo

                -
                - - - -

                Demonstration of primitive search/replace functionality. The - keybindings (which can be configured with custom keymaps) are:

                -
                -
                Ctrl-F / Cmd-F
                Start searching
                -
                Ctrl-G / Cmd-G
                Find next
                -
                Shift-Ctrl-G / Shift-Cmd-G
                Find previous
                -
                Shift-Ctrl-F / Cmd-Option-F
                Replace
                -
                Shift-Ctrl-R / Shift-Cmd-Option-F
                Replace all
                -
                Alt-F
                Persistent search (dialog doesn't autoclose, enter to find next, shift-enter to find previous)
                -
                -

                Searching is enabled by - including addon/search/search.js - and addon/search/searchcursor.js. - For good-looking input dialogs, you also want to include - addon/dialog/dialog.js - and addon/dialog/dialog.css.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplemode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplemode.html deleted file mode 100644 index 49778ef..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplemode.html +++ /dev/null @@ -1,186 +0,0 @@ - - -CodeMirror: Simple Mode Demo - - - - - - - - - - - -
                -

                Simple Mode Demo

                - -

                The mode/simple -addon allows CodeMirror modes to be specified using a relatively simple -declarative format. This format is not as powerful as writing code -directly against the mode -interface, but is a lot easier to get started with, and -sufficiently expressive for many simple language modes.

                - -

                This interface is still in flux. It is unlikely to be scrapped or -overhauled completely, so do start writing code against it, but -details might change as it stabilizes, and you might have to tweak -your code when upgrading.

                - -

                Simple modes (loosely based on -the Common -JavaScript Syntax Highlighting Specification, which never took -off), are state machines, where each state has a number of rules that -match tokens. A rule describes a type of token that may occur in the -current state, and possibly a transition to another state caused by -that token.

                - -

                The CodeMirror.defineSimpleMode(name, states) method -takes a mode name and an object that describes the mode's states. The -editor below shows an example of such a mode (and is itself -highlighted by the mode shown in it).

                - -
                - -

                Each state is an array of rules. A rule may have the following properties:

                - -
                -
                regex: string | RegExp
                -
                The regular expression that matches the token. May be a string - or a regex object. When a regex, the ignoreCase flag - will be taken into account when matching the token. This regex - should only capture groups when the token property is - an array.
                -
                token: string | null
                -
                An optional token style. Multiple styles can be specified by - separating them with dots or spaces. When the regex for - this rule captures groups, it must capture all of the - string (since JS provides no way to find out where a group matched), - and this property must hold an array of token styles that has one - style for each matched group.
                -
                sol: boolean
                -
                When true, this token will only match at the start of the line. - (The ^ regexp marker doesn't work as you'd expect in - this context because of limitations in JavaScript's RegExp - API.)
                -
                next: string
                -
                When a next property is present, the mode will - transfer to the state named by the property when the token is - encountered.
                -
                push: string
                -
                Like next, but instead replacing the current state - by the new state, the current state is kept on a stack, and can be - returned to with the pop directive.
                -
                pop: bool
                -
                When true, and there is another state on the state stack, will - cause the mode to pop that state off the stack and transition to - it.
                -
                mode: {spec, end, persistent}
                -
                Can be used to embed another mode inside a mode. When present, - must hold an object with a spec property that describes - the embedded mode, and an optional end end property - that specifies the regexp that will end the extent of the mode. When - a persistent property is set (and true), the nested - mode's state will be preserved between occurrences of the mode.
                -
                indent: bool
                -
                When true, this token changes the indentation to be one unit - more than the current line's indentation.
                -
                dedent: bool
                -
                When true, this token will pop one scope off the indentation - stack.
                -
                dedentIfLineStart: bool
                -
                If a token has its dedent property set, it will, by - default, cause lines where it appears at the start to be dedented. - Set this property to false to prevent that behavior.
                -
                - -

                The meta property of the states object is special, and -will not be interpreted as a state. Instead, properties set on it will -be set on the mode, which is useful for properties -like lineComment, -which sets the comment style for a mode. The simple mode addon also -recognizes a few such properties:

                - -
                -
                dontIndentStates: array<string>
                -
                An array of states in which the mode's auto-indentation should - not take effect. Usually used for multi-line comment and string - states.
                -
                - - - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplescrollbars.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplescrollbars.html deleted file mode 100644 index 9d40932..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplescrollbars.html +++ /dev/null @@ -1,82 +0,0 @@ - - -CodeMirror: Simple Scrollbar Demo - - - - - - - - - - - - -
                -

                Simple Scrollbar Demo

                -
                - -

                The simplescrollbars addon defines two -styles of non-native scrollbars: "simple" and "overlay" (click to try), which can be passed to -the scrollbarStyle option. These implement -the scrollbar using DOM elements, allowing more control over -its appearance.

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/spanaffectswrapping_shim.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/spanaffectswrapping_shim.html deleted file mode 100644 index 879d99b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/spanaffectswrapping_shim.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Automatically derive odd wrapping behavior for your browser - - - - - -
                -

                Automatically derive odd wrapping behavior for your browser

                - - -

                This is a hack to automatically derive - a spanAffectsWrapping regexp for a browser. See the - comments above that variable - in lib/codemirror.js - for some more details.

                - -
                -
                
                -
                -    
                -  
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/sublime.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/sublime.html deleted file mode 100644 index b3b5342..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/sublime.html +++ /dev/null @@ -1,76 +0,0 @@ - - -CodeMirror: Sublime Text bindings demo - - - - - - - - - - - - - - - - - - - - - - -
                -

                Sublime Text bindings demo

                - -

                The sublime keymap defines many Sublime Text-specific -bindings for CodeMirror. See the code below for an overview.

                - -

                Enable the keymap by -loading keymap/sublime.js -and setting -the keyMap -option to "sublime".

                - -

                (A lot of the search functionality is still missing.) - - - -

                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/tern.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/tern.html deleted file mode 100644 index d5badfe..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/tern.html +++ /dev/null @@ -1,133 +0,0 @@ - - -CodeMirror: Tern Demo - - - - - - - - - - - - - - - - - - - - - - - - - -
                -

                Tern Demo

                -

                - -

                Demonstrates integration of Tern -and CodeMirror. The following keys are bound:

                - -
                -
                Ctrl-Space
                Autocomplete
                -
                Ctrl-O
                Find docs for the expression at the cursor
                -
                Ctrl-I
                Find type at cursor
                -
                Alt-.
                Jump to definition (Alt-, to jump back)
                -
                Ctrl-Q
                Rename variable
                -
                Ctrl-.
                Select all occurrences of a variable
                -
                - -

                Documentation is sparse for now. See the top of -the script for a rough API -overview.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/theme.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/theme.html deleted file mode 100644 index 93d5251..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/theme.html +++ /dev/null @@ -1,152 +0,0 @@ - - -CodeMirror: Theme Demo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                -

                Theme Demo

                - - -

                Select a theme: -

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/trailingspace.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/trailingspace.html deleted file mode 100644 index 1992ba3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/trailingspace.html +++ /dev/null @@ -1,48 +0,0 @@ - - -CodeMirror: Trailing Whitespace Demo - - - - - - - - - -
                -

                Trailing Whitespace Demo

                -
                - - - -

                Uses -the trailingspace -addon to highlight trailing whitespace.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/variableheight.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/variableheight.html deleted file mode 100644 index d499428..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/variableheight.html +++ /dev/null @@ -1,67 +0,0 @@ - - -CodeMirror: Variable Height Demo - - - - - - - - - - -
                -

                Variable Height Demo

                -
                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/vim.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/vim.html deleted file mode 100644 index be4b857..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/vim.html +++ /dev/null @@ -1,104 +0,0 @@ - - -CodeMirror: Vim bindings demo - - - - - - - - - - - - - - - - -
                -

                Vim bindings demo

                -
                -
                Key buffer:
                - -

                The vim keybindings are enabled by including keymap/vim.js and setting the -keyMap option to vim.

                - -

                Features

                - -
                  -
                • All common motions and operators, including text objects
                • -
                • Operator motion orthogonality
                • -
                • Visual mode - characterwise, linewise, blockwise
                • -
                • Full macro support (q, @)
                • -
                • Incremental highlighted search (/, ?, #, *, g#, g*)
                • -
                • Search/replace with confirm (:substitute, :%s)
                • -
                • Search history
                • -
                • Jump lists (Ctrl-o, Ctrl-i)
                • -
                • Key/command mapping with API (:map, :nmap, :vmap)
                • -
                • Sort (:sort)
                • -
                • Marks (`, ')
                • -
                • :global
                • -
                • Insert mode behaves identical to base CodeMirror
                • -
                • Cross-buffer yank/paste
                • -
                - -

                For the full list of key mappings and Ex commands, refer to the -defaultKeymap and defaultExCommandMap at the -top of keymap/vim.js. - -

                Note that while the vim mode tries to emulate the most useful -features of vim as faithfully as possible, it does not strive to -become a complete vim implementation

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/visibletabs.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/visibletabs.html deleted file mode 100644 index 2eec337..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/visibletabs.html +++ /dev/null @@ -1,62 +0,0 @@ - - -CodeMirror: Visible tabs demo - - - - - - - - - -
                -

                Visible tabs demo

                -
                - -

                Tabs inside the editor are spans with the -class cm-tab, and can be styled.

                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/widget.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/widget.html deleted file mode 100644 index da39a92..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/widget.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Inline Widget Demo - - - - - - - - - - -
                -

                Inline Widget Demo

                - - -
                - -

                This demo runs JSHint over the code -in the editor (which is the script used on this page), and -inserts line widgets to -display the warnings that JSHint comes up with.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/xmlcomplete.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/xmlcomplete.html deleted file mode 100644 index bd452e6..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/xmlcomplete.html +++ /dev/null @@ -1,119 +0,0 @@ - - -CodeMirror: XML Autocomplete Demo - - - - - - - - - - - - -
                -

                XML Autocomplete Demo

                -
                - -

                Press ctrl-space, or type a '<' character to - activate autocompletion. This demo defines a simple schema that - guides completion. The schema can be customized—see - the manual.

                - -

                Development of the xml-hint addon was kindly - sponsored - by www.xperiment.mobi.

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/activebookmark.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/activebookmark.js deleted file mode 100644 index 407282d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/activebookmark.js +++ /dev/null @@ -1,57 +0,0 @@ -// Kludge in HTML5 tag recognition in IE8 -document.createElement("section"); -document.createElement("article"); - -(function() { - if (!window.addEventListener) return; - var pending = false, prevVal = null; - - function updateSoon() { - if (!pending) { - pending = true; - setTimeout(update, 250); - } - } - - function update() { - pending = false; - var marks = document.getElementById("nav").getElementsByTagName("a"), found; - for (var i = 0; i < marks.length; ++i) { - var mark = marks[i], m; - if (mark.getAttribute("data-default")) { - if (found == null) found = i; - } else if (m = mark.href.match(/#(.*)/)) { - var ref = document.getElementById(m[1]); - if (ref && ref.getBoundingClientRect().top < 50) - found = i; - } - } - if (found != null && found != prevVal) { - prevVal = found; - var lis = document.getElementById("nav").getElementsByTagName("li"); - for (var i = 0; i < lis.length; ++i) lis[i].className = ""; - for (var i = 0; i < marks.length; ++i) { - if (found == i) { - marks[i].className = "active"; - for (var n = marks[i]; n; n = n.parentNode) - if (n.nodeName == "LI") n.className = "active"; - } else { - marks[i].className = ""; - } - } - } - } - - window.addEventListener("scroll", updateSoon); - window.addEventListener("load", updateSoon); - window.addEventListener("hashchange", function() { - setTimeout(function() { - var hash = document.location.hash, found = null, m; - var marks = document.getElementById("nav").getElementsByTagName("a"); - for (var i = 0; i < marks.length; i++) - if ((m = marks[i].href.match(/(#.*)/)) && m[1] == hash) { found = i; break; } - if (found != null) for (var i = 0; i < marks.length; i++) - marks[i].className = i == found ? "active" : ""; - }, 300); - }); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/compress.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/compress.html deleted file mode 100644 index f64f4bb..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/compress.html +++ /dev/null @@ -1,329 +0,0 @@ - - -CodeMirror: Compression Helper - - - - - - - - -
                - -

                Script compression helper

                - -

                To optimize loading CodeMirror, especially when including a - bunch of different modes, it is recommended that you combine and - minify (and preferably also gzip) the scripts. This page makes - those first two steps very easy. Simply select the version and - scripts you need in the form below, and - click Compress to download the minified script - file.

                - -
                - -

                Version:

                - - - -

                - with UglifyJS -

                - -

                Custom code to add to the compressed file:

                -
                - - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/docs.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/docs.css deleted file mode 100644 index 881d2aa..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/docs.css +++ /dev/null @@ -1,271 +0,0 @@ -@font-face { - font-family: 'Source Sans Pro'; - font-style: normal; - font-weight: 400; - src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(//themes.googleusercontent.com/static/fonts/sourcesanspro/v5/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff'); -} - -body, html { margin: 0; padding: 0; height: 100%; } -section, article { display: block; padding: 0; } - -body { - background: #f8f8f8; - font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; - line-height: 1.5; -} - -p { margin-top: 0; } - -h2, h3, h1 { - font-weight: normal; - margin-bottom: .7em; -} -h1 { font-size: 140%; } -h2 { font-size: 120%; } -h3 { font-size: 110%; } -article > h2:first-child, section:first-child > h2 { margin-top: 0; } - -#nav h1 { - margin-right: 12px; - margin-top: 0; - margin-bottom: 2px; - color: #d30707; - letter-spacing: .5px; -} - -a, a:visited, a:link, .quasilink { - color: #A21313; - text-decoration: none; -} - -em { - padding-right: 2px; -} - -.quasilink { - cursor: pointer; -} - -article { - max-width: 700px; - margin: 0 0 0 160px; - border-left: 2px solid #E30808; - border-right: 1px solid #ddd; - padding: 30px 50px 100px 50px; - background: white; - z-index: 2; - position: relative; - min-height: 100%; - box-sizing: border-box; - -moz-box-sizing: border-box; -} - -#nav { - position: fixed; - padding-top: 30px; - max-height: 100%; - box-sizing: -moz-border-box; - box-sizing: border-box; - overflow-y: auto; - left: 0; right: none; - width: 160px; - text-align: right; - z-index: 1; -} - -@media screen and (min-width: 1000px) { - article { - margin: 0 auto; - } - #nav { - right: 50%; - width: auto; - border-right: 349px solid transparent; - } -} - -#nav ul { - display: block; - margin: 0; padding: 0; - margin-bottom: 32px; -} - -#nav li { - display: block; - margin-bottom: 4px; -} - -#nav li ul { - font-size: 80%; - margin-bottom: 0; - display: none; -} - -#nav li.active ul { - display: block; -} - -#nav li li a { - padding-right: 20px; - display: inline-block; -} - -#nav ul a { - color: black; - padding: 0 7px 1px 11px; -} - -#nav ul a.active, #nav ul a:hover { - border-bottom: 1px solid #E30808; - margin-bottom: -1px; - color: #E30808; -} - -#logo { - border: 0; - margin-right: 12px; - margin-bottom: 25px; -} - -section { - border-top: 1px solid #E30808; - margin: 1.5em 0; -} - -section.first { - border: none; - margin-top: 0; -} - -#demo { - position: relative; -} - -#demolist { - position: absolute; - right: 5px; - top: 5px; - z-index: 25; -} - -.yinyang { - position: absolute; - top: -10px; - left: 0; right: 0; - margin: auto; - display: block; - height: 120px; -} - -.actions { - margin: 1em 0 0; - min-height: 100px; - position: relative; -} - -.actionspicture { - pointer-events: none; - position: absolute; - height: 100px; - top: 0; left: 0; right: 0; -} - -.actionlink { - pointer-events: auto; - font-family: arial; - font-size: 80%; - font-weight: bold; - position: absolute; - top: 0; bottom: 0; - line-height: 1; - height: 1em; - margin: auto; -} - -.actionlink.download { - color: white; - right: 50%; - margin-right: 13px; - text-shadow: -1px 1px 3px #b00, -1px -1px 3px #b00, 1px 0px 3px #b00; -} - -.actionlink.fund { - color: #b00; - left: 50%; - margin-left: 15px; -} - -.actionlink:hover { - text-decoration: underline; -} - -.actionlink a { - color: inherit; -} - -.actionsleft { - float: left; -} - -.actionsright { - float: right; - text-align: right; -} - -@media screen and (max-width: 800px) { - .actions { - padding-top: 120px; - } - .actionsleft, .actionsright { - float: none; - text-align: left; - margin-bottom: 1em; - } -} - -th { - text-decoration: underline; - font-weight: normal; - text-align: left; -} - -#features ul { - list-style: none; - margin: 0 0 1em; - padding: 0 0 0 1.2em; -} - -#features li:before { - content: "-"; - width: 1em; - display: inline-block; - padding: 0; - margin: 0; - margin-left: -1em; -} - -.rel { - margin-bottom: 0; -} -.rel-note { - margin-top: 0; - color: #555; -} - -pre { - padding-left: 15px; - border-left: 2px solid #ddd; -} - -code { - padding: 0 2px; -} - -strong { - text-decoration: underline; - font-weight: normal; -} - -.field { - border: 1px solid #A21313; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/internals.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/internals.html deleted file mode 100644 index e1ed3e9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/internals.html +++ /dev/null @@ -1,503 +0,0 @@ - - -CodeMirror: Internals - - - - - - - -
                - -

                (Re-) Implementing A Syntax-Highlighting Editor in JavaScript

                - -

                - Topic: JavaScript, code editor implementation
                - Author: Marijn Haverbeke
                - Date: March 2nd 2011 (updated November 13th 2011) -

                - -

                Caution: this text was written briefly after -version 2 was initially written. It no longer (even including the -update at the bottom) fully represents the current implementation. I'm -leaving it here as a historic document. For more up-to-date -information, look at the entries -tagged cm-internals -on my blog.

                - -

                This is a followup to -my Brutal Odyssey to the -Dark Side of the DOM Tree story. That one describes the -mind-bending process of implementing (what would become) CodeMirror 1. -This one describes the internals of CodeMirror 2, a complete rewrite -and rethink of the old code base. I wanted to give this piece another -Hunter Thompson copycat subtitle, but somehow that would be out of -place—the process this time around was one of straightforward -engineering, requiring no serious mind-bending whatsoever.

                - -

                So, what is wrong with CodeMirror 1? I'd estimate, by mailing list -activity and general search-engine presence, that it has been -integrated into about a thousand systems by now. The most prominent -one, since a few weeks, -being Google -code's project hosting. It works, and it's being used widely.

                - -

                Still, I did not start replacing it because I was bored. CodeMirror -1 was heavily reliant on designMode -or contentEditable (depending on the browser). Neither of -these are well specified (HTML5 tries -to specify -their basics), and, more importantly, they tend to be one of the more -obscure and buggy areas of browser functionality—CodeMirror, by using -this functionality in a non-typical way, was constantly running up -against browser bugs. WebKit wouldn't show an empty line at the end of -the document, and in some releases would suddenly get unbearably slow. -Firefox would show the cursor in the wrong place. Internet Explorer -would insist on linkifying everything that looked like a URL or email -address, a behaviour that can't be turned off. Some bugs I managed to -work around (which was often a frustrating, painful process), others, -such as the Firefox cursor placement, I gave up on, and had to tell -user after user that they were known problems, but not something I -could help.

                - -

                Also, there is the fact that designMode (which seemed -to be less buggy than contentEditable in Webkit and -Firefox, and was thus used by CodeMirror 1 in those browsers) requires -a frame. Frames are another tricky area. It takes some effort to -prevent getting tripped up by domain restrictions, they don't -initialize synchronously, behave strangely in response to the back -button, and, on several browsers, can't be moved around the DOM -without having them re-initialize. They did provide a very nice way to -namespace the library, though—CodeMirror 1 could freely pollute the -namespace inside the frame.

                - -

                Finally, working with an editable document means working with -selection in arbitrary DOM structures. Internet Explorer (8 and -before) has an utterly different (and awkward) selection API than all -of the other browsers, and even among the different implementations of -document.selection, details about how exactly a selection -is represented vary quite a bit. Add to that the fact that Opera's -selection support tended to be very buggy until recently, and you can -imagine why CodeMirror 1 contains 700 lines of selection-handling -code.

                - -

                And that brings us to the main issue with the CodeMirror 1 -code base: The proportion of browser-bug-workarounds to real -application code was getting dangerously high. By building on top of a -few dodgy features, I put the system in a vulnerable position—any -incompatibility and bugginess in these features, I had to paper over -with my own code. Not only did I have to do some serious stunt-work to -get it to work on older browsers (as detailed in the -previous story), things -also kept breaking in newly released versions, requiring me to come up -with new scary hacks in order to keep up. This was starting -to lose its appeal.

                - -
                -

                General Approach

                - -

                What CodeMirror 2 does is try to sidestep most of the hairy hacks -that came up in version 1. I owe a lot to the -ACE editor for inspiration on how to -approach this.

                - -

                I absolutely did not want to be completely reliant on key events to -generate my input. Every JavaScript programmer knows that key event -information is horrible and incomplete. Some people (most awesomely -Mihai Bazon with Ymacs) have been able -to build more or less functioning editors by directly reading key -events, but it takes a lot of work (the kind of never-ending, fragile -work I described earlier), and will never be able to properly support -things like multi-keystoke international character -input. [see below for caveat]

                - -

                So what I do is focus a hidden textarea, and let the browser -believe that the user is typing into that. What we show to the user is -a DOM structure we built to represent his document. If this is updated -quickly enough, and shows some kind of believable cursor, it feels -like a real text-input control.

                - -

                Another big win is that this DOM representation does not have to -span the whole document. Some CodeMirror 1 users insisted that they -needed to put a 30 thousand line XML document into CodeMirror. Putting -all that into the DOM takes a while, especially since, for some -reason, an editable DOM tree is slower than a normal one on most -browsers. If we have full control over what we show, we must only -ensure that the visible part of the document has been added, and can -do the rest only when needed. (Fortunately, the onscroll -event works almost the same on all browsers, and lends itself well to -displaying things only as they are scrolled into view.)

                -
                -
                -

                Input

                - -

                ACE uses its hidden textarea only as a text input shim, and does -all cursor movement and things like text deletion itself by directly -handling key events. CodeMirror's way is to let the browser do its -thing as much as possible, and not, for example, define its own set of -key bindings. One way to do this would have been to have the whole -document inside the hidden textarea, and after each key event update -the display DOM to reflect what's in that textarea.

                - -

                That'd be simple, but it is not realistic. For even medium-sized -document the editor would be constantly munging huge strings, and get -terribly slow. What CodeMirror 2 does is put the current selection, -along with an extra line on the top and on the bottom, into the -textarea.

                - -

                This means that the arrow keys (and their ctrl-variations), home, -end, etcetera, do not have to be handled specially. We just read the -cursor position in the textarea, and update our cursor to match it. -Also, copy and paste work pretty much for free, and people get their -native key bindings, without any special work on my part. For example, -I have emacs key bindings configured for Chrome and Firefox. There is -no way for a script to detect this. [no longer the case]

                - -

                Of course, since only a small part of the document sits in the -textarea, keys like page up and ctrl-end won't do the right thing. -CodeMirror is catching those events and handling them itself.

                -
                -
                -

                Selection

                - -

                Getting and setting the selection range of a textarea in modern -browsers is trivial—you just use the selectionStart -and selectionEnd properties. On IE you have to do some -insane stuff with temporary ranges and compensating for the fact that -moving the selection by a 'character' will treat \r\n as a single -character, but even there it is possible to build functions that -reliably set and get the selection range.

                - -

                But consider this typical case: When I'm somewhere in my document, -press shift, and press the up arrow, something gets selected. Then, if -I, still holding shift, press the up arrow again, the top of my -selection is adjusted. The selection remembers where its head -and its anchor are, and moves the head when we shift-move. -This is a generally accepted property of selections, and done right by -every editing component built in the past twenty years.

                - -

                But not something that the browser selection APIs expose.

                - -

                Great. So when someone creates an 'upside-down' selection, the next -time CodeMirror has to update the textarea, it'll re-create the -selection as an 'upside-up' selection, with the anchor at the top, and -the next cursor motion will behave in an unexpected way—our second -up-arrow press in the example above will not do anything, since it is -interpreted in exactly the same way as the first.

                - -

                No problem. We'll just, ehm, detect that the selection is -upside-down (you can tell by the way it was created), and then, when -an upside-down selection is present, and a cursor-moving key is -pressed in combination with shift, we quickly collapse the selection -in the textarea to its start, allow the key to take effect, and then -combine its new head with its old anchor to get the real -selection.

                - -

                In short, scary hacks could not be avoided entirely in CodeMirror -2.

                - -

                And, the observant reader might ask, how do you even know that a -key combo is a cursor-moving combo, if you claim you support any -native key bindings? Well, we don't, but we can learn. The editor -keeps a set known cursor-movement combos (initialized to the -predictable defaults), and updates this set when it observes that -pressing a certain key had (only) the effect of moving the cursor. -This, of course, doesn't work if the first time the key is used was -for extending an inverted selection, but it works most of the -time.

                -
                -
                -

                Intelligent Updating

                - -

                One thing that always comes up when you have a complicated internal -state that's reflected in some user-visible external representation -(in this case, the displayed code and the textarea's content) is -keeping the two in sync. The naive way is to just update the display -every time you change your state, but this is not only error prone -(you'll forget), it also easily leads to duplicate work on big, -composite operations. Then you start passing around flags indicating -whether the display should be updated in an attempt to be efficient -again and, well, at that point you might as well give up completely.

                - -

                I did go down that road, but then switched to a much simpler model: -simply keep track of all the things that have been changed during an -action, and then, only at the end, use this information to update the -user-visible display.

                - -

                CodeMirror uses a concept of operations, which start by -calling a specific set-up function that clears the state and end by -calling another function that reads this state and does the required -updating. Most event handlers, and all the user-visible methods that -change state are wrapped like this. There's a method -called operation that accepts a function, and returns -another function that wraps the given function as an operation.

                - -

                It's trivial to extend this (as CodeMirror does) to detect nesting, -and, when an operation is started inside an operation, simply -increment the nesting count, and only do the updating when this count -reaches zero again.

                - -

                If we have a set of changed ranges and know the currently shown -range, we can (with some awkward code to deal with the fact that -changes can add and remove lines, so we're dealing with a changing -coordinate system) construct a map of the ranges that were left -intact. We can then compare this map with the part of the document -that's currently visible (based on scroll offset and editor height) to -determine whether something needs to be updated.

                - -

                CodeMirror uses two update algorithms—a full refresh, where it just -discards the whole part of the DOM that contains the edited text and -rebuilds it, and a patch algorithm, where it uses the information -about changed and intact ranges to update only the out-of-date parts -of the DOM. When more than 30 percent (which is the current heuristic, -might change) of the lines need to be updated, the full refresh is -chosen (since it's faster to do than painstakingly finding and -updating all the changed lines), in the other case it does the -patching (so that, if you scroll a line or select another character, -the whole screen doesn't have to be -re-rendered). [the full-refresh -algorithm was dropped, it wasn't really faster than the patching -one]

                - -

                All updating uses innerHTML rather than direct DOM -manipulation, since that still seems to be by far the fastest way to -build documents. There's a per-line function that combines the -highlighting, marking, and -selection info for that line into a snippet of HTML. The patch updater -uses this to reset individual lines, the refresh updater builds an -HTML chunk for the whole visible document at once, and then uses a -single innerHTML update to do the refresh.

                -
                -
                -

                Parsers can be Simple

                - -

                When I wrote CodeMirror 1, I -thought interruptable -parsers were a hugely scary and complicated thing, and I used a -bunch of heavyweight abstractions to keep this supposed complexity -under control: parsers -were iterators -that consumed input from another iterator, and used funny -closure-resetting tricks to copy and resume themselves.

                - -

                This made for a rather nice system, in that parsers formed strictly -separate modules, and could be composed in predictable ways. -Unfortunately, it was quite slow (stacking three or four iterators on -top of each other), and extremely intimidating to people not used to a -functional programming style.

                - -

                With a few small changes, however, we can keep all those -advantages, but simplify the API and make the whole thing less -indirect and inefficient. CodeMirror -2's mode API uses explicit state -objects, and makes the parser/tokenizer a function that simply takes a -state and a character stream abstraction, advances the stream one -token, and returns the way the token should be styled. This state may -be copied, optionally in a mode-defined way, in order to be able to -continue a parse at a given point. Even someone who's never touched a -lambda in his life can understand this approach. Additionally, far -fewer objects are allocated in the course of parsing now.

                - -

                The biggest speedup comes from the fact that the parsing no longer -has to touch the DOM though. In CodeMirror 1, on an older browser, you -could see the parser work its way through the document, -managing some twenty lines in each 50-millisecond time slice it got. It -was reading its input from the DOM, and updating the DOM as it went -along, which any experienced JavaScript programmer will immediately -spot as a recipe for slowness. In CodeMirror 2, the parser usually -finishes the whole document in a single 100-millisecond time slice—it -manages some 1500 lines during that time on Chrome. All it has to do -is munge strings, so there is no real reason for it to be slow -anymore.

                -
                -
                -

                What Gives?

                - -

                Given all this, what can you expect from CodeMirror 2?

                - -
                  - -
                • Small. the base library is -some 45k when minified -now, 17k when gzipped. It's smaller than -its own logo.
                • - -
                • Lightweight. CodeMirror 2 initializes very -quickly, and does almost no work when it is not focused. This means -you can treat it almost like a textarea, have multiple instances on a -page without trouble.
                • - -
                • Huge document support. Since highlighting is -really fast, and no DOM structure is being built for non-visible -content, you don't have to worry about locking up your browser when a -user enters a megabyte-sized document.
                • - -
                • Extended API. Some things kept coming up in the -mailing list, such as marking pieces of text or lines, which were -extremely hard to do with CodeMirror 1. The new version has proper -support for these built in.
                • - -
                • Tab support. Tabs inside editable documents were, -for some reason, a no-go. At least six different people announced they -were going to add tab support to CodeMirror 1, none survived (I mean, -none delivered a working version). CodeMirror 2 no longer removes tabs -from your document.
                • - -
                • Sane styling. iframe nodes aren't -really known for respecting document flow. Now that an editor instance -is a plain div element, it is much easier to size it to -fit the surrounding elements. You don't even have to make it scroll if -you do not want to.
                • - -
                - -

                On the downside, a CodeMirror 2 instance is not a native -editable component. Though it does its best to emulate such a -component as much as possible, there is functionality that browsers -just do not allow us to hook into. Doing select-all from the context -menu, for example, is not currently detected by CodeMirror.

                - -

                [Updates from November 13th 2011] Recently, I've made -some changes to the codebase that cause some of the text above to no -longer be current. I've left the text intact, but added markers at the -passages that are now inaccurate. The new situation is described -below.

                -
                -
                -

                Content Representation

                - -

                The original implementation of CodeMirror 2 represented the -document as a flat array of line objects. This worked well—splicing -arrays will require the part of the array after the splice to be -moved, but this is basically just a simple memmove of a -bunch of pointers, so it is cheap even for huge documents.

                - -

                However, I recently added line wrapping and code folding (line -collapsing, basically). Once lines start taking up a non-constant -amount of vertical space, looking up a line by vertical position -(which is needed when someone clicks the document, and to determine -the visible part of the document during scrolling) can only be done -with a linear scan through the whole array, summing up line heights as -you go. Seeing how I've been going out of my way to make big documents -fast, this is not acceptable.

                - -

                The new representation is based on a B-tree. The leaves of the tree -contain arrays of line objects, with a fixed minimum and maximum size, -and the non-leaf nodes simply hold arrays of child nodes. Each node -stores both the amount of lines that live below them and the vertical -space taken up by these lines. This allows the tree to be indexed both -by line number and by vertical position, and all access has -logarithmic complexity in relation to the document size.

                - -

                I gave line objects and tree nodes parent pointers, to the node -above them. When a line has to update its height, it can simply walk -these pointers to the top of the tree, adding or subtracting the -difference in height from each node it encounters. The parent pointers -also make it cheaper (in complexity terms, the difference is probably -tiny in normal-sized documents) to find the current line number when -given a line object. In the old approach, the whole document array had -to be searched. Now, we can just walk up the tree and count the sizes -of the nodes coming before us at each level.

                - -

                I chose B-trees, not regular binary trees, mostly because they -allow for very fast bulk insertions and deletions. When there is a big -change to a document, it typically involves adding, deleting, or -replacing a chunk of subsequent lines. In a regular balanced tree, all -these inserts or deletes would have to be done separately, which could -be really expensive. In a B-tree, to insert a chunk, you just walk -down the tree once to find where it should go, insert them all in one -shot, and then break up the node if needed. This breaking up might -involve breaking up nodes further up, but only requires a single pass -back up the tree. For deletion, I'm somewhat lax in keeping things -balanced—I just collapse nodes into a leaf when their child count goes -below a given number. This means that there are some weird editing -patterns that may result in a seriously unbalanced tree, but even such -an unbalanced tree will perform well, unless you spend a day making -strangely repeating edits to a really big document.

                -
                -
                -

                Keymaps

                - -

                Above, I claimed that directly catching key -events for things like cursor movement is impractical because it -requires some browser-specific kludges. I then proceeded to explain -some awful hacks that were needed to make it -possible for the selection changes to be detected through the -textarea. In fact, the second hack is about as bad as the first.

                - -

                On top of that, in the presence of user-configurable tab sizes and -collapsed and wrapped lines, lining up cursor movement in the textarea -with what's visible on the screen becomes a nightmare. Thus, I've -decided to move to a model where the textarea's selection is no longer -depended on.

                - -

                So I moved to a model where all cursor movement is handled by my -own code. This adds support for a goal column, proper interaction of -cursor movement with collapsed lines, and makes it possible for -vertical movement to move through wrapped lines properly, instead of -just treating them like non-wrapped lines.

                - -

                The key event handlers now translate the key event into a string, -something like Ctrl-Home or Shift-Cmd-R, and -use that string to look up an action to perform. To make keybinding -customizable, this lookup goes through -a table, using a scheme that -allows such tables to be chained together (for example, the default -Mac bindings fall through to a table named 'emacsy', which defines -basic Emacs-style bindings like Ctrl-F, and which is also -used by the custom Emacs bindings).

                - -

                A new -option extraKeys -allows ad-hoc keybindings to be defined in a much nicer way than what -was possible with the -old onKeyEvent -callback. You simply provide an object mapping key identifiers to -functions, instead of painstakingly looking at raw key events.

                - -

                Built-in commands map to strings, rather than functions, for -example "goLineUp" is the default action bound to the up -arrow key. This allows new keymaps to refer to them without -duplicating any code. New commands can be defined by assigning to -the CodeMirror.commands object, which maps such commands -to functions.

                - -

                The hidden textarea now only holds the current selection, with no -extra characters around it. This has a nice advantage: polling for -input becomes much, much faster. If there's a big selection, this text -does not have to be read from the textarea every time—when we poll, -just noticing that something is still selected is enough to tell us -that no new text was typed.

                - -

                The reason that cheap polling is important is that many browsers do -not fire useful events on IME (input method engine) input, which is -the thing where people inputting a language like Japanese or Chinese -use multiple keystrokes to create a character or sequence of -characters. Most modern browsers fire input when the -composing is finished, but many don't fire anything when the character -is updated during composition. So we poll, whenever the -editor is focused, to provide immediate updates of the display.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.png b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.png deleted file mode 100644 index 9aabda1..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.svg b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.svg deleted file mode 100644 index 0aa6323..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.svg +++ /dev/null @@ -1,181 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/manual.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/manual.html deleted file mode 100644 index 441afea..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/manual.html +++ /dev/null @@ -1,3327 +0,0 @@ - - -CodeMirror: User Manual - - - - - - - - - - - - - - - - -
                - -
                -

                - User manual and reference guide - version 5.5.0 -

                - -

                CodeMirror is a code-editor component that can be embedded in - Web pages. The core library provides only the editor - component, no accompanying buttons, auto-completion, or other IDE - functionality. It does provide a rich API on top of which such - functionality can be straightforwardly implemented. See - the addons included in the distribution, - and the list - of externally hosted addons, for reusable - implementations of extra features.

                - -

                CodeMirror works with language-specific modes. Modes are - JavaScript programs that help color (and optionally indent) text - written in a given language. The distribution comes with a number - of modes (see the mode/ - directory), and it isn't hard to write new - ones for other languages.

                -
                - -
                -

                Basic Usage

                - -

                The easiest way to use CodeMirror is to simply load the script - and style sheet found under lib/ in the distribution, - plus a mode script from one of the mode/ directories. - (See the compression helper for an - easy way to combine scripts.) For example:

                - -
                <script src="lib/codemirror.js"></script>
                -<link rel="stylesheet" href="../lib/codemirror.css">
                -<script src="mode/javascript/javascript.js"></script>
                - -

                (Alternatively, use a module loader. More - about that later.)

                - -

                Having done this, an editor instance can be created like - this:

                - -
                var myCodeMirror = CodeMirror(document.body);
                - -

                The editor will be appended to the document body, will start - empty, and will use the mode that we loaded. To have more control - over the new editor, a configuration object can be passed - to CodeMirror as a second - argument:

                - -
                var myCodeMirror = CodeMirror(document.body, {
                -  value: "function myScript(){return 100;}\n",
                -  mode:  "javascript"
                -});
                - -

                This will initialize the editor with a piece of code already in - it, and explicitly tell it to use the JavaScript mode (which is - useful when multiple modes are loaded). - See below for a full discussion of the - configuration options that CodeMirror accepts.

                - -

                In cases where you don't want to append the editor to an - element, and need more control over the way it is inserted, the - first argument to the CodeMirror function can also - be a function that, when given a DOM element, inserts it into the - document somewhere. This could be used to, for example, replace a - textarea with a real editor:

                - -
                var myCodeMirror = CodeMirror(function(elt) {
                -  myTextArea.parentNode.replaceChild(elt, myTextArea);
                -}, {value: myTextArea.value});
                - -

                However, for this use case, which is a common way to use - CodeMirror, the library provides a much more powerful - shortcut:

                - -
                var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
                - -

                This will, among other things, ensure that the textarea's value - is updated with the editor's contents when the form (if it is part - of a form) is submitted. See the API - reference for a full description of this method.

                - -

                Module loaders

                - -

                The files in the CodeMirror distribution contain shims for - loading them (and their dependencies) in AMD or CommonJS - environments. If the variables exports - and module exist and have type object, CommonJS-style - require will be used. If not, but there is a - function define with an amd property - present, AMD-style (RequireJS) will be used.

                - -

                It is possible to - use Browserify or similar - tools to statically build modules using CodeMirror. Alternatively, - use RequireJS to dynamically - load dependencies at runtime. Both of these approaches have the - advantage that they don't use the global namespace and can, thus, - do things like load multiple versions of CodeMirror alongside each - other.

                - -

                Here's a simple example of using RequireJS to load CodeMirror:

                - -
                require([
                -  "cm/lib/codemirror", "cm/mode/htmlmixed/htmlmixed"
                -], function(CodeMirror) {
                -  CodeMirror.fromTextArea(document.getElementById("code"), {
                -    lineNumbers: true,
                -    mode: "htmlmixed"
                -  });
                -});
                - -

                It will automatically load the modes that the mixed HTML mode - depends on (XML, JavaScript, and CSS). Do not use - RequireJS' paths option to configure the path to - CodeMirror, since it will break loading submodules through - relative paths. Use - the packages - configuration option instead, as in:

                - -
                require.config({
                -  packages: [{
                -    name: "codemirror",
                -    location: "../path/to/codemirror",
                -    main: "lib/codemirror"
                -  }]
                -});
                - -
                - -
                -

                Configuration

                - -

                Both the CodeMirror - function and its fromTextArea method take as second - (optional) argument an object containing configuration options. - Any option not supplied like this will be taken - from CodeMirror.defaults, an - object containing the default options. You can update this object - to change the defaults on your page.

                - -

                Options are not checked in any way, so setting bogus option - values is bound to lead to odd errors.

                - -

                These are the supported options:

                - -
                -
                value: string|CodeMirror.Doc
                -
                The starting value of the editor. Can be a string, or - a document object.
                - -
                mode: string|object
                -
                The mode to use. When not given, this will default to the - first mode that was loaded. It may be a string, which either - simply names the mode or is - a MIME type - associated with the mode. Alternatively, it may be an object - containing configuration options for the mode, with - a name property that names the mode (for - example {name: "javascript", json: true}). The demo - pages for each mode contain information about what configuration - parameters the mode supports. You can ask CodeMirror which modes - and MIME types have been defined by inspecting - the CodeMirror.modes - and CodeMirror.mimeModes objects. The first maps - mode names to their constructors, and the second maps MIME types - to mode specs.
                - -
                lineSeparator: string|null
                -
                Explicitly set the line separator for the editor. By default - (value null), the document will be split on CRLFs - as well as lone CRs and LFs, and a single LF will be used as - line separator in all output (such - as getValue). When a - specific string is given, lines will only be split on that - string, and output will, by default, use that same - separator.
                - -
                theme: string
                -
                The theme to style the editor with. You must make sure the - CSS file defining the corresponding .cm-s-[name] - styles is loaded (see - the theme directory in the - distribution). The default is "default", for which - colors are included in codemirror.css. It is - possible to use multiple theming classes at once—for - example "foo bar" will assign both - the cm-s-foo and the cm-s-bar classes - to the editor.
                - -
                indentUnit: integer
                -
                How many spaces a block (whatever that means in the edited - language) should be indented. The default is 2.
                - -
                smartIndent: boolean
                -
                Whether to use the context-sensitive indentation that the - mode provides (or just indent the same as the line before). - Defaults to true.
                - -
                tabSize: integer
                -
                The width of a tab character. Defaults to 4.
                - -
                indentWithTabs: boolean
                -
                Whether, when indenting, the first N*tabSize - spaces should be replaced by N tabs. Default is false.
                - -
                electricChars: boolean
                -
                Configures whether the editor should re-indent the current - line when a character is typed that might change its proper - indentation (only works if the mode supports indentation). - Default is true.
                - -
                specialChars: RegExp
                -
                A regular expression used to determine which characters - should be replaced by a - special placeholder. - Mostly useful for non-printing special characters. The default - is /[\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/.
                -
                specialCharPlaceholder: function(char) → Element
                -
                A function that, given a special character identified by - the specialChars - option, produces a DOM node that is used to represent the - character. By default, a red dot () - is shown, with a title tooltip to indicate the character code.
                - -
                rtlMoveVisually: boolean
                -
                Determines whether horizontal cursor movement through - right-to-left (Arabic, Hebrew) text is visual (pressing the left - arrow moves the cursor left) or logical (pressing the left arrow - moves to the next lower index in the string, which is visually - right in right-to-left text). The default is false - on Windows, and true on other platforms.
                - -
                keyMap: string
                -
                Configures the key map to use. The default - is "default", which is the only key map defined - in codemirror.js itself. Extra key maps are found in - the key map directory. See - the section on key maps for more - information.
                - -
                extraKeys: object
                -
                Can be used to specify extra key bindings for the editor, - alongside the ones defined - by keyMap. Should be - either null, or a valid key map value.
                - -
                lineWrapping: boolean
                -
                Whether CodeMirror should scroll or wrap for long lines. - Defaults to false (scroll).
                - -
                lineNumbers: boolean
                -
                Whether to show line numbers to the left of the editor.
                - -
                firstLineNumber: integer
                -
                At which number to start counting lines. Default is 1.
                - -
                lineNumberFormatter: function(line: integer) → string
                -
                A function used to format line numbers. The function is - passed the line number, and should return a string that will be - shown in the gutter.
                - -
                gutters: array<string>
                -
                Can be used to add extra gutters (beyond or instead of the - line number gutter). Should be an array of CSS class names, each - of which defines a width (and optionally a - background), and which will be used to draw the background of - the gutters. May include - the CodeMirror-linenumbers class, in order to - explicitly set the position of the line number gutter (it will - default to be to the right of all other gutters). These class - names are the keys passed - to setGutterMarker.
                - -
                fixedGutter: boolean
                -
                Determines whether the gutter scrolls along with the content - horizontally (false) or whether it stays fixed during horizontal - scrolling (true, the default).
                - -
                scrollbarStyle: string
                -
                Chooses a scrollbar implementation. The default - is "native", showing native scrollbars. The core - library also provides the "null" style, which - completely hides the - scrollbars. Addons can - implement additional scrollbar models.
                - -
                coverGutterNextToScrollbar: boolean
                -
                When fixedGutter - is on, and there is a horizontal scrollbar, by default the - gutter will be visible to the left of this scrollbar. If this - option is set to true, it will be covered by an element with - class CodeMirror-gutter-filler.
                - -
                inputStyle: string
                -
                Selects the way CodeMirror handles input and focus. The core - library defines the "textarea" - and "contenteditable" input models. On mobile - browsers, the default is "contenteditable". On - desktop browsers, the default is "textarea". - Support for IME and screen readers is better in - the "contenteditable" model. The intention is to - make it the default on modern desktop browsers in the - future.
                - -
                readOnly: boolean|string
                -
                This disables editing of the editor content by the user. If - the special value "nocursor" is given (instead of - simply true), focusing of the editor is also - disallowed.
                - -
                showCursorWhenSelecting: boolean
                -
                Whether the cursor should be drawn when a selection is - active. Defaults to false.
                - -
                lineWiseCopyCut: boolean
                -
                When enabled, which is the default, doing copy or cut when - there is no selection will copy or cut the whole lines that have - cursors on them.
                - -
                undoDepth: integer
                -
                The maximum number of undo levels that the editor stores. - Note that this includes selection change events. Defaults to - 200.
                - -
                historyEventDelay: integer
                -
                The period of inactivity (in milliseconds) that will cause a - new history event to be started when typing or deleting. - Defaults to 1250.
                - -
                tabindex: integer
                -
                The tab - index to assign to the editor. If not given, no tab index - will be assigned.
                - -
                autofocus: boolean
                -
                Can be used to make CodeMirror focus itself on - initialization. Defaults to off. - When fromTextArea is - used, and no explicit value is given for this option, it will be - set to true when either the source textarea is focused, or it - has an autofocus attribute and no other element is - focused.
                -
                - -

                Below this a few more specialized, low-level options are - listed. These are only useful in very specific situations, you - might want to skip them the first time you read this manual.

                - -
                -
                dragDrop: boolean
                -
                Controls whether drag-and-drop is enabled. On by default.
                - -
                cursorBlinkRate: number
                -
                Half-period in milliseconds used for cursor blinking. The default blink - rate is 530ms. By setting this to zero, blinking can be disabled. A - negative value hides the cursor entirely.
                - -
                cursorScrollMargin: number
                -
                How much extra space to always keep above and below the - cursor when approaching the top or bottom of the visible view in - a scrollable document. Default is 0.
                - -
                cursorHeight: number
                -
                Determines the height of the cursor. Default is 1, meaning - it spans the whole height of the line. For some fonts (and by - some tastes) a smaller height (for example 0.85), - which causes the cursor to not reach all the way to the bottom - of the line, looks better
                - -
                resetSelectionOnContextMenu: boolean
                -
                Controls whether, when the context menu is opened with a - click outside of the current selection, the cursor is moved to - the point of the click. Defaults to true.
                - -
                workTime, workDelay: number
                -
                Highlighting is done by a pseudo background-thread that will - work for workTime milliseconds, and then use - timeout to sleep for workDelay milliseconds. The - defaults are 200 and 300, you can change these options to make - the highlighting more or less aggressive.
                - -
                pollInterval: number
                -
                Indicates how quickly CodeMirror should poll its input - textarea for changes (when focused). Most input is captured by - events, but some things, like IME input on some browsers, don't - generate events that allow CodeMirror to properly detect it. - Thus, it polls. Default is 100 milliseconds.
                - -
                flattenSpans: boolean
                -
                By default, CodeMirror will combine adjacent tokens into a - single span if they have the same class. This will result in a - simpler DOM tree, and thus perform better. With some kinds of - styling (such as rounded corners), this will change the way the - document looks. You can set this option to false to disable this - behavior.
                - -
                addModeClass: boolean
                -
                When enabled (off by default), an extra CSS class will be - added to each token, indicating the - (inner) mode that produced it, prefixed - with "cm-m-". For example, tokens from the XML mode - will get the cm-m-xml class.
                - -
                maxHighlightLength: number
                -
                When highlighting long lines, in order to stay responsive, - the editor will give up and simply style the rest of the line as - plain text when it reaches a certain position. The default is - 10 000. You can set this to Infinity to turn off - this behavior.
                - -
                viewportMargin: integer
                -
                Specifies the amount of lines that are rendered above and - below the part of the document that's currently scrolled into - view. This affects the amount of updates needed when scrolling, - and the amount of work that such an update does. You should - usually leave it at its default, 10. Can be set - to Infinity to make sure the whole document is - always rendered, and thus the browser's text search works on it. - This will have bad effects on performance of big - documents.
                -
                -
                - -
                -

                Events

                - -

                Various CodeMirror-related objects emit events, which allow - client code to react to various situations. Handlers for such - events can be registered with the on - and off methods on the objects - that the event fires on. To fire your own events, - use CodeMirror.signal(target, name, args...), - where target is a non-DOM-node object.

                - -

                An editor instance fires the following events. - The instance argument always refers to the editor - itself.

                - -
                -
                "change" (instance: CodeMirror, changeObj: object)
                -
                Fires every time the content of the editor is changed. - The changeObj is a {from, to, text, removed, - origin} object containing information about the changes - that occurred as second argument. from - and to are the positions (in the pre-change - coordinate system) where the change started and ended (for - example, it might be {ch:0, line:18} if the - position is at the beginning of line #19). text is - an array of strings representing the text that replaced the - changed range (split by line). removed is the text - that used to be between from and to, - which is overwritten by this change. This event is - fired before the end of - an operation, before the DOM updates - happen.
                - -
                "changes" (instance: CodeMirror, changes: array<object>)
                -
                Like the "change" - event, but batched per operation, - passing an array containing all the changes that happened in the - operation. This event is fired after the operation finished, and - display changes it makes will trigger a new operation.
                - -
                "beforeChange" (instance: CodeMirror, changeObj: object)
                -
                This event is fired before a change is applied, and its - handler may choose to modify or cancel the change. - The changeObj object - has from, to, and text - properties, as with - the "change" event. It - also has a cancel() method, which can be called to - cancel the change, and, if the change isn't - coming from an undo or redo event, an update(from, to, - text) method, which may be used to modify the change. - Undo or redo changes can't be modified, because they hold some - metainformation for restoring old marked ranges that is only - valid for that specific change. All three arguments - to update are optional, and can be left off to - leave the existing value for that field - intact. Note: you may not do anything from - a "beforeChange" handler that would cause changes - to the document or its visualization. Doing so will, since this - handler is called directly from the bowels of the CodeMirror - implementation, probably cause the editor to become - corrupted.
                - -
                "cursorActivity" (instance: CodeMirror)
                -
                Will be fired when the cursor or selection moves, or any - change is made to the editor content.
                - -
                "keyHandled" (instance: CodeMirror, name: string, event: Event)
                -
                Fired after a key is handled through a - key map. name is the name of the handled key (for - example "Ctrl-X" or "'q'"), - and event is the DOM keydown - or keypress event.
                - -
                "inputRead" (instance: CodeMirror, changeObj: object)
                -
                Fired whenever new input is read from the hidden textarea - (typed or pasted by the user).
                - -
                "electrictInput" (instance: CodeMirror, line: integer)
                -
                Fired if text input matched the - mode's electric patterns, - and this caused the line's indentation to change.
                - -
                "beforeSelectionChange" (instance: CodeMirror, obj: {ranges, update})
                -
                This event is fired before the selection is moved. Its - handler may inspect the set of selection ranges, present as an - array of {anchor, head} objects in - the ranges property of the obj - argument, and optionally change them by calling - the update method on this object, passing an array - of ranges in the same format. Handlers for this event have the - same restriction - as "beforeChange" - handlers — they should not do anything to directly update the - state of the editor.
                - -
                "viewportChange" (instance: CodeMirror, from: number, to: number)
                -
                Fires whenever the view port of - the editor changes (due to scrolling, editing, or any other - factor). The from and to arguments - give the new start and end of the viewport.
                - -
                "swapDoc" (instance: CodeMirror, oldDoc: Doc)
                -
                This is signalled when the editor's document is replaced - using the swapDoc - method.
                - -
                "gutterClick" (instance: CodeMirror, line: integer, gutter: string, clickEvent: Event)
                -
                Fires when the editor gutter (the line-number area) is - clicked. Will pass the editor instance as first argument, the - (zero-based) number of the line that was clicked as second - argument, the CSS class of the gutter that was clicked as third - argument, and the raw mousedown event object as - fourth argument.
                - -
                "gutterContextMenu" (instance: CodeMirror, line: integer, gutter: string, contextMenu: Event: Event)
                -
                Fires when the editor gutter (the line-number area) - receives a contextmenu event. Will pass the editor - instance as first argument, the (zero-based) number of the line - that was clicked as second argument, the CSS class of the - gutter that was clicked as third argument, and the raw - contextmenu mouse event object as fourth argument. - You can preventDefault the event, to signal that - CodeMirror should do no further handling.
                - -
                "focus" (instance: CodeMirror)
                -
                Fires whenever the editor is focused.
                - -
                "blur" (instance: CodeMirror)
                -
                Fires whenever the editor is unfocused.
                - -
                "scroll" (instance: CodeMirror)
                -
                Fires when the editor is scrolled.
                - -
                "scrollCursorIntoView" (instance: CodeMirror, event: Event)
                -
                Fires when the editor tries to scroll its cursor into view. - Can be hooked into to take care of additional scrollable - containers around the editor. When the event object has - its preventDefault method called, CodeMirror will - not itself try to scroll the window.
                - -
                "update" (instance: CodeMirror)
                -
                Will be fired whenever CodeMirror updates its DOM display.
                - -
                "renderLine" (instance: CodeMirror, line: LineHandle, element: Element)
                -
                Fired whenever a line is (re-)rendered to the DOM. Fired - right after the DOM element is built, before it is - added to the document. The handler may mess with the style of - the resulting element, or add event handlers, but - should not try to change the state of the editor.
                - -
                "mousedown", - "dblclick", "contextmenu", "keydown", "keypress", - "keyup", "dragstart", "dragenter", - "dragover", "drop" - (instance: CodeMirror, event: Event)
                -
                Fired when CodeMirror is handling a DOM event of this type. - You can preventDefault the event, or give it a - truthy codemirrorIgnore property, to signal that - CodeMirror should do no further handling.
                -
                - -

                Document objects (instances - of CodeMirror.Doc) emit the - following events:

                - -
                -
                "change" (doc: CodeMirror.Doc, changeObj: object)
                -
                Fired whenever a change occurs to the - document. changeObj has a similar type as the - object passed to the - editor's "change" - event.
                - -
                "beforeChange" (doc: CodeMirror.Doc, change: object)
                -
                See the description of the - same event on editor instances.
                - -
                "cursorActivity" (doc: CodeMirror.Doc)
                -
                Fired whenever the cursor or selection in this document - changes.
                - -
                "beforeSelectionChange" (doc: CodeMirror.Doc, selection: {head, anchor})
                -
                Equivalent to - the event by the same - name as fired on editor instances.
                -
                - -

                Line handles (as returned by, for - example, getLineHandle) - support these events:

                - -
                -
                "delete" ()
                -
                Will be fired when the line object is deleted. A line object - is associated with the start of the line. Mostly useful - when you need to find out when your gutter - markers on a given line are removed.
                -
                "change" (line: LineHandle, changeObj: object)
                -
                Fires when the line's text content is changed in any way - (but the line is not deleted outright). The change - object is similar to the one passed - to change event on the editor - object.
                -
                - -

                Marked range handles (CodeMirror.TextMarker), as returned - by markText - and setBookmark, emit the - following events:

                - -
                -
                "beforeCursorEnter" ()
                -
                Fired when the cursor enters the marked range. From this - event handler, the editor state may be inspected - but not modified, with the exception that the range on - which the event fires may be cleared.
                -
                "clear" (from: {line, ch}, to: {line, ch})
                -
                Fired when the range is cleared, either through cursor - movement in combination - with clearOnEnter - or through a call to its clear() method. Will only - be fired once per handle. Note that deleting the range through - text editing does not fire this event, because an undo action - might bring the range back into existence. from - and to give the part of the document that the range - spanned when it was cleared.
                -
                "hide" ()
                -
                Fired when the last part of the marker is removed from the - document by editing operations.
                -
                "unhide" ()
                -
                Fired when, after the marker was removed by editing, a undo - operation brought the marker back.
                -
                - -

                Line widgets (CodeMirror.LineWidget), returned - by addLineWidget, fire - these events:

                - -
                -
                "redraw" ()
                -
                Fired whenever the editor re-adds the widget to the DOM. - This will happen once right after the widget is added (if it is - scrolled into view), and then again whenever it is scrolled out - of view and back in again, or when changes to the editor options - or the line the widget is on require the widget to be - redrawn.
                -
                -
                - -
                -

                Key Maps

                - -

                Key maps are ways to associate keys with functionality. A key map - is an object mapping strings that identify the keys to functions - that implement their functionality.

                - -

                The CodeMirror distributions comes - with Emacs, Vim, - and Sublime Text-style keymaps.

                - -

                Keys are identified either by name or by character. - The CodeMirror.keyNames object defines names for - common keys and associates them with their key codes. Examples of - names defined here are Enter, F5, - and Q. These can be prefixed - with Shift-, Cmd-, Ctrl-, - and Alt- to specify a modifier. So for - example, Shift-Ctrl-Space would be a valid key - identifier.

                - -

                Common example: map the Tab key to insert spaces instead of a tab - character.

                - -
                -editor.setOption("extraKeys", {
                -  Tab: function(cm) {
                -    var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
                -    cm.replaceSelection(spaces);
                -  }
                -});
                - -

                Alternatively, a character can be specified directly by - surrounding it in single quotes, for example '$' - or 'q'. Due to limitations in the way browsers fire - key events, these may not be prefixed with modifiers.

                - -

                Multi-stroke key bindings can be specified - by separating the key names by spaces in the property name, for - example Ctrl-X Ctrl-V. When a map contains - multi-stoke bindings or keys with modifiers that are not specified - in the default order (Shift-Cmd-Ctrl-Alt), you must - call CodeMirror.normalizeKeyMap on it before it can - be used. This function takes a keymap and modifies it to normalize - modifier order and properly recognize multi-stroke bindings. It - will return the keymap itself.

                - -

                The CodeMirror.keyMap object associates key maps - with names. User code and key map definitions can assign extra - properties to this object. Anywhere where a key map is expected, a - string can be given, which will be looked up in this object. It - also contains the "default" key map holding the - default bindings.

                - -

                The values of properties in key maps can be either functions of - a single argument (the CodeMirror instance), strings, or - false. Strings refer - to commands, which are described below. If - the property is set to false, CodeMirror leaves - handling of the key up to the browser. A key handler function may - return CodeMirror.Pass to indicate that it has - decided not to handle the key, and other handlers (or the default - behavior) should be given a turn.

                - -

                Keys mapped to command names that start with the - characters "go" or to functions that have a - truthy motion property (which should be used for - cursor-movement actions) will be fired even when an - extra Shift modifier is present (i.e. "Up": - "goLineUp" matches both up and shift-up). This is used to - easily implement shift-selection.

                - -

                Key maps can defer to each other by defining - a fallthrough property. This indicates that when a - key is not found in the map itself, one or more other maps should - be searched. It can hold either a single key map or an array of - key maps.

                - -

                When a key map needs to set something up when it becomes - active, or tear something down when deactivated, it can - contain attach and/or detach properties, - which should hold functions that take the editor instance and the - next or previous keymap. Note that this only works for the - top-level keymap, not for fallthrough - maps or maps added - with extraKeys - or addKeyMap.

                -
                - -
                -

                Commands

                - -

                Commands are parameter-less actions that can be performed on an - editor. Their main use is for key bindings. Commands are defined by - adding properties to the CodeMirror.commands object. - A number of common commands are defined by the library itself, - most of them used by the default key bindings. The value of a - command property must be a function of one argument (an editor - instance).

                - -

                Some of the commands below are referenced in the default - key map, but not defined by the core library. These are intended to - be defined by user code or addons.

                - -

                Commands can also be run with - the execCommand - method.

                - -
                -
                selectAllCtrl-A (PC), Cmd-A (Mac)
                -
                Select the whole content of the editor.
                - -
                singleSelectionEsc
                -
                When multiple selections are present, this deselects all but - the primary selection.
                - -
                killLineCtrl-K (Mac)
                -
                Emacs-style line killing. Deletes the part of the line after - the cursor. If that consists only of whitespace, the newline at - the end of the line is also deleted.
                - -
                deleteLineCtrl-D (PC), Cmd-D (Mac)
                -
                Deletes the whole line under the cursor, including newline at the end.
                - -
                delLineLeft
                -
                Delete the part of the line before the cursor.
                - -
                delWrappedLineLeftCmd-Backspace (Mac)
                -
                Delete the part of the line from the left side of the visual line the cursor is on to the cursor.
                - -
                delWrappedLineRightCmd-Delete (Mac)
                -
                Delete the part of the line from the cursor to the right side of the visual line the cursor is on.
                - -
                undoCtrl-Z (PC), Cmd-Z (Mac)
                -
                Undo the last change.
                - -
                redoCtrl-Y (PC), Shift-Cmd-Z (Mac), Cmd-Y (Mac)
                -
                Redo the last undone change.
                - -
                undoSelectionCtrl-U (PC), Cmd-U (Mac)
                -
                Undo the last change to the selection, or if there are no - selection-only changes at the top of the history, undo the last - change.
                - -
                redoSelectionAlt-U (PC), Shift-Cmd-U (Mac)
                -
                Redo the last change to the selection, or the last text change if - no selection changes remain.
                - -
                goDocStartCtrl-Home (PC), Cmd-Up (Mac), Cmd-Home (Mac)
                -
                Move the cursor to the start of the document.
                - -
                goDocEndCtrl-End (PC), Cmd-End (Mac), Cmd-Down (Mac)
                -
                Move the cursor to the end of the document.
                - -
                goLineStartAlt-Left (PC), Ctrl-A (Mac)
                -
                Move the cursor to the start of the line.
                - -
                goLineStartSmartHome
                -
                Move to the start of the text on the line, or if we are - already there, to the actual start of the line (including - whitespace).
                - -
                goLineEndAlt-Right (PC), Ctrl-E (Mac)
                -
                Move the cursor to the end of the line.
                - -
                goLineRightCmd-Right (Mac)
                -
                Move the cursor to the right side of the visual line it is on.
                - -
                goLineLeftCmd-Left (Mac)
                -
                Move the cursor to the left side of the visual line it is on. If - this line is wrapped, that may not be the start of the line.
                - -
                goLineLeftSmart
                -
                Move the cursor to the left side of the visual line it is - on. If that takes it to the start of the line, behave - like goLineStartSmart.
                - -
                goLineUpUp, Ctrl-P (Mac)
                -
                Move the cursor up one line.
                - -
                goLineDownDown, Ctrl-N (Mac)
                -
                Move down one line.
                - -
                goPageUpPageUp, Shift-Ctrl-V (Mac)
                -
                Move the cursor up one screen, and scroll up by the same distance.
                - -
                goPageDownPageDown, Ctrl-V (Mac)
                -
                Move the cursor down one screen, and scroll down by the same distance.
                - -
                goCharLeftLeft, Ctrl-B (Mac)
                -
                Move the cursor one character left, going to the previous line - when hitting the start of line.
                - -
                goCharRightRight, Ctrl-F (Mac)
                -
                Move the cursor one character right, going to the next line - when hitting the end of line.
                - -
                goColumnLeft
                -
                Move the cursor one character left, but don't cross line boundaries.
                - -
                goColumnRight
                -
                Move the cursor one character right, don't cross line boundaries.
                - -
                goWordLeftAlt-B (Mac)
                -
                Move the cursor to the start of the previous word.
                - -
                goWordRightAlt-F (Mac)
                -
                Move the cursor to the end of the next word.
                - -
                goGroupLeftCtrl-Left (PC), Alt-Left (Mac)
                -
                Move to the left of the group before the cursor. A group is - a stretch of word characters, a stretch of punctuation - characters, a newline, or a stretch of more than one - whitespace character.
                - -
                goGroupRightCtrl-Right (PC), Alt-Right (Mac)
                -
                Move to the right of the group after the cursor - (see above).
                - -
                delCharBeforeShift-Backspace, Ctrl-H (Mac)
                -
                Delete the character before the cursor.
                - -
                delCharAfterDelete, Ctrl-D (Mac)
                -
                Delete the character after the cursor.
                - -
                delWordBeforeAlt-Backspace (Mac)
                -
                Delete up to the start of the word before the cursor.
                - -
                delWordAfterAlt-D (Mac)
                -
                Delete up to the end of the word after the cursor.
                - -
                delGroupBeforeCtrl-Backspace (PC), Alt-Backspace (Mac)
                -
                Delete to the left of the group before the cursor.
                - -
                delGroupAfterCtrl-Delete (PC), Ctrl-Alt-Backspace (Mac), Alt-Delete (Mac)
                -
                Delete to the start of the group after the cursor.
                - -
                indentAutoShift-Tab
                -
                Auto-indent the current line or selection.
                - -
                indentMoreCtrl-] (PC), Cmd-] (Mac)
                -
                Indent the current line or selection by one indent unit.
                - -
                indentLessCtrl-[ (PC), Cmd-[ (Mac)
                -
                Dedent the current line or selection by one indent unit.
                - -
                insertTab
                -
                Insert a tab character at the cursor.
                - -
                insertSoftTab
                -
                Insert the amount of spaces that match the width a tab at - the cursor position would have.
                - -
                defaultTabTab
                -
                If something is selected, indent it by - one indent unit. If nothing is - selected, insert a tab character.
                - -
                transposeCharsCtrl-T (Mac)
                -
                Swap the characters before and after the cursor.
                - -
                newlineAndIndentEnter
                -
                Insert a newline and auto-indent the new line.
                - -
                toggleOverwriteInsert
                -
                Flip the overwrite flag.
                - -
                saveCtrl-S (PC), Cmd-S (Mac)
                -
                Not defined by the core library, only referred to in - key maps. Intended to provide an easy way for user code to define - a save command.
                - -
                findCtrl-F (PC), Cmd-F (Mac)
                -
                findNextCtrl-G (PC), Cmd-G (Mac)
                -
                findPrevShift-Ctrl-G (PC), Shift-Cmd-G (Mac)
                -
                replaceShift-Ctrl-F (PC), Cmd-Alt-F (Mac)
                -
                replaceAllShift-Ctrl-R (PC), Shift-Cmd-Alt-F (Mac)
                -
                Not defined by the core library, but defined in - the search addon (or custom client - addons).
                - -
                - -
                - -
                -

                Customized Styling

                - -

                Up to a certain extent, CodeMirror's look can be changed by - modifying style sheet files. The style sheets supplied by modes - simply provide the colors for that mode, and can be adapted in a - very straightforward way. To style the editor itself, it is - possible to alter or override the styles defined - in codemirror.css.

                - -

                Some care must be taken there, since a lot of the rules in this - file are necessary to have CodeMirror function properly. Adjusting - colors should be safe, of course, and with some care a lot of - other things can be changed as well. The CSS classes defined in - this file serve the following roles:

                - -
                -
                CodeMirror
                -
                The outer element of the editor. This should be used for the - editor width, height, borders and positioning. Can also be used - to set styles that should hold for everything inside the editor - (such as font and font size), or to set a background. Setting - this class' height style to auto will - make the editor resize to fit its - content (it is recommended to also set - the viewportMargin - option to Infinity when doing this.
                - -
                CodeMirror-focused
                -
                Whenever the editor is focused, the top element gets this - class. This is used to hide the cursor and give the selection a - different color when the editor is not focused.
                - -
                CodeMirror-gutters
                -
                This is the backdrop for all gutters. Use it to set the - default gutter background color, and optionally add a border on - the right of the gutters.
                - -
                CodeMirror-linenumbers
                -
                Use this for giving a background or width to the line number - gutter.
                - -
                CodeMirror-linenumber
                -
                Used to style the actual individual line numbers. These - won't be children of the CodeMirror-linenumbers - (plural) element, but rather will be absolutely positioned to - overlay it. Use this to set alignment and text properties for - the line numbers.
                - -
                CodeMirror-lines
                -
                The visible lines. This is where you specify vertical - padding for the editor content.
                - -
                CodeMirror-cursor
                -
                The cursor is a block element that is absolutely positioned. - You can make it look whichever way you want.
                - -
                CodeMirror-selected
                -
                The selection is represented by span elements - with this class.
                - -
                CodeMirror-matchingbracket, - CodeMirror-nonmatchingbracket
                -
                These are used to style matched (or unmatched) brackets.
                -
                - -

                If your page's style sheets do funky things to - all div or pre elements (you probably - shouldn't do that), you'll have to define rules to cancel these - effects out again for elements under the CodeMirror - class.

                - -

                Themes are also simply CSS files, which define colors for - various syntactic elements. See the files in - the theme directory.

                -
                - -
                -

                Programming API

                - -

                A lot of CodeMirror features are only available through its - API. Thus, you need to write code (or - use addons) if you want to expose them to - your users.

                - -

                Whenever points in the document are represented, the API uses - objects with line and ch properties. - Both are zero-based. CodeMirror makes sure to 'clip' any positions - passed by client code so that they fit inside the document, so you - shouldn't worry too much about sanitizing your coordinates. If you - give ch a value of null, or don't - specify it, it will be replaced with the length of the specified - line.

                - -

                Methods prefixed with doc. can, unless otherwise - specified, be called both on CodeMirror (editor) - instances and CodeMirror.Doc instances. Methods - prefixed with cm. are only available - on CodeMirror instances.

                - -

                Constructor

                - -

                Constructing an editor instance is done with - the CodeMirror(place: Element|fn(Element), - ?option: object) constructor. If the place - argument is a DOM element, the editor will be appended to it. If - it is a function, it will be called, and is expected to place the - editor into the document. options may be an element - mapping option names to values. The options - that it doesn't explicitly specify (or all options, if it is not - passed) will be taken - from CodeMirror.defaults.

                - -

                Note that the options object passed to the constructor will be - mutated when the instance's options - are changed, so you shouldn't share such - objects between instances.

                - -

                See CodeMirror.fromTextArea - for another way to construct an editor instance.

                - -

                Content manipulation methods

                - -
                -
                doc.getValue(?separator: string) → string
                -
                Get the current editor content. You can pass it an optional - argument to specify the string to be used to separate lines - (defaults to "\n").
                -
                doc.setValue(content: string)
                -
                Set the editor content.
                - -
                doc.getRange(from: {line, ch}, to: {line, ch}, ?separator: string) → string
                -
                Get the text between the given points in the editor, which - should be {line, ch} objects. An optional third - argument can be given to indicate the line separator string to - use (defaults to "\n").
                -
                doc.replaceRange(replacement: string, from: {line, ch}, to: {line, ch}, ?origin: string)
                -
                Replace the part of the document between from - and to with the given string. from - and to must be {line, ch} - objects. to can be left off to simply insert the - string at position from. When origin - is given, it will be passed on - to "change" events, and - its first letter will be used to determine whether this change - can be merged with previous history events, in the way described - for selection origins.
                - -
                doc.getLine(n: integer) → string
                -
                Get the content of line n.
                - -
                doc.lineCount() → integer
                -
                Get the number of lines in the editor.
                -
                doc.firstLine() → integer
                -
                Get the first line of the editor. This will - usually be zero but for linked sub-views, - or documents instantiated with a non-zero - first line, it might return other values.
                -
                doc.lastLine() → integer
                -
                Get the last line of the editor. This will - usually be doc.lineCount() - 1, - but for linked sub-views, - it might return other values.
                - -
                doc.getLineHandle(num: integer) → LineHandle
                -
                Fetches the line handle for the given line number.
                -
                doc.getLineNumber(handle: LineHandle) → integer
                -
                Given a line handle, returns the current position of that - line (or null when it is no longer in the - document).
                -
                doc.eachLine(f: (line: LineHandle))
                -
                doc.eachLine(start: integer, end: integer, f: (line: LineHandle))
                -
                Iterate over the whole document, or if start - and end line numbers are given, the range - from start up to (not including) end, - and call f for each line, passing the line handle. - This is a faster way to visit a range of line handlers than - calling getLineHandle - for each of them. Note that line handles have - a text property containing the line's content (as a - string).
                - -
                doc.markClean()
                -
                Set the editor content as 'clean', a flag that it will - retain until it is edited, and which will be set again when such - an edit is undone again. Useful to track whether the content - needs to be saved. This function is deprecated in favor - of changeGeneration, - which allows multiple subsystems to track different notions of - cleanness without interfering.
                -
                doc.changeGeneration(?closeEvent: boolean) → integer
                -
                Returns a number that can later be passed - to isClean to test whether - any edits were made (and not undone) in the meantime. - If closeEvent is true, the current history event - will be ‘closed’, meaning it can't be combined with further - changes (rapid typing or deleting events are typically - combined).
                -
                doc.isClean(?generation: integer) → boolean
                -
                Returns whether the document is currently clean — not - modified since initialization or the last call - to markClean if no - argument is passed, or since the matching call - to changeGeneration - if a generation value is given.
                -
                - -

                Cursor and selection methods

                - -
                -
                doc.getSelection(?lineSep: string) → string
                -
                Get the currently selected code. Optionally pass a line - separator to put between the lines in the output. When multiple - selections are present, they are concatenated with instances - of lineSep in between.
                -
                doc.getSelections(?lineSep: string) → string
                -
                Returns an array containing a string for each selection, - representing the content of the selections.
                - -
                doc.replaceSelection(replacement: string, ?select: string)
                -
                Replace the selection(s) with the given string. By default, - the new selection ends up after the inserted text. The - optional select argument can be used to change - this—passing "around" will cause the new text to be - selected, passing "start" will collapse the - selection to the start of the inserted text.
                -
                doc.replaceSelections(replacements: array<string>, ?select: string)
                -
                The length of the given array should be the same as the - number of active selections. Replaces the content of the - selections with the strings in the array. - The select argument works the same as - in replaceSelection.
                - -
                doc.getCursor(?start: string) → {line, ch}
                -
                Retrieve one end of the primary - selection. start is a an optional string indicating - which end of the selection to return. It may - be "from", "to", "head" - (the side of the selection that moves when you press - shift+arrow), or "anchor" (the fixed side of the - selection). Omitting the argument is the same as - passing "head". A {line, ch} object - will be returned.
                -
                doc.listSelections() → array<{anchor, head}>
                -
                Retrieves a list of all current selections. These will - always be sorted, and never overlap (overlapping selections are - merged). Each object in the array contains anchor - and head properties referring to {line, - ch} objects.
                - -
                doc.somethingSelected() → boolean
                -
                Return true if any text is selected.
                -
                doc.setCursor(pos: {line, ch}|number, ?ch: number, ?options: object)
                -
                Set the cursor position. You can either pass a - single {line, ch} object, or the line and the - character as two separate parameters. Will replace all - selections with a single, empty selection at the given position. - The supported options are the same as for setSelection.
                - -
                doc.setSelection(anchor: {line, ch}, ?head: {line, ch}, ?options: object)
                -
                Set a single selection range. anchor - and head should be {line, ch} - objects. head defaults to anchor when - not given. These options are supported: -
                -
                scroll: boolean
                -
                Determines whether the selection head should be scrolled - into view. Defaults to true.
                -
                origin: string
                -
                Detemines whether the selection history event may be - merged with the previous one. When an origin starts with the - character +, and the last recorded selection had - the same origin and was similar (close - in time, both - collapsed or both non-collapsed), the new one will replace the - old one. When it starts with *, it will always - replace the previous event (if that had the same origin). - Built-in motion uses the "+move" origin.
                -
                bias: number
                -
                Determine the direction into which the selection endpoints - should be adjusted when they fall inside - an atomic range. Can be either -1 - (backward) or 1 (forward). When not given, the bias will be - based on the relative position of the old selection—the editor - will try to move further away from that, to prevent getting - stuck.
                -
                - -
                doc.setSelections(ranges: array<{anchor, head}>, ?primary: integer, ?options: object)
                -
                Sets a new set of selections. There must be at least one - selection in the given array. When primary is a - number, it determines which selection is the primary one. When - it is not given, the primary index is taken from the previous - selection, or set to the last range if the previous selection - had less ranges than the new one. Supports the same options - as setSelection.
                -
                doc.addSelection(anchor: {line, ch}, ?head: {line, ch})
                -
                Adds a new selection to the existing set of selections, and - makes it the primary selection.
                - -
                doc.extendSelection(from: {line, ch}, ?to: {line, ch}, ?options: object)
                -
                Similar - to setSelection, but - will, if shift is held or - the extending flag is set, move the - head of the selection while leaving the anchor at its current - place. to is optional, and can be passed to ensure - a region (for example a word or paragraph) will end up selected - (in addition to whatever lies between that region and the - current anchor). When multiple selections are present, all but - the primary selection will be dropped by this method. - Supports the same options as setSelection.
                -
                doc.extendSelections(heads: array<{line, ch}>, ?options: object)
                -
                An equivalent - of extendSelection - that acts on all selections at once.
                -
                doc.extendSelectionsBy(f: function(range: {anchor, head}) → {anchor, head}), ?options: object)
                -
                Applies the given function to all existing selections, and - calls extendSelections - on the result.
                -
                doc.setExtending(value: boolean)
                -
                Sets or clears the 'extending' flag, which acts similar to - the shift key, in that it will cause cursor movement and calls - to extendSelection - to leave the selection anchor in place.
                -
                doc.getExtending() → boolean
                -
                Get the value of the 'extending' flag.
                - -
                cm.hasFocus() → boolean
                -
                Tells you whether the editor currently has focus.
                - -
                cm.findPosH(start: {line, ch}, amount: integer, unit: string, visually: boolean) → {line, ch, ?hitSide: boolean}
                -
                Used to find the target position for horizontal cursor - motion. start is a {line, ch} - object, amount an integer (may be negative), - and unit one of the - string "char", "column", - or "word". Will return a position that is produced - by moving amount times the distance specified - by unit. When visually is true, motion - in right-to-left text will be visual rather than logical. When - the motion was clipped by hitting the end or start of the - document, the returned value will have a hitSide - property set to true.
                -
                cm.findPosV(start: {line, ch}, amount: integer, unit: string) → {line, ch, ?hitSide: boolean}
                -
                Similar to findPosH, - but used for vertical motion. unit may - be "line" or "page". The other - arguments and the returned value have the same interpretation as - they have in findPosH.
                - -
                cm.findWordAt(pos: {line, ch}) → {anchor: {line, ch}, head: {line, ch}}
                -
                Returns the start and end of the 'word' (the stretch of - letters, whitespace, or punctuation) at the given position.
                -
                - -

                Configuration methods

                - -
                -
                cm.setOption(option: string, value: any)
                -
                Change the configuration of the editor. option - should the name of an option, - and value should be a valid value for that - option.
                -
                cm.getOption(option: string) → any
                -
                Retrieves the current value of the given option for this - editor instance.
                - -
                cm.addKeyMap(map: object, bottom: boolean)
                -
                Attach an additional key map to the - editor. This is mostly useful for addons that need to register - some key handlers without trampling on - the extraKeys - option. Maps added in this way have a higher precedence than - the extraKeys - and keyMap options, - and between them, the maps added earlier have a lower precedence - than those added later, unless the bottom argument - was passed, in which case they end up below other key maps added - with this method.
                -
                cm.removeKeyMap(map: object)
                -
                Disable a keymap added - with addKeyMap. Either - pass in the key map object itself, or a string, which will be - compared against the name property of the active - key maps.
                - -
                cm.addOverlay(mode: string|object, ?options: object)
                -
                Enable a highlighting overlay. This is a stateless mini-mode - that can be used to add extra highlighting. For example, - the search addon uses it to - highlight the term that's currently being - searched. mode can be a mode - spec or a mode object (an object with - a token method). - The options parameter is optional. If given, it - should be an object. Currently, only the opaque - option is recognized. This defaults to off, but can be given to - allow the overlay styling, when not null, to - override the styling of the base mode entirely, instead of the - two being applied together.
                -
                cm.removeOverlay(mode: string|object)
                -
                Pass this the exact value passed for the mode - parameter to addOverlay, - or a string that corresponds to the name propery of - that value, to remove an overlay again.
                - -
                cm.on(type: string, func: (...args))
                -
                Register an event handler for the given event type (a - string) on the editor instance. There is also - a CodeMirror.on(object, type, func) version - that allows registering of events on any object.
                -
                cm.off(type: string, func: (...args))
                -
                Remove an event handler on the editor instance. An - equivalent CodeMirror.off(object, type, - func) also exists.
                -
                - -

                Document management methods

                - -

                Each editor is associated with an instance - of CodeMirror.Doc, its document. A document - represents the editor content, plus a selection, an undo history, - and a mode. A document can only be - associated with a single editor at a time. You can create new - documents by calling the CodeMirror.Doc(text, mode, - firstLineNumber) constructor. The last two arguments are - optional and can be used to set a mode for the document and make - it start at a line number other than 0, respectively.

                - -
                -
                cm.getDoc() → Doc
                -
                Retrieve the currently active document from an editor.
                -
                doc.getEditor() → CodeMirror
                -
                Retrieve the editor associated with a document. May - return null.
                - -
                cm.swapDoc(doc: CodeMirror.Doc) → Doc
                -
                Attach a new document to the editor. Returns the old - document, which is now no longer associated with an editor.
                - -
                doc.copy(copyHistory: boolean) → Doc
                -
                Create an identical copy of the given doc. - When copyHistory is true, the history will also be - copied. Can not be called directly on an editor.
                - -
                doc.linkedDoc(options: object) → Doc
                -
                Create a new document that's linked to the target document. - Linked documents will stay in sync (changes to one are also - applied to the other) until unlinked. - These are the options that are supported: -
                -
                sharedHist: boolean
                -
                When turned on, the linked copy will share an undo - history with the original. Thus, something done in one of - the two can be undone in the other, and vice versa.
                -
                from: integer
                -
                to: integer
                -
                Can be given to make the new document a subview of the - original. Subviews only show a given range of lines. Note - that line coordinates inside the subview will be consistent - with those of the parent, so that for example a subview - starting at line 10 will refer to its first line as line 10, - not 0.
                -
                mode: string|object
                -
                By default, the new document inherits the mode of the - parent. This option can be set to - a mode spec to give it a - different mode.
                -
                -
                doc.unlinkDoc(doc: CodeMirror.Doc)
                -
                Break the link between two documents. After calling this, - changes will no longer propagate between the documents, and, if - they had a shared history, the history will become - separate.
                -
                doc.iterLinkedDocs(function: (doc: CodeMirror.Doc, sharedHist: boolean))
                -
                Will call the given function for all documents linked to the - target document. It will be passed two arguments, the linked document - and a boolean indicating whether that document shares history - with the target.
                -
                - -

                History-related methods

                - -
                -
                doc.undo()
                -
                Undo one edit (if any undo events are stored).
                -
                doc.redo()
                -
                Redo one undone edit.
                - -
                doc.undoSelection()
                -
                Undo one edit or selection change.
                -
                doc.redoSelection()
                -
                Redo one undone edit or selection change.
                - -
                doc.historySize() → {undo: integer, redo: integer}
                -
                Returns an object with {undo, redo} properties, - both of which hold integers, indicating the amount of stored - undo and redo operations.
                -
                doc.clearHistory()
                -
                Clears the editor's undo history.
                -
                doc.getHistory() → object
                -
                Get a (JSON-serializeable) representation of the undo history.
                -
                doc.setHistory(history: object)
                -
                Replace the editor's undo history with the one provided, - which must be a value as returned - by getHistory. Note that - this will have entirely undefined results if the editor content - isn't also the same as it was when getHistory was - called.
                -
                - -

                Text-marking methods

                - -
                -
                doc.markText(from: {line, ch}, to: {line, ch}, ?options: object) → TextMarker
                -
                Can be used to mark a range of text with a specific CSS - class name. from and to should - be {line, ch} objects. The options - parameter is optional. When given, it should be an object that - may contain the following configuration options: -
                -
                className: string
                -
                Assigns a CSS class to the marked stretch of text.
                -
                inclusiveLeft: boolean
                -
                Determines whether - text inserted on the left of the marker will end up inside - or outside of it.
                -
                inclusiveRight: boolean
                -
                Like inclusiveLeft, - but for the right side.
                -
                atomic: boolean
                -
                Atomic ranges act as a single unit when cursor movement is - concerned—i.e. it is impossible to place the cursor inside of - them. In atomic ranges, inclusiveLeft - and inclusiveRight have a different meaning—they - will prevent the cursor from being placed respectively - directly before and directly after the range.
                -
                collapsed: boolean
                -
                Collapsed ranges do not show up in the display. Setting a - range to be collapsed will automatically make it atomic.
                -
                clearOnEnter: boolean
                -
                When enabled, will cause the mark to clear itself whenever - the cursor enters its range. This is mostly useful for - text-replacement widgets that need to 'snap open' when the - user tries to edit them. The - "clear" event - fired on the range handle can be used to be notified when this - happens.
                -
                clearWhenEmpty: boolean
                -
                Determines whether the mark is automatically cleared when - it becomes empty. Default is true.
                -
                replacedWith: Element
                -
                Use a given node to display this range. Implies both - collapsed and atomic. The given DOM node must be an - inline element (as opposed to a block element).
                -
                handleMouseEvents: boolean
                -
                When replacedWith is given, this determines - whether the editor will capture mouse and drag events - occurring in this widget. Default is false—the events will be - left alone for the default browser handler, or specific - handlers on the widget, to capture.
                -
                readOnly: boolean
                -
                A read-only span can, as long as it is not cleared, not be - modified except by - calling setValue to reset - the whole document. Note: adding a read-only span - currently clears the undo history of the editor, because - existing undo events being partially nullified by read-only - spans would corrupt the history (in the current - implementation).
                -
                addToHistory: boolean
                -
                When set to true (default is false), adding this marker - will create an event in the undo history that can be - individually undone (clearing the marker).
                -
                startStyle: string
                Can be used to specify - an extra CSS class to be applied to the leftmost span that - is part of the marker.
                -
                endStyle: string
                Equivalent - to startStyle, but for the rightmost span.
                -
                css: string
                -
                A string of CSS to be applied to the covered text. For example "color: #fe3".
                -
                title: - string
                When given, will give the nodes created - for this span a HTML title attribute with the - given value.
                -
                shared: boolean
                When the - target document is linked to other - documents, you can set shared to true to make the - marker appear in all documents. By default, a marker appears - only in its target document.
                -
                - The method will return an object that represents the marker - (with constructor CodeMirror.TextMarker), which - exposes three methods: - clear(), to remove the mark, - find(), which returns - a {from, to} object (both holding document - positions), indicating the current position of the marked range, - or undefined if the marker is no longer in the - document, and finally changed(), - which you can call if you've done something that might change - the size of the marker (for example changing the content of - a replacedWith - node), and want to cheaply update the display.
                - -
                doc.setBookmark(pos: {line, ch}, ?options: object) → TextMarker
                -
                Inserts a bookmark, a handle that follows the text around it - as it is being edited, at the given position. A bookmark has two - methods find() and clear(). The first - returns the current position of the bookmark, if it is still in - the document, and the second explicitly removes the bookmark. - The options argument is optional. If given, the following - properties are recognized: -
                -
                widget: Element
                Can be used to display a DOM - node at the current location of the bookmark (analogous to - the replacedWith - option to markText).
                -
                insertLeft: boolean
                By default, text typed - when the cursor is on top of the bookmark will end up to the - right of the bookmark. Set this option to true to make it go - to the left instead.
                -
                shared: boolean
                See - the corresponding option - to markText.
                -
                handleMouseEvents: boolean
                -
                As with markText, - this determines whether mouse events on the widget inserted - for this bookmark are handled by CodeMirror. The default is - false.
                -
                - -
                doc.findMarks(from: {line, ch}, to: {line, ch}) → array<TextMarker>
                -
                Returns an array of all the bookmarks and marked ranges - found between the given positions.
                -
                doc.findMarksAt(pos: {line, ch}) → array<TextMarker>
                -
                Returns an array of all the bookmarks and marked ranges - present at the given position.
                -
                doc.getAllMarks() → array<TextMarker>
                -
                Returns an array containing all marked ranges in the document.
                -
                - -

                Widget, gutter, and decoration methods

                - -
                -
                cm.setGutterMarker(line: integer|LineHandle, gutterID: string, value: Element) → LineHandle
                -
                Sets the gutter marker for the given gutter (identified by - its CSS class, see - the gutters option) - to the given value. Value can be either null, to - clear the marker, or a DOM element, to set it. The DOM element - will be shown in the specified gutter next to the specified - line.
                - -
                cm.clearGutter(gutterID: string)
                -
                Remove all gutter markers in - the gutter with the given ID.
                - -
                doc.addLineClass(line: integer|LineHandle, where: string, class: string) → LineHandle
                -
                Set a CSS class name for the given line. line - can be a number or a line handle. where determines - to which element this class should be applied, can can be one - of "text" (the text element, which lies in front of - the selection), "background" (a background element - that will be behind the selection), "gutter" (the - line's gutter space), or "wrap" (the wrapper node - that wraps all of the line's elements, including gutter - elements). class should be the name of the class to - apply.
                - -
                doc.removeLineClass(line: integer|LineHandle, where: string, class: string) → LineHandle
                -
                Remove a CSS class from a line. line can be a - line handle or number. where should be one - of "text", "background", - or "wrap" - (see addLineClass). class - can be left off to remove all classes for the specified node, or - be a string to remove only a specific class.
                - -
                cm.lineInfo(line: integer|LineHandle) → object
                -
                Returns the line number, text content, and marker status of - the given line, which can be either a number or a line handle. - The returned object has the structure {line, handle, text, - gutterMarkers, textClass, bgClass, wrapClass, widgets}, - where gutterMarkers is an object mapping gutter IDs - to marker elements, and widgets is an array - of line widgets attached to this - line, and the various class properties refer to classes added - with addLineClass.
                - -
                cm.addWidget(pos: {line, ch}, node: Element, scrollIntoView: boolean)
                -
                Puts node, which should be an absolutely - positioned DOM node, into the editor, positioned right below the - given {line, ch} position. - When scrollIntoView is true, the editor will ensure - that the entire node is visible (if possible). To remove the - widget again, simply use DOM methods (move it somewhere else, or - call removeChild on its parent).
                - -
                doc.addLineWidget(line: integer|LineHandle, node: Element, ?options: object) → LineWidget
                -
                Adds a line widget, an element shown below a line, spanning - the whole of the editor's width, and moving the lines below it - downwards. line should be either an integer or a - line handle, and node should be a DOM node, which - will be displayed below the given line. options, - when given, should be an object that configures the behavior of - the widget. The following options are supported (all default to - false): -
                -
                coverGutter: boolean
                -
                Whether the widget should cover the gutter.
                -
                noHScroll: boolean
                -
                Whether the widget should stay fixed in the face of - horizontal scrolling.
                -
                above: boolean
                -
                Causes the widget to be placed above instead of below - the text of the line.
                -
                handleMouseEvents: boolean
                -
                Determines whether the editor will capture mouse and - drag events occurring in this widget. Default is false—the - events will be left alone for the default browser handler, - or specific handlers on the widget, to capture.
                -
                insertAt: integer
                -
                By default, the widget is added below other widgets for - the line. This option can be used to place it at a different - position (zero for the top, N to put it after the Nth other - widget). Note that this only has effect once, when the - widget is created. -
                - Note that the widget node will become a descendant of nodes with - CodeMirror-specific CSS classes, and those classes might in some - cases affect it. This method returns an object that represents - the widget placement. It'll have a line property - pointing at the line handle that it is associated with, and the following methods: -
                -
                clear()
                Removes the widget.
                -
                changed()
                Call - this if you made some change to the widget's DOM node that - might affect its height. It'll force CodeMirror to update - the height of the line that contains the widget.
                -
                -
                -
                - -

                Sizing, scrolling and positioning methods

                - -
                -
                cm.setSize(width: number|string, height: number|string)
                -
                Programatically set the size of the editor (overriding the - applicable CSS - rules). width and height - can be either numbers (interpreted as pixels) or CSS units - ("100%", for example). You can - pass null for either of them to indicate that that - dimension should not be changed.
                - -
                cm.scrollTo(x: number, y: number)
                -
                Scroll the editor to a given (pixel) position. Both - arguments may be left as null - or undefined to have no effect.
                -
                cm.getScrollInfo() → {left, top, width, height, clientWidth, clientHeight}
                -
                Get an {left, top, width, height, clientWidth, - clientHeight} object that represents the current scroll - position, the size of the scrollable area, and the size of the - visible area (minus scrollbars).
                -
                cm.scrollIntoView(what: {line, ch}|{left, top, right, bottom}|{from, to}|null, ?margin: number)
                -
                Scrolls the given position into view. what may - be null to scroll the cursor into view, - a {line, ch} position to scroll a character into - view, a {left, top, right, bottom} pixel range (in - editor-local coordinates), or a range {from, to} - containing either two character positions or two pixel squares. - The margin parameter is optional. When given, it - indicates the amount of vertical pixels around the given area - that should be made visible as well.
                - -
                cm.cursorCoords(where: boolean|{line, ch}, mode: string) → {left, top, bottom}
                -
                Returns an {left, top, bottom} object - containing the coordinates of the cursor position. - If mode is "local", they will be - relative to the top-left corner of the editable document. If it - is "page" or not given, they are relative to the - top-left corner of the page. If mode - is "window", the coordinates are relative to the - top-left corner of the currently visible (scrolled) - window. where can be a boolean indicating whether - you want the start (true) or the end - (false) of the selection, or, if a {line, - ch} object is given, it specifies the precise position at - which you want to measure.
                -
                cm.charCoords(pos: {line, ch}, ?mode: string) → {left, right, top, bottom}
                -
                Returns the position and dimensions of an arbitrary - character. pos should be a {line, ch} - object. This differs from cursorCoords in that - it'll give the size of the whole character, rather than just the - position that the cursor would have when it would sit at that - position.
                -
                cm.coordsChar(object: {left, top}, ?mode: string) → {line, ch}
                -
                Given an {left, top} object, returns - the {line, ch} position that corresponds to it. The - optional mode parameter determines relative to what - the coordinates are interpreted. It may - be "window", "page" (the default), - or "local".
                -
                cm.lineAtHeight(height: number, ?mode: string) → number
                -
                Computes the line at the given pixel - height. mode can be one of the same strings - that coordsChar - accepts.
                -
                cm.heightAtLine(line: integer|LineHandle, ?mode: string) → number
                -
                Computes the height of the top of a line, in the coordinate - system specified by mode - (see coordsChar), which - defaults to "page". When a line below the bottom of - the document is specified, the returned value is the bottom of - the last line in the document.
                -
                cm.defaultTextHeight() → number
                -
                Returns the line height of the default font for the editor.
                -
                cm.defaultCharWidth() → number
                -
                Returns the pixel width of an 'x' in the default font for - the editor. (Note that for non-monospace fonts, this is mostly - useless, and even for monospace fonts, non-ascii characters - might have a different width).
                - -
                cm.getViewport() → {from: number, to: number}
                -
                Returns a {from, to} object indicating the - start (inclusive) and end (exclusive) of the currently rendered - part of the document. In big documents, when most content is - scrolled out of view, CodeMirror will only render the visible - part, and a margin around it. See also - the viewportChange - event.
                - -
                cm.refresh()
                -
                If your code does something to change the size of the editor - element (window resizes are already listened for), or unhides - it, you should probably follow up by calling this method to - ensure CodeMirror is still looking as intended.
                -
                - -

                Mode, state, and token-related methods

                - -

                When writing language-aware functionality, it can often be - useful to hook into the knowledge that the CodeMirror language - mode has. See the section on modes for a - more detailed description of how these work.

                - -
                -
                doc.getMode() → object
                -
                Gets the (outer) mode object for the editor. Note that this - is distinct from getOption("mode"), which gives you - the mode specification, rather than the resolved, instantiated - mode object.
                - -
                cm.getModeAt(pos: {line, ch}) → object
                -
                Gets the inner mode at a given position. This will return - the same as getMode for - simple modes, but will return an inner mode for nesting modes - (such as htmlmixed).
                - -
                cm.getTokenAt(pos: {line, ch}, ?precise: boolean) → object
                -
                Retrieves information about the token the current mode found - before the given position (a {line, ch} object). The - returned object has the following properties: -
                -
                start
                The character (on the given line) at which the token starts.
                -
                end
                The character at which the token ends.
                -
                string
                The token's string.
                -
                type
                The token type the mode assigned - to the token, such as "keyword" - or "comment" (may also be null).
                -
                state
                The mode's state at the end of this token.
                -
                - If precise is true, the token will be guaranteed to be accurate based on recent edits. If false or - not specified, the token will use cached state information, which will be faster but might not be accurate if - edits were recently made and highlighting has not yet completed. -
                - -
                cm.getLineTokens(line: integer, ?precise: boolean) → array<{start, end, string, type, state}>
                -
                This is similar - to getTokenAt, but - collects all tokens for a given line into an array. It is much - cheaper than repeatedly calling getTokenAt, which - re-parses the part of the line before the token for every call.
                - -
                cm.getTokenTypeAt(pos: {line, ch}) → string
                -
                This is a (much) cheaper version - of getTokenAt useful for - when you just need the type of the token at a given position, - and no other information. Will return null for - unstyled tokens, and a string, potentially containing multiple - space-separated style names, otherwise.
                - -
                cm.getHelpers(pos: {line, ch}, type: string) → array<helper>
                -
                Fetch the set of applicable helper values for the given - position. Helpers provide a way to look up functionality - appropriate for a mode. The type argument provides - the helper namespace (see - registerHelper), in - which the values will be looked up. When the mode itself has a - property that corresponds to the type, that - directly determines the keys that are used to look up the helper - values (it may be either a single string, or an array of - strings). Failing that, the mode's helperType - property and finally the mode's name are used.
                -
                For example, the JavaScript mode has a - property fold containing "brace". When - the brace-fold addon is loaded, that defines a - helper named brace in the fold - namespace. This is then used by - the foldcode addon to - figure out that it can use that folding function to fold - JavaScript code.
                -
                When any 'global' - helpers are defined for the given namespace, their predicates - are called on the current mode and editor, and all those that - declare they are applicable will also be added to the array that - is returned.
                - -
                cm.getHelper(pos: {line, ch}, type: string) → helper
                -
                Returns the first applicable helper value. - See getHelpers.
                - -
                cm.getStateAfter(?line: integer, ?precise: boolean) → object
                -
                Returns the mode's parser state, if any, at the end of the - given line number. If no line number is given, the state at the - end of the document is returned. This can be useful for storing - parsing errors in the state, or getting other kinds of - contextual information for a line. precise is defined - as in getTokenAt().
                -
                - -

                Miscellaneous methods

                - -
                -
                cm.operation(func: () → any) → any
                -
                CodeMirror internally buffers changes and only updates its - DOM structure after it has finished performing some operation. - If you need to perform a lot of operations on a CodeMirror - instance, you can call this method with a function argument. It - will call the function, buffering up all changes, and only doing - the expensive update after the function returns. This can be a - lot faster. The return value from this method will be the return - value of your function.
                - -
                cm.indentLine(line: integer, ?dir: string|integer)
                -
                Adjust the indentation of the given line. The second - argument (which defaults to "smart") may be one of: -
                -
                "prev"
                -
                Base indentation on the indentation of the previous line.
                -
                "smart"
                -
                Use the mode's smart indentation if available, behave - like "prev" otherwise.
                -
                "add"
                -
                Increase the indentation of the line by - one indent unit.
                -
                "subtract"
                -
                Reduce the indentation of the line.
                -
                <integer>
                -
                Add (positive number) or reduce (negative number) the - indentation by the given amount of spaces.
                -
                - -
                cm.toggleOverwrite(?value: bool)
                -
                Switches between overwrite and normal insert mode (when not - given an argument), or sets the overwrite mode to a specific - state (when given an argument).
                - -
                doc.lineSeparator()
                -
                Returns the preferred line separator string for this - document, as per the option - by the same name. When that option is null, the - string "\n" is returned.
                - -
                cm.execCommand(name: string)
                -
                Runs the command with the given name on the editor.
                - -
                doc.posFromIndex(index: integer) → {line, ch}
                -
                Calculates and returns a {line, ch} object for a - zero-based index who's value is relative to the start of the - editor's text. If the index is out of range of the text then - the returned object is clipped to start or end of the text - respectively.
                -
                doc.indexFromPos(object: {line, ch}) → integer
                -
                The reverse of posFromIndex.
                - -
                cm.focus()
                -
                Give the editor focus.
                - -
                cm.getInputField() → Element
                -
                Returns the input field for the editor. Will be a textarea - or an editable div, depending on the value of - the inputStyle - option.
                -
                cm.getWrapperElement() → Element
                -
                Returns the DOM node that represents the editor, and - controls its size. Remove this from your tree to delete an - editor instance.
                -
                cm.getScrollerElement() → Element
                -
                Returns the DOM node that is responsible for the scrolling - of the editor.
                -
                cm.getGutterElement() → Element
                -
                Fetches the DOM node that contains the editor gutters.
                -
                - -

                Static properties

                -

                The CodeMirror object itself provides - several useful properties.

                - -
                -
                CodeMirror.version: string
                -
                It contains a string that indicates the version of the - library. This is a triple of - integers "major.minor.patch", - where patch is zero for releases, and something - else (usually one) for dev snapshots.
                - -
                CodeMirror.fromTextArea(textArea: TextAreaElement, ?config: object)
                -
                - The method provides another way to initialize an editor. It - takes a textarea DOM node as first argument and an optional - configuration object as second. It will replace the textarea - with a CodeMirror instance, and wire up the form of that - textarea (if any) to make sure the editor contents are put - into the textarea when the form is submitted. The text in the - textarea will provide the content for the editor. A CodeMirror - instance created this way has three additional methods: -
                -
                cm.save()
                -
                Copy the content of the editor into the textarea.
                - -
                cm.toTextArea()
                -
                Remove the editor, and restore the original textarea (with - the editor's current content).
                - -
                cm.getTextArea() → TextAreaElement
                -
                Returns the textarea that the instance was based on.
                -
                -
                - -
                CodeMirror.defaults: object
                -
                An object containing default values for - all options. You can assign to its - properties to modify defaults (though this won't affect editors - that have already been created).
                - -
                CodeMirror.defineExtension(name: string, value: any)
                -
                If you want to define extra methods in terms of the - CodeMirror API, it is possible to - use defineExtension. This will cause the given - value (usually a method) to be added to all CodeMirror instances - created from then on.
                - -
                CodeMirror.defineDocExtension(name: string, value: any)
                -
                Like defineExtension, - but the method will be added to the interface - for Doc objects instead.
                - -
                CodeMirror.defineOption(name: string, - default: any, updateFunc: function)
                -
                Similarly, defineOption can be used to define new options for - CodeMirror. The updateFunc will be called with the - editor instance and the new value when an editor is initialized, - and whenever the option is modified - through setOption.
                - -
                CodeMirror.defineInitHook(func: function)
                -
                If your extention just needs to run some - code whenever a CodeMirror instance is initialized, - use CodeMirror.defineInitHook. Give it a function as - its only argument, and from then on, that function will be called - (with the instance as argument) whenever a new CodeMirror instance - is initialized.
                - -
                CodeMirror.registerHelper(type: string, name: string, value: helper)
                -
                Registers a helper value with the given name in - the given namespace (type). This is used to define - functionality that may be looked up by mode. Will create (if it - doesn't already exist) a property on the CodeMirror - object for the given type, pointing to an object - that maps names to values. I.e. after - doing CodeMirror.registerHelper("hint", "foo", - myFoo), the value CodeMirror.hint.foo will - point to myFoo.
                - -
                CodeMirror.registerGlobalHelper(type: string, name: string, predicate: fn(mode, CodeMirror), value: helper)
                -
                Acts - like registerHelper, - but also registers this helper as 'global', meaning that it will - be included by getHelpers - whenever the given predicate returns true when - called with the local mode and editor.
                - -
                CodeMirror.Pos(line: integer, ?ch: integer)
                -
                A constructor for the {line, ch} objects that - are used to represent positions in editor documents.
                - -
                CodeMirror.changeEnd(change: object) → {line, ch}
                -
                Utility function that computes an end position from a change - (an object with from, to, - and text properties, as passed to - various event handlers). The - returned position will be the end of the changed - range, after the change is applied.
                -
                -
                - -
                -

                Addons

                - -

                The addon directory in the distribution contains a - number of reusable components that implement extra editor - functionality (on top of extension functions - like defineOption, defineExtension, - and registerHelper). In - brief, they are:

                - -
                -
                dialog/dialog.js
                -
                Provides a very simple way to query users for text input. - Adds the openDialog(template, callback, options) → - closeFunction method to CodeMirror instances, - which can be called with an HTML fragment or a detached DOM - node that provides the prompt (should include an input - or button tag), and a callback function that is called - when the user presses enter. It returns a function closeFunction - which, if called, will close the dialog immediately. - openDialog takes the following options: -
                -
                closeOnEnter:
                -
                If true, the dialog will be closed when the user presses - enter in the input. Defaults to true.
                -
                onKeyDown:
                -
                An event handler of the signature (event, value, closeFunction) - that will be called whenever keydown fires in the - dialog's input. If your callback returns true, - the dialog will not do any further processing of the event.
                -
                onKeyUp:
                -
                Same as onKeyDown but for the - keyup event.
                -
                onInput:
                -
                Same as onKeyDown but for the - input event.
                -
                onClose:
                -
                A callback of the signature (dialogInstance) - that will be called after the dialog has been closed and - removed from the DOM. No return value.
                -
                - -

                Also adds an openNotification(template, options) → - closeFunction function that simply shows an HTML - fragment as a notification at the top of the editor. It takes a - single option: duration, the amount of time after - which the notification will be automatically closed. If - duration is zero, the dialog will not be closed automatically.

                - -

                Depends on addon/dialog/dialog.css.

                - -
                search/searchcursor.js
                -
                Adds the getSearchCursor(query, start, caseFold) → - cursor method to CodeMirror instances, which can be used - to implement search/replace functionality. query - can be a regular expression or a string (only strings will match - across lines—if they contain newlines). start - provides the starting position of the search. It can be - a {line, ch} object, or can be left off to default - to the start of the document. caseFold is only - relevant when matching a string. It will cause the search to be - case-insensitive. A search cursor has the following methods: -
                -
                findNext() → boolean
                -
                findPrevious() → boolean
                -
                Search forward or backward from the current position. - The return value indicates whether a match was found. If - matching a regular expression, the return value will be the - array returned by the match method, in case you - want to extract matched groups.
                -
                from() → {line, ch}
                -
                to() → {line, ch}
                -
                These are only valid when the last call - to findNext or findPrevious did - not return false. They will return {line, ch} - objects pointing at the start and end of the match.
                -
                replace(text: string, ?origin: string)
                -
                Replaces the currently found match with the given text - and adjusts the cursor position to reflect the - replacement.
                -
                - - -
                Implements the search commands. CodeMirror has keys bound to - these by default, but will not do anything with them unless an - implementation is provided. Depends - on searchcursor.js, and will make use - of openDialog when - available to make prompting for search queries less ugly.
                - -
                search/matchesonscrollbar.js
                -
                Adds a showMatchesOnScrollbar method to editor - instances, which should be given a query (string or regular - expression), optionally a case-fold flag (only applicable for - strings), and optionally a class name (defaults - to CodeMirror-search-match) as arguments. When - called, matches of the given query will be displayed on the - editor's vertical scrollbar. The method returns an object with - a clear method that can be called to remove the - matches. Depends on - the annotatescrollbar - addon, and - the matchesonscrollbar.css - file provides a default (transparent yellowish) definition of - the CSS class applied to the matches. Note that the matches are - only perfectly aligned if your scrollbar does not have buttons - at the top and bottom. You can use - the simplescrollbar - addon to make sure of this. If this addon is loaded, - the search addon will - automatically use it.
                - -
                edit/matchbrackets.js
                -
                Defines an option matchBrackets which, when set - to true, causes matching brackets to be highlighted whenever the - cursor is next to them. It also adds a - method matchBrackets that forces this to happen - once, and a method findMatchingBracket that can be - used to run the bracket-finding algorithm that this uses - internally.
                - -
                edit/closebrackets.js
                -
                Defines an option autoCloseBrackets that will - auto-close brackets and quotes when typed. By default, it'll - auto-close ()[]{}''"", but you can pass it a string - similar to that (containing pairs of matching characters), or an - object with pairs and - optionally explode properties to customize - it. explode should be a similar string that gives - the pairs of characters that, when enter is pressed between - them, should have the second character also moved to its own - line. Demo here.
                - -
                edit/matchtags.js
                -
                Defines an option matchTags that, when enabled, - will cause the tags around the cursor to be highlighted (using - the CodeMirror-matchingtag class). Also - defines - a command toMatchingTag, - which you can bind a key to in order to jump to the tag mathing - the one under the cursor. Depends on - the addon/fold/xml-fold.js - addon. Demo here.
                - -
                edit/trailingspace.js
                -
                Adds an option showTrailingSpace which, when - enabled, adds the CSS class cm-trailingspace to - stretches of whitespace at the end of lines. - The demo has a nice - squiggly underline style for this class.
                - -
                edit/closetag.js
                -
                Defines an autoCloseTags option that will - auto-close XML tags when '>' or '/' - is typed, and - a closeTag command that - closes the nearest open tag. Depends on - the fold/xml-fold.js addon. See - the demo.
                - -
                edit/continuelist.js
                -
                Markdown specific. Defines - a "newlineAndIndentContinueMarkdownList" command - command that can be bound to enter to automatically - insert the leading characters for continuing a list. See - the Markdown mode - demo.
                - -
                comment/comment.js
                -
                Addon for commenting and uncommenting code. Adds three - methods to CodeMirror instances: -
                -
                lineComment(from: {line, ch}, to: {line, ch}, ?options: object)
                -
                Set the lines in the given range to be line comments. Will - fall back to blockComment when no line comment - style is defined for the mode.
                -
                blockComment(from: {line, ch}, to: {line, ch}, ?options: object)
                -
                Wrap the code in the given range in a block comment. Will - fall back to lineComment when no block comment - style is defined for the mode.
                -
                uncomment(from: {line, ch}, to: {line, ch}, ?options: object) → boolean
                -
                Try to uncomment the given range. - Returns true if a comment range was found and - removed, false otherwise.
                -
                - The options object accepted by these methods may - have the following properties: -
                -
                blockCommentStart, blockCommentEnd, blockCommentLead, lineComment: string
                -
                Override the comment string - properties of the mode with custom comment strings.
                -
                padding: string
                -
                A string that will be inserted after opening and leading - markers, and before closing comment markers. Defaults to a - single space.
                -
                commentBlankLines: boolean
                -
                Whether, when adding line comments, to also comment lines - that contain only whitespace.
                -
                indent: boolean
                -
                When adding line comments and this is turned on, it will - align the comment block to the current indentation of the - first line of the block.
                -
                fullLines: boolean
                -
                When block commenting, this controls whether the whole - lines are indented, or only the precise range that is given. - Defaults to true.
                -
                - The addon also defines - a toggleComment command, - which will try to uncomment the current selection, and if that - fails, line-comments it.
                - -
                fold/foldcode.js
                -
                Helps with code folding. Adds a foldCode method - to editor instances, which will try to do a code fold starting - at the given line, or unfold the fold that is already present. - The method takes as first argument the position that should be - folded (may be a line number or - a Pos), and as second optional - argument either a range-finder function, or an options object, - supporting the following properties: -
                -
                rangeFinder: fn(CodeMirror, Pos)
                -
                The function that is used to find - foldable ranges. If this is not directly passed, it will - default to CodeMirror.fold.auto, which - uses getHelpers with - a "fold" type to find folding functions - appropriate for the local mode. There are files in - the addon/fold/ - directory providing CodeMirror.fold.brace, which - finds blocks in brace languages (JavaScript, C, Java, - etc), CodeMirror.fold.indent, for languages where - indentation determines block structure (Python, Haskell), - and CodeMirror.fold.xml, for XML-style languages, - and CodeMirror.fold.comment, for folding comment - blocks.
                -
                widget: string|Element
                -
                The widget to show for folded ranges. Can be either a - string, in which case it'll become a span with - class CodeMirror-foldmarker, or a DOM node.
                -
                scanUp: boolean
                -
                When true (default is false), the addon will try to find - foldable ranges on the lines above the current one if there - isn't an eligible one on the given line.
                -
                minFoldSize: integer
                -
                The minimum amount of lines that a fold should span to be - accepted. Defaults to 0, which also allows single-line - folds.
                -
                - See the demo for an - example.
                - -
                fold/foldgutter.js
                -
                Provides an option foldGutter, which can be - used to create a gutter with markers indicating the blocks that - can be folded. Create a gutter using - the gutters option, - giving it the class CodeMirror-foldgutter or - something else if you configure the addon to use a different - class, and this addon will show markers next to folded and - foldable blocks, and handle clicks in this gutter. Note that - CSS styles should be applied to make the gutter, and the fold - markers within it, visible. A default set of CSS styles are - available in: - - addon/fold/foldgutter.css - . - The option - can be either set to true, or an object containing - the following optional option fields: -
                -
                gutter: string
                -
                The CSS class of the gutter. Defaults - to "CodeMirror-foldgutter". You will have to - style this yourself to give it a width (and possibly a - background). See the default gutter style rules above.
                -
                indicatorOpen: string | Element
                -
                A CSS class or DOM element to be used as the marker for - open, foldable blocks. Defaults - to "CodeMirror-foldgutter-open".
                -
                indicatorFolded: string | Element
                -
                A CSS class or DOM element to be used as the marker for - folded blocks. Defaults to "CodeMirror-foldgutter-folded".
                -
                rangeFinder: fn(CodeMirror, Pos)
                -
                The range-finder function to use when determining whether - something can be folded. When not - given, CodeMirror.fold.auto - will be used as default.
                -
                - The foldOptions editor option can be set to an - object to provide an editor-wide default configuration. - Demo here.
                - -
                runmode/runmode.js
                -
                Can be used to run a CodeMirror mode over text without - actually opening an editor instance. - See the demo for an example. - There are alternate versions of the file avaible for - running stand-alone - (without including all of CodeMirror) and - for running under - node.js.
                - -
                runmode/colorize.js
                -
                Provides a convenient way to syntax-highlight code snippets - in a webpage. Depends on - the runmode addon (or - its standalone variant). Provides - a CodeMirror.colorize function that can be called - with an array (or other array-ish collection) of DOM nodes that - represent the code snippets. By default, it'll get - all pre tags. Will read the data-lang - attribute of these nodes to figure out their language, and - syntax-color their content using the relevant CodeMirror mode - (you'll have to load the scripts for the relevant modes - yourself). A second argument may be provided to give a default - mode, used when no language attribute is found for a node. Used - in this manual to highlight example code.
                - -
                mode/overlay.js
                -
                Mode combinator that can be used to extend a mode with an - 'overlay' — a secondary mode is run over the stream, along with - the base mode, and can color specific pieces of text without - interfering with the base mode. - Defines CodeMirror.overlayMode, which is used to - create such a mode. See this - demo for a detailed example.
                - -
                mode/multiplex.js
                -
                Mode combinator that can be used to easily 'multiplex' - between several modes. - Defines CodeMirror.multiplexingMode which, when - given as first argument a mode object, and as other arguments - any number of {open, close, mode [, delimStyle, innerStyle, parseDelimiters]} - objects, will return a mode object that starts parsing using the - mode passed as first argument, but will switch to another mode - as soon as it encounters a string that occurs in one of - the open fields of the passed objects. When in a - sub-mode, it will go back to the top mode again when - the close string is encountered. - Pass "\n" for open or close - if you want to switch on a blank line. -
                • When delimStyle is specified, it will be the token - style returned for the delimiter tokens.
                • -
                • When innerStyle is specified, it will be the token - style added for each inner mode token.
                • -
                • When parseDelimiters is true, the content of - the delimiters will also be passed to the inner mode. - (And delimStyle is ignored.)
                The outer - mode will not see the content between the delimiters. - See this demo for an - example.
                - -
                hint/show-hint.js
                -
                Provides a framework for showing autocompletion hints. - Defines editor.showHint, which takes an optional - options object, and pops up a widget that allows the user to - select a completion. Finding hints is done with a hinting - functions (the hint option), which is a function - that take an editor instance and options object, and return - a {list, from, to} object, where list - is an array of strings or objects (the completions), - and from and to give the start and end - of the token that is being completed as {line, ch} - objects. An optional selectedHint property (an - integer) can be added to the completion object to control the - initially selected hint.
                -
                If no hinting function is given, the addon will - use CodeMirror.hint.auto, which - calls getHelpers with - the "hint" type to find applicable hinting - functions, and tries them one by one. If that fails, it looks - for a "hintWords" helper to fetch a list of - completable words for the mode, and - uses CodeMirror.hint.fromList to complete from - those.
                -
                When completions aren't simple strings, they should be - objects with the following properties: -
                -
                text: string
                -
                The completion text. This is the only required - property.
                -
                displayText: string
                -
                The text that should be displayed in the menu.
                -
                className: string
                -
                A CSS class name to apply to the completion's line in the - menu.
                -
                render: fn(Element, self, data)
                -
                A method used to create the DOM structure for showing the - completion by appending it to its first argument.
                -
                hint: fn(CodeMirror, self, data)
                -
                A method used to actually apply the completion, instead of - the default behavior.
                -
                from: {line, ch}
                -
                Optional from position that will be used by pick() instead - of the global one passed with the full list of completions.
                -
                to: {line, ch}
                -
                Optional to position that will be used by pick() instead - of the global one passed with the full list of completions.
                -
                - The plugin understands the following options (the options object - will also be passed along to the hinting function, which may - understand additional options): -
                -
                hint: function
                -
                A hinting function, as specified above. It is possible to - set the async property on a hinting function to - true, in which case it will be called with - arguments (cm, callback, ?options), and the - completion interface will only be popped up when the hinting - function calls the callback, passing it the object holding the - completions.
                -
                completeSingle: boolean
                -
                Determines whether, when only a single completion is - available, it is completed without showing the dialog. - Defaults to true.
                -
                alignWithWord: boolean
                -
                Whether the pop-up should be horizontally aligned with the - start of the word (true, default), or with the cursor (false).
                -
                closeOnUnfocus: boolean
                -
                When enabled (which is the default), the pop-up will close - when the editor is unfocused.
                -
                customKeys: keymap
                -
                Allows you to provide a custom key map of keys to be active - when the pop-up is active. The handlers will be called with an - extra argument, a handle to the completion menu, which - has moveFocus(n), setFocus(n), pick(), - and close() methods (see the source for details), - that can be used to change the focused element, pick the - current element or close the menu. Additionnaly menuSize() - can give you access to the size of the current dropdown menu, - length give you the number of availlable completions, and - data give you full access to the completion returned by the - hinting function.
                -
                extraKeys: keymap
                -
                Like customKeys above, but the bindings will - be added to the set of default bindings, instead of replacing - them.
                -
                - The following events will be fired on the completions object - during completion: -
                -
                "shown" ()
                -
                Fired when the pop-up is shown.
                -
                "select" (completion, Element)
                -
                Fired when a completion is selected. Passed the completion - value (string or object) and the DOM node that represents it - in the menu.
                -
                "pick" (completion)
                -
                Fired when a completion is picked. Passed the completion value - (string or object).
                -
                "close" ()
                -
                Fired when the completion is finished.
                -
                - This addon depends on styles - from addon/hint/show-hint.css. Check - out the demo for an - example.
                - -
                hint/javascript-hint.js
                -
                Defines a simple hinting function for JavaScript - (CodeMirror.hint.javascript) and CoffeeScript - (CodeMirror.hint.coffeescript) code. This will - simply use the JavaScript environment that the editor runs in as - a source of information about objects and their properties.
                - -
                hint/xml-hint.js
                -
                Defines CodeMirror.hint.xml, which produces - hints for XML tagnames, attribute names, and attribute values, - guided by a schemaInfo option (a property of the - second argument passed to the hinting function, or the third - argument passed to CodeMirror.showHint).
                The - schema info should be an object mapping tag names to information - about these tags, with optionally a "!top" property - containing a list of the names of valid top-level tags. The - values of the properties should be objects with optional - properties children (an array of valid child - element names, omit to simply allow all tags to appear) - and attrs (an object mapping attribute names - to null for free-form attributes, and an array of - valid values for restricted - attributes). Demo - here.
                - -
                hint/html-hint.js
                -
                Provides schema info to - the xml-hint addon for HTML - documents. Defines a schema - object CodeMirror.htmlSchema that you can pass to - as a schemaInfo option, and - a CodeMirror.hint.html hinting function that - automatically calls CodeMirror.hint.xml with this - schema data. See - the demo.
                - -
                hint/css-hint.js
                -
                A hinting function for CSS, SCSS, or LESS code. - Defines CodeMirror.hint.css.
                - -
                hint/anyword-hint.js
                -
                A very simple hinting function - (CodeMirror.hint.anyword) that simply looks for - words in the nearby code and completes to those. Takes two - optional options, word, a regular expression that - matches words (sequences of one or more character), - and range, which defines how many lines the addon - should scan when completing (defaults to 500).
                - -
                hint/sql-hint.js
                -
                A simple SQL hinter. Defines CodeMirror.hint.sql. - Takes two optional options, tables, a object with - table names as keys and array of respective column names as values, - and defaultTable, a string corresponding to a - table name in tables for autocompletion.
                - -
                search/match-highlighter.js
                -
                Adds a highlightSelectionMatches option that - can be enabled to highlight all instances of a currently - selected word. Can be set either to true or to an object - containing the following options: minChars, for the - minimum amount of selected characters that triggers a highlight - (default 2), style, for the style to be used to - highlight the matches (default "matchhighlight", - which will correspond to CSS - class cm-matchhighlight), - and showToken which can be set to true - or to a regexp matching the characters that make up a word. When - enabled, it causes the current word to be highlighted when - nothing is selected (defaults to off). - Demo here.
                - -
                lint/lint.js
                -
                Defines an interface component for showing linting warnings, - with pluggable warning sources - (see json-lint.js, - javascript-lint.js, - coffeescript-lint.js, - and css-lint.js - in the same directory). Defines a lint option that - can be set to a warning source (for - example CodeMirror.lint.javascript), or - to true, in which - case getHelper with - type "lint" is used to determined a validator - function. Such a function should, when given a document string, - an options object, and an editor instance, return an array of {message, - severity, from, to} objects representing problems. When - the function has an async property with a truthy - value, it will be called with an additional second argument, - which is a callback to pass the array to. Depends - on addon/lint/lint.css. A demo can be - found here.
                - -
                selection/mark-selection.js
                -
                Causes the selected text to be marked with the CSS class - CodeMirror-selectedtext when the styleSelectedText option - is enabled. Useful to change the colour of the selection (in addition to the background), - like in this demo.
                - -
                selection/active-line.js
                -
                Defines a styleActiveLine option that, when enabled, - gives the wrapper of the active line the class CodeMirror-activeline, - and adds a background with the class CodeMirror-activeline-background. - is enabled. See the demo.
                - -
                selection/selection-pointer.js
                -
                Defines a selectionPointer option which you can - use to control the mouse cursor appearance when hovering over - the selection. It can be set to a string, - like "pointer", or to true, in which case - the "default" (arrow) cursor will be used. You can - see a demo here.
                - -
                mode/loadmode.js
                -
                Defines a CodeMirror.requireMode(modename, - callback) function that will try to load a given mode and - call the callback when it succeeded. You'll have to - set CodeMirror.modeURL to a string that mode paths - can be constructed from, for - example "mode/%N/%N.js"—the %N's will - be replaced with the mode name. Also - defines CodeMirror.autoLoadMode(instance, mode), - which will ensure the given mode is loaded and cause the given - editor instance to refresh its mode when the loading - succeeded. See the demo.
                - -
                mode/meta.js
                -
                Provides meta-information about all the modes in the - distribution in a single file. - Defines CodeMirror.modeInfo, an array of objects - with {name, mime, mode} properties, - where name is the human-readable - name, mime the MIME type, and mode the - name of the mode file that defines this MIME. There are optional - properties mimes, which holds an array of MIME - types for modes with multiple MIMEs associated, - and ext, which holds an array of file extensions - associated with this mode. Four convenience - functions, CodeMirror.findModeByMIME, - CodeMirror.findModeByExtension, - CodeMirror.findModeByFileName - and CodeMirror.findModeByName are provided, which - return such an object given a MIME, extension, file name or mode name - string. Note that, for historical reasons, this file resides in the - top-level mode directory, not - under addon. Demo.
                - -
                comment/continuecomment.js
                -
                Adds a continueComments option, which sets whether the - editor will make the next line continue a comment when you press Enter - inside a comment block. Can be set to a boolean to enable/disable this - functionality. Set to a string, it will continue comments using a custom - shortcut. Set to an object, it will use the key property for - a custom shortcut and the boolean continueLineComment - property to determine whether single-line comments should be continued - (defaulting to true).
                - -
                display/placeholder.js
                -
                Adds a placeholder option that can be used to - make text appear in the editor when it is empty and not focused. - Also gives the editor a CodeMirror-empty CSS class - whenever it doesn't contain any text. - See the demo.
                - -
                display/fullscreen.js
                -
                Defines an option fullScreen that, when set - to true, will make the editor full-screen (as in, - taking up the whole browser window). Depends - on fullscreen.css. Demo - here.
                - -
                scroll/simplescrollbars.js
                -
                Defines two additional scrollbar - models, "simple" and "overlay" - (see demo) that can - be selected with - the scrollbarStyle - option. Depends - on simplescrollbars.css, - which can be further overridden to style your own - scrollbars.
                - -
                scroll/annotatescrollbar.js
                -
                Provides functionality for showing markers on the scrollbar - to call out certain parts of the document. Adds a - method annotateScrollbar to editor instances that - can be called, with a CSS class name as argument, to create a - set of annotations. The method returns an object - whose update method can be called with an array - of {from: Pos, to: Pos} objects marking the ranges - to be higlighed. To detach the annotations, call the - object's clear method.
                - -
                display/rulers.js
                -
                Adds a rulers option, which can be used to show - one or more vertical rulers in the editor. The option, if - defined, should be given an array of {column [, className, - color, lineStyle, width]} objects or numbers (wich - indicate a column). The ruler will be displayed at the column - indicated by the number or the column property. - The className property can be used to assign a - custom style to a ruler. Demo - here.
                - -
                display/panel.js
                -
                Defines an addPanel method for CodeMirror - instances, which places a DOM node above or below an editor, and - shrinks the editor to make room for the node. The method takes - as first argument as DOM node, and as second an optional options - object. The Panel object returned by this method - has a clear method that is used to remove the - panel, and a changed method that can be used to - notify the addon when the size of the panel's DOM node has - changed.
                - The method accepts the following options: -
                -
                position : string
                -
                Controls the position of the newly added panel. The - following values are recognized: -
                -
                top (default)
                -
                Adds the panel at the very top.
                -
                after-top
                -
                Adds the panel at the bottom of the top panels.
                -
                bottom
                -
                Adds the panel at the very bottom.
                -
                before-bottom
                -
                Adds the panel at the top of the bottom panels.
                -
                -
                -
                before : Panel
                -
                The new panel will be added before the given panel.
                -
                after : Panel
                -
                The new panel will be added after the given panel.
                -
                replace : Panel
                -
                The new panel will replace the given panel.
                -
                - When using the after, before or replace options, - if the panel doesn't exists or has been removed, - the value of the position option will be used as a fallback. -
                - A demo of the addon is available here. -
                - -
                wrap/hardwrap.js
                -
                Addon to perform hard line wrapping/breaking for paragraphs - of text. Adds these methods to editor instances: -
                -
                wrapParagraph(?pos: {line, ch}, ?options: object)
                -
                Wraps the paragraph at the given position. - If pos is not given, it defaults to the cursor - position.
                -
                wrapRange(from: {line, ch}, to: {line, ch}, ?options: object)
                -
                Wraps the given range as one big paragraph.
                -
                wrapParagraphsInRange(from: {line, ch}, to: {line, ch}, ?options: object)
                -
                Wrapps the paragraphs in (and overlapping with) the - given range individually.
                -
                - The following options are recognized: -
                -
                paragraphStart, paragraphEnd: RegExp
                -
                Blank lines are always considered paragraph boundaries. - These options can be used to specify a pattern that causes - lines to be considered the start or end of a paragraph.
                -
                column: number
                -
                The column to wrap at. Defaults to 80.
                -
                wrapOn: RegExp
                -
                A regular expression that matches only those - two-character strings that allow wrapping. By default, the - addon wraps on whitespace and after dash characters.
                -
                killTrailingSpace: boolean
                -
                Whether trailing space caused by wrapping should be - preserved, or deleted. Defaults to true.
                -
                - A demo of the addon is available here. -
                - -
                merge/merge.js
                -
                Implements an interface for merging changes, using either a - 2-way or a 3-way view. The CodeMirror.MergeView - constructor takes arguments similar to - the CodeMirror - constructor, first a node to append the interface to, and then - an options object. Options are passed through to the editors - inside the view. These extra options are recognized: -
                -
                origLeft and origRight: string
                -
                If given these provide original versions of the - document, which will be shown to the left and right of the - editor in non-editable CodeMirror instances. The merge - interface will highlight changes between the editable - document and the original(s). To create a 2-way (as opposed - to 3-way) merge view, provide only one of them.
                -
                revertButtons: boolean
                -
                Determines whether buttons that allow the user to revert - changes are shown. Defaults to true.
                -
                connect: string
                -
                Sets the style used to connect changed chunks of code. - By default, connectors are drawn. When this is set - to "align", the smaller chunk is padded to - align with the bigger chunk instead.
                -
                collapseIdentical: boolean|number
                -
                When true (default is false), stretches of unchanged - text will be collapsed. When a number is given, this - indicates the amount of lines to leave visible around such - stretches (which defaults to 2).
                -
                allowEditingOriginals: boolean
                -
                Determines whether the original editor allows editing. - Defaults to false.
                -
                showDifferences: boolean
                -
                When true (the default), changed pieces of text are - highlighted.
                -
                - The addon also defines commands "goNextDiff" - and "goPrevDiff" to quickly jump to the next - changed chunk. Demo - here.
                - -
                tern/tern.js
                -
                Provides integration with - the Tern JavaScript analysis - engine, for completion, definition finding, and minor - refactoring help. See the demo - for a very simple integration. For more involved scenarios, see - the comments at the top of - the addon and the - implementation of the - (multi-file) demonstration - on the Tern website.
                -
                -
                - -
                -

                Writing CodeMirror Modes

                - -

                Modes typically consist of a single JavaScript file. This file - defines, in the simplest case, a lexer (tokenizer) for your - language—a function that takes a character stream as input, - advances it past a token, and returns a style for that token. More - advanced modes can also handle indentation for the language.

                - -

                This section describes the low-level mode interface. Many modes - are written directly against this, since it offers a lot of - control, but for a quick mode definition, you might want to use - the simple mode addon.

                - -

                The mode script should - call CodeMirror.defineMode to - register itself with CodeMirror. This function takes two - arguments. The first should be the name of the mode, for which you - should use a lowercase string, preferably one that is also the - name of the files that define the mode (i.e. "xml" is - defined in xml.js). The second argument should be a - function that, given a CodeMirror configuration object (the thing - passed to the CodeMirror function) and an optional - mode configuration object (as in - the mode option), returns - a mode object.

                - -

                Typically, you should use this second argument - to defineMode as your module scope function (modes - should not leak anything into the global scope!), i.e. write your - whole mode inside this function.

                - -

                The main responsibility of a mode script is parsing - the content of the editor. Depending on the language and the - amount of functionality desired, this can be done in really easy - or extremely complicated ways. Some parsers can be stateless, - meaning that they look at one element (token) of the code - at a time, with no memory of what came before. Most, however, will - need to remember something. This is done by using a state - object, which is an object that is always passed when - reading a token, and which can be mutated by the tokenizer.

                - -

                Modes that use a state must define - a startState method on their mode - object. This is a function of no arguments that produces a state - object to be used at the start of a document.

                - -

                The most important part of a mode object is - its token(stream, state) method. All - modes must define this method. It should read one token from the - stream it is given as an argument, optionally update its state, - and return a style string, or null for tokens that do - not have to be styled. For your styles, you are encouraged to use - the 'standard' names defined in the themes (without - the cm- prefix). If that fails, it is also possible - to come up with your own and write your own CSS theme file.

                - -

                A typical token string would - be "variable" or "comment". Multiple - styles can be returned (separated by spaces), for - example "string error" for a thing that looks like a - string but is invalid somehow (say, missing its closing quote). - When a style is prefixed by "line-" - or "line-background-", the style will be applied to - the whole line, analogous to what - the addLineClass method - does—styling the "text" in the simple case, and - the "background" element - when "line-background-" is prefixed.

                - -

                The stream object that's passed - to token encapsulates a line of code (tokens may - never span lines) and our current position in that line. It has - the following API:

                - -
                -
                eol() → boolean
                -
                Returns true only if the stream is at the end of the - line.
                -
                sol() → boolean
                -
                Returns true only if the stream is at the start of the - line.
                - -
                peek() → string
                -
                Returns the next character in the stream without advancing - it. Will return an null at the end of the - line.
                -
                next() → string
                -
                Returns the next character in the stream and advances it. - Also returns null when no more characters are - available.
                - -
                eat(match: string|regexp|function(char: string) → boolean) → string
                -
                match can be a character, a regular expression, - or a function that takes a character and returns a boolean. If - the next character in the stream 'matches' the given argument, - it is consumed and returned. Otherwise, undefined - is returned.
                -
                eatWhile(match: string|regexp|function(char: string) → boolean) → boolean
                -
                Repeatedly calls eat with the given argument, - until it fails. Returns true if any characters were eaten.
                -
                eatSpace() → boolean
                -
                Shortcut for eatWhile when matching - white-space.
                -
                skipToEnd()
                -
                Moves the position to the end of the line.
                -
                skipTo(ch: string) → boolean
                -
                Skips to the next occurrence of the given character, if - found on the current line (doesn't advance the stream if the - character does not occur on the line). Returns true if the - character was found.
                -
                match(pattern: string, ?consume: boolean, ?caseFold: boolean) → boolean
                -
                match(pattern: regexp, ?consume: boolean) → array<string>
                -
                Act like a - multi-character eat—if consume is true - or not given—or a look-ahead that doesn't update the stream - position—if it is false. pattern can be either a - string or a regular expression starting with ^. - When it is a string, caseFold can be set to true to - make the match case-insensitive. When successfully matching a - regular expression, the returned value will be the array - returned by match, in case you need to extract - matched groups.
                - -
                backUp(n: integer)
                -
                Backs up the stream n characters. Backing it up - further than the start of the current token will cause things to - break, so be careful.
                -
                column() → integer
                -
                Returns the column (taking into account tabs) at which the - current token starts.
                -
                indentation() → integer
                -
                Tells you how far the current line has been indented, in - spaces. Corrects for tab characters.
                - -
                current() → string
                -
                Get the string between the start of the current token and - the current stream position.
                -
                - -

                By default, blank lines are simply skipped when - tokenizing a document. For languages that have significant blank - lines, you can define - a blankLine(state) method on your - mode that will get called whenever a blank line is passed over, so - that it can update the parser state.

                - -

                Because state object are mutated, and CodeMirror - needs to keep valid versions of a state around so that it can - restart a parse at any line, copies must be made of state objects. - The default algorithm used is that a new state object is created, - which gets all the properties of the old object. Any properties - which hold arrays get a copy of these arrays (since arrays tend to - be used as mutable stacks). When this is not correct, for example - because a mode mutates non-array properties of its state object, a - mode object should define - a copyState method, which is given a - state and should return a safe copy of that state.

                - -

                If you want your mode to provide smart indentation - (through the indentLine - method and the indentAuto - and newlineAndIndent commands, to which keys can be - bound), you must define - an indent(state, textAfter) method - on your mode object.

                - -

                The indentation method should inspect the given state object, - and optionally the textAfter string, which contains - the text on the line that is being indented, and return an - integer, the amount of spaces to indent. It should usually take - the indentUnit - option into account. An indentation method may - return CodeMirror.Pass to indicate that it - could not come up with a precise indentation.

                - -

                To work well with - the commenting addon, a mode may - define lineComment (string that - starts a line - comment), blockCommentStart, blockCommentEnd - (strings that start and end block comments), - and blockCommentLead (a string to put at the start of - continued lines in a block comment). All of these are - optional.

                - -

                Finally, a mode may define either - an electricChars or an electricInput - property, which are used to automatically reindent the line when - certain patterns are typed and - the electricChars - option is enabled. electricChars may be a string, and - will trigger a reindent whenever one of the characters in that - string are typed. Often, it is more appropriate to - use electricInput, which should hold a regular - expression, and will trigger indentation when the part of the - line before the cursor matches the expression. It should - usually end with a $ character, so that it only - matches when the indentation-changing pattern was just typed, not when something was - typed after the pattern.

                - -

                So, to summarize, a mode must provide - a token method, and it may - provide startState, copyState, - and indent methods. For an example of a trivial mode, - see the diff mode, for a more - involved example, see the C-like - mode.

                - -

                Sometimes, it is useful for modes to nest—to have one - mode delegate work to another mode. An example of this kind of - mode is the mixed-mode HTML - mode. To implement such nesting, it is usually necessary to - create mode objects and copy states yourself. To create a mode - object, there are CodeMirror.getMode(options, - parserConfig), where the first argument is a configuration - object as passed to the mode constructor function, and the second - argument is a mode specification as in - the mode option. To copy a - state object, call CodeMirror.copyState(mode, state), - where mode is the mode that created the given - state.

                - -

                In a nested mode, it is recommended to add an - extra method, innerMode which, given - a state object, returns a {state, mode} object with - the inner mode and its state for the current position. These are - used by utility scripts such as the tag - closer to get context information. Use - the CodeMirror.innerMode helper function to, starting - from a mode and a state, recursively walk down to the innermost - mode and state.

                - -

                To make indentation work properly in a nested parser, it is - advisable to give the startState method of modes that - are intended to be nested an optional argument that provides the - base indentation for the block of code. The JavaScript and CSS - parser do this, for example, to allow JavaScript and CSS code - inside the mixed-mode HTML mode to be properly indented.

                - -

                It is possible, and encouraged, to associate - your mode, or a certain configuration of your mode, with - a MIME type. For - example, the JavaScript mode associates itself - with text/javascript, and its JSON variant - with application/json. To do this, - call CodeMirror.defineMIME(mime, - modeSpec), where modeSpec can be a string or - object specifying a mode, as in - the mode option.

                - -

                If a mode specification wants to add some properties to the - resulting mode object, typically for use - with getHelpers, it may - contain a modeProps property, which holds an object. - This object's properties will be copied to the actual mode - object.

                - -

                Sometimes, it is useful to add or override mode - object properties from external code. - The CodeMirror.extendMode function - can be used to add properties to mode objects produced for a - specific mode. Its first argument is the name of the mode, its - second an object that specifies the properties that should be - added. This is mostly useful to add utilities that can later be - looked up through getMode.

                -
                - -
                -

                VIM Mode API

                - -

                CodeMirror has a robust VIM mode that attempts to faithfully - emulate VIM's most useful features. It can be enabled by - including keymap/vim.js - and setting the keymap option to - vim.

                - -

                Configuration

                - -

                VIM mode accepts configuration options for customizing - behavior at run time. These methods can be called at any time - and will affect all existing CodeMirror instances unless - specified otherwise. The methods are exposed on the - CodeMirror.Vim object.

                - -
                -
                setOption(name: string, value: any, ?cm: CodeMirror, ?cfg: object)
                -
                Sets the value of a VIM option. name should - be the name of an option. If cfg.scope is not set - and cm is provided, then sets the global and - instance values of the option. Otherwise, sets either the - global or instance value of the option depending on whether - cfg.scope is global or - local.
                -
                getOption(name: string, ?cm: CodeMirror: ?cfg: object)
                -
                Gets the current value of a VIM option. If - cfg.scope is not set and cm is - provided, then gets the instance value of the option, falling - back to the global value if not set. If cfg.scope is provided, then gets the global or - local value without checking the other.
                - -
                map(lhs: string, rhs: string, ?context: string)
                -
                Maps a key sequence to another key sequence. Implements - VIM's :map command. To map ; to : in VIM would be - :map ; :. That would translate to - CodeMirror.Vim.map(';', ':');. - The context can be normal, - visual, or insert, which correspond - to :nmap, :vmap, and - :imap - respectively.
                - -
                mapCommand(keys: string, type: string, name: string, ?args: object, ?extra: object)
                -
                Maps a key sequence to a motion, - operator, or action type command. - The args object is passed through to the command when it is - invoked by the provided key sequence. - extras.context can be normal, - visual, or insert, to map the key - sequence only in the corresponding mode. - extras.isEdit is applicable only to actions, - determining whether it is recorded for replay for the - . single-repeat command. -
                - -

                Extending VIM

                - -

                CodeMirror's VIM mode implements a large subset of VIM's core - editing functionality. But since there's always more to be - desired, there is a set of APIs for extending VIM's - functionality. As with the configuration API, the methods are - exposed on CodeMirror.Vim and may - be called at any time.

                - -
                -
                defineOption(name: string, default: any, type: string, ?aliases: array<string>, ?callback: function (?value: any, ?cm: CodeMirror) → ?any)
                -
                Defines a VIM style option and makes it available to the - :set command. Type can be boolean or - string, used for validation and by - :set to determine which syntax to accept. If a - callback is passed in, VIM does not store the value of the - option itself, but instead uses the callback as a setter/getter. If the - first argument to the callback is undefined, then the - callback should return the value of the option. Otherwise, it should set - instead. Since VIM options have global and instance values, whether a - CodeMirror instance is passed in denotes whether the global - or local value should be used. Consequently, it's possible for the - callback to be called twice for a single setOption or - getOption call. Note that right now, VIM does not support - defining buffer-local options that do not have global values. If an - option should not have a global value, either always ignore the - cm parameter in the callback, or always pass in a - cfg.scope to setOption and - getOption.
                - -
                defineMotion(name: string, fn: function(cm: CodeMirror, head: {line, ch}, ?motionArgs: object}) → {line, ch})
                -
                Defines a motion command for VIM. The motion should return - the desired result position of the cursor. head - is the current position of the cursor. It can differ from - cm.getCursor('head') if VIM is in visual mode. - motionArgs is the object passed into - mapCommand().
                - -
                defineOperator(name: string, fn: function(cm: CodeMirror, ?operatorArgs: object, ranges: array<{anchor, head}>) → ?{line, ch})
                -
                Defines an operator command, similar to - defineMotion. ranges is the range - of text the operator should operate on. If the cursor should - be set to a certain position after the operation finishes, it - can return a cursor object.
                - -
                defineAction(name: string, fn: function(cm: CodeMirror, ?actionArgs: object))
                -
                Defines an action command, similar to - defineMotion. Action commands - can have arbitrary behavior, making them more flexible than - motions and operators, at the loss of orthogonality.
                - -
                defineEx(name: string, ?prefix: string, fn: function(cm: CodeMirror, ?params: object))
                -
                Defines an Ex command, and maps it to :name. - If a prefix is provided, it, and any prefixed substring of the - name beginning with the prefix can - be used to invoke the command. If the prefix is - falsy, then name is used as the prefix. - params.argString contains the part of the prompted - string after the command name. params.args is - params.argString split by whitespace. If the - command was prefixed with a - line range, - params.line and params.lineEnd will - be set. -
                - -
                - -
                - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/realworld.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/realworld.html deleted file mode 100644 index 65128ad..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/realworld.html +++ /dev/null @@ -1,174 +0,0 @@ - - -CodeMirror: Real-world Uses - - - - - -
                - -

                CodeMirror real-world uses

                - -

                Create a pull - request if you'd like your project to be added to this list.

                - - - -
                - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/releases.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/releases.html deleted file mode 100644 index 77e9896..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/releases.html +++ /dev/null @@ -1,1116 +0,0 @@ - - -CodeMirror: Release History - - - - - - -
                - -

                Release notes and version history

                - -
                - -

                Version 5.x

                - -

                20-07-2015: Version 5.5:

                - - - -

                25-06-2015: Version 5.4:

                - - - -

                20-05-2015: Version 5.3:

                - - - -

                20-04-2015: Version 5.2:

                - - - -

                23-03-2015: Version 5.1:

                - - - -

                20-02-2015: Version 5.0:

                - -
                  -
                • Experimental mobile support (tested on iOS, Android Chrome, stock Android browser)
                • -
                • New option inputStyle to switch between hidden textarea and contenteditable input.
                • -
                • The getInputField - method is no longer guaranteed to return a textarea.
                • -
                • Full list of patches.
                • -
                - -
                - -
                - -

                Version 4.x

                - -

                20-02-2015: Version 4.13:

                - - - -

                22-01-2015: Version 4.12:

                - - - -

                9-01-2015: Version 4.11:

                - -

                Unfortunately, 4.10 did not take care of the - Firefox scrolling issue entirely. This release adds two more patches - to address that.

                - -

                29-12-2014: Version 4.10:

                - -

                Emergency single-patch update to 4.9. Fixes - Firefox-specific problem where the cursor could end up behind the - horizontal scrollbar.

                - -

                23-12-2014: Version 4.9:

                - - - -

                22-11-2014: Version 4.8:

                - - - -

                20-10-2014: Version 4.7:

                - -
                  -
                • Incompatible: - The lint addon now passes the - editor's value as first argument to asynchronous lint functions, - for consistency. The editor is still passed, as fourth - argument.
                • -
                • Improved handling of unicode identifiers in modes for - languages that support them.
                • -
                • More mode - improvements: CoffeeScript - (indentation), Verilog - (indentation), Scala - (indentation, triple-quoted strings), - and PHP (interpolated - variables in heredoc strings).
                • -
                • New modes: Textile and Tornado templates.
                • -
                • Experimental new way to define modes.
                • -
                • Improvements to the Vim - bindings: Arbitrary insert mode key mappings are now possible, - and text objects are supported in visual mode.
                • -
                • The mode meta-information file - now includes information about file extensions, - and helper - functions findModeByMIME - and findModeByExtension.
                • -
                • New logo!
                • -
                • Full list of patches.
                • -
                - -

                19-09-2014: Version 4.6:

                - - - -

                21-08-2014: Version 4.5:

                - -
                  -
                • Fix several serious bugs with horizontal scrolling
                • -
                • New mode: Slim
                • -
                • New command: goLineLeftSmart
                • -
                • More fixes and extensions for the Vim visual block mode
                • -
                • Full list of patches.
                • -
                - -

                21-07-2014: Version 4.4:

                - -
                  -
                • Note: Some events might now fire in slightly - different order ("change" is still guaranteed to fire - before "cursorActivity")
                • -
                • Nested operations in multiple editors are now synced (complete - at same time, reducing DOM reflows)
                • -
                • Visual block mode for vim (<C-v>) is nearly complete
                • -
                • New mode: Kotlin
                • -
                • Better multi-selection paste for text copied from multiple CodeMirror selections
                • -
                • Full list of patches.
                • -
                - -

                23-06-2014: Version 4.3:

                - -
                  -
                • Several vim bindings - improvements: search and exCommand history, global flag - for :substitute, :global command. -
                • Allow hiding the cursor by - setting cursorBlinkRate - to a negative value.
                • -
                • Make gutter markers themeable, use this in foldgutter.
                • -
                • Full list of patches.
                • -
                - -

                19-05-2014: Version 4.2:

                - -
                  -
                • Fix problem where some modes were broken by the fact that empty tokens were forbidden.
                • -
                • Several fixes to context menu handling.
                • -
                • On undo, scroll change, not cursor, into view.
                • -
                • Rewritten Jade mode.
                • -
                • Various improvements to Shell (support for more syntax) and Python (better indentation) modes.
                • -
                • New mode: Cypher.
                • -
                • New theme: Neo.
                • -
                • Support direct styling options (color, line style, width) in the rulers addon.
                • -
                • Recognize per-editor configuration for the show-hint and foldcode addons.
                • -
                • More intelligent scanning for existing close tags in closetag addon.
                • -
                • In the Vim bindings: Fix bracket matching, support case conversion in visual mode, visual paste, append action.
                • -
                • Full list of patches.
                • -
                - -

                22-04-2014: Version 4.1:

                - -
                  -
                • Slightly incompatible: - The "cursorActivity" - event now fires after all other events for the operation (and only - for handlers that were actually registered at the time the - activity happened).
                • -
                • New command: insertSoftTab.
                • -
                • New mode: Django.
                • -
                • Improved modes: Verilog (rewritten), Jinja2, Haxe, PHP (string interpolation highlighted), JavaScript (indentation of trailing else, template strings), LiveScript (multi-line strings).
                • -
                • Many small issues from the 3.x→4.x transition were found and fixed.
                • -
                • Full list of patches.
                • -
                - -

                20-03-2014: Version 4.0:

                - -

                This is a new major version of CodeMirror. There - are a few incompatible changes in the API. Upgrade - with care, and read the upgrading - guide.

                - - - -
                - -
                - -

                Version 3.x

                - -

                22-04-2014: Version 3.24:

                - -

                Merges the improvements from 4.1 that could - easily be applied to the 3.x code. Also improves the way the editor - size is updated when line widgets change.

                - -

                20-03-2014: Version 3.23:

                - -
                  -
                • In the XML mode, - add brackets style to angle brackets, fix - case-sensitivity of tags for HTML.
                • -
                • New mode: Dylan.
                • -
                • Many improvements to the Vim bindings.
                • -
                - -

                21-02-2014: Version 3.22:

                - - - -

                16-01-2014: Version 3.21:

                - -
                  -
                • Auto-indenting a block will no longer add trailing whitespace to blank lines. -
                • Marking text has a new option clearWhenEmpty to control auto-removal.
                • -
                • Several bugfixes in the handling of bidirectional text.
                • -
                • The XML and CSS modes were largely rewritten. LESS support was added to the CSS mode.
                • -
                • The OCaml mode was moved to an mllike mode, F# support added.
                • -
                • Make it possible to fetch multiple applicable helper values with getHelpers, and to register helpers matched on predicates with registerGlobalHelper.
                • -
                • New theme pastel-on-dark.
                • -
                • Better ECMAScript 6 support in JavaScript mode.
                • -
                • Full list of patches.
                • -
                - -

                21-11-2013: Version 3.20:

                - - - -

                21-10-2013: Version 3.19:

                - - - -

                23-09-2013: Version 3.18:

                - -

                Emergency release to fix a problem in 3.17 - where .setOption("lineNumbers", false) would raise an - error.

                - -

                23-09-2013: Version 3.17:

                - - - -

                21-08-2013: Version 3.16:

                - - - -

                29-07-2013: Version 3.15:

                - - - -

                20-06-2013: Version 3.14:

                - - - -

                20-05-2013: Version 3.13:

                - - - -

                19-04-2013: Version 3.12:

                - - - -

                20-03-2013: Version 3.11:

                - - - -

                21-02-2013: Version 3.1:

                - - - - -

                25-01-2013: Version 3.02:

                - -

                Single-bugfix release. Fixes a problem that - prevents CodeMirror instances from being garbage-collected after - they become unused.

                - -

                21-01-2013: Version 3.01:

                - - - -

                10-12-2012: Version 3.0:

                - -

                New major version. Only - partially backwards-compatible. See - the upgrading guide for more - information. Changes since release candidate 2:

                - -
                  -
                • Rewritten VIM mode.
                • -
                • Fix a few minor scrolling and sizing issues.
                • -
                • Work around Safari segfault when dragging.
                • -
                • Full list of patches.
                • -
                - -

                20-11-2012: Version 3.0, release candidate 2:

                - -
                  -
                • New mode: HTTP.
                • -
                • Improved handling of selection anchor position.
                • -
                • Improve IE performance on longer lines.
                • -
                • Reduce gutter glitches during horiz. scrolling.
                • -
                • Add addKeyMap and removeKeyMap methods.
                • -
                • Rewrite formatting and closetag add-ons.
                • -
                • Full list of patches.
                • -
                - -

                20-11-2012: Version 3.0, release candidate 1:

                - - - -

                22-10-2012: Version 3.0, beta 2:

                - -
                  -
                • Fix page-based coordinate computation.
                • -
                • Fix firing of gutterClick event.
                • -
                • Add cursorHeight option.
                • -
                • Fix bi-directional text regression.
                • -
                • Add viewportMargin option.
                • -
                • Directly handle mousewheel events (again, hopefully better).
                • -
                • Make vertical cursor movement more robust (through widgets, big line gaps).
                • -
                • Add flattenSpans option.
                • -
                • Many optimizations. Poor responsiveness should be fixed.
                • -
                • Initialization in hidden state works again.
                • -
                • Full list of patches.
                • -
                - -

                19-09-2012: Version 3.0, beta 1:

                - -
                  -
                • Bi-directional text support.
                • -
                • More powerful gutter model.
                • -
                • Support for arbitrary text/widget height.
                • -
                • In-line widgets.
                • -
                • Generalized event handling.
                • -
                - -
                - -
                - -

                Version 2.x

                - -

                21-01-2013: Version 2.38:

                - -

                Integrate some bugfixes, enhancements to the vim keymap, and new - modes - (D, Sass, APL) - from the v3 branch.

                - -

                20-12-2012: Version 2.37:

                - -
                  -
                • New mode: SQL (will replace plsql and mysql modes).
                • -
                • Further work on the new VIM mode.
                • -
                • Fix Cmd/Ctrl keys on recent Operas on OS X.
                • -
                • Full list of patches.
                • -
                - -

                20-11-2012: Version 2.36:

                - - - -

                22-10-2012: Version 2.35:

                - -
                  -
                • New (sub) mode: TypeScript.
                • -
                • Don't overwrite (insert key) when pasting.
                • -
                • Fix several bugs in markText/undo interaction.
                • -
                • Better indentation of JavaScript code without semicolons.
                • -
                • Add defineInitHook function.
                • -
                • Full list of patches.
                • -
                - -

                19-09-2012: Version 2.34:

                - -
                  -
                • New mode: Common Lisp.
                • -
                • Fix right-click select-all on most browsers.
                • -
                • Change the way highlighting happens:
                    Saves memory and CPU cycles.
                    compareStates is no longer needed.
                    onHighlightComplete no longer works.
                • -
                • Integrate mode (Markdown, XQuery, CSS, sTex) tests in central testsuite.
                • -
                • Add a CodeMirror.version property.
                • -
                • More robust handling of nested modes in formatting and closetag plug-ins.
                • -
                • Un/redo now preserves marked text and bookmarks.
                • -
                • Full list of patches.
                • -
                - -

                23-08-2012: Version 2.33:

                - -
                  -
                • New mode: Sieve.
                • -
                • New getViewPort and onViewportChange API.
                • -
                • Configurable cursor blink rate.
                • -
                • Make binding a key to false disabling handling (again).
                • -
                • Show non-printing characters as red dots.
                • -
                • More tweaks to the scrolling model.
                • -
                • Expanded testsuite. Basic linter added.
                • -
                • Remove most uses of innerHTML. Remove CodeMirror.htmlEscape.
                • -
                • Full list of patches.
                • -
                - -

                23-07-2012: Version 2.32:

                - -

                Emergency fix for a bug where an editor with - line wrapping on IE will break when there is no - scrollbar.

                - -

                20-07-2012: Version 2.31:

                - - - -

                22-06-2012: Version 2.3:

                - -
                  -
                • New scrollbar implementation. Should flicker less. Changes DOM structure of the editor.
                • -
                • New theme: vibrant-ink.
                • -
                • Many extensions to the VIM keymap (including text objects).
                • -
                • Add mode-multiplexing utility script.
                • -
                • Fix bug where right-click paste works in read-only mode.
                • -
                • Add a getScrollInfo method.
                • -
                • Lots of other fixes.
                • -
                - -

                23-05-2012: Version 2.25:

                - -
                  -
                • New mode: Erlang.
                • -
                • Remove xmlpure mode (use xml.js).
                • -
                • Fix line-wrapping in Opera.
                • -
                • Fix X Windows middle-click paste in Chrome.
                • -
                • Fix bug that broke pasting of huge documents.
                • -
                • Fix backspace and tab key repeat in Opera.
                • -
                - -

                23-04-2012: Version 2.24:

                - -
                  -
                • Drop support for Internet Explorer 6.
                • -
                • New - modes: Shell, Tiki - wiki, Pig Latin.
                • -
                • New themes: Ambiance, Blackboard.
                • -
                • More control over drag/drop - with dragDrop - and onDragEvent - options.
                • -
                • Make HTML mode a bit less pedantic.
                • -
                • Add compoundChange API method.
                • -
                • Several fixes in undo history and line hiding.
                • -
                • Remove (broken) support for catchall in key maps, - add nofallthrough boolean field instead.
                • -
                - -

                26-03-2012: Version 2.23:

                - -
                  -
                • Change default binding for tab [more] - -
                • -
                • New modes: XQuery and VBScript.
                • -
                • Two new themes: lesser-dark and xq-dark.
                • -
                • Differentiate between background and text styles in setLineClass.
                • -
                • Fix drag-and-drop in IE9+.
                • -
                • Extend charCoords - and cursorCoords with a mode argument.
                • -
                • Add autofocus option.
                • -
                • Add findMarksAt method.
                • -
                - -

                27-02-2012: Version 2.22:

                - - - -

                27-01-2012: Version 2.21:

                - -
                  -
                • Added LESS, MySQL, - Go, and Verilog modes.
                • -
                • Add smartIndent - option.
                • -
                • Support a cursor in readOnly-mode.
                • -
                • Support assigning multiple styles to a token.
                • -
                • Use a new approach to drawing the selection.
                • -
                • Add scrollTo method.
                • -
                • Allow undo/redo events to span non-adjacent lines.
                • -
                • Lots and lots of bugfixes.
                • -
                - -

                20-12-2011: Version 2.2:

                - - - -

                21-11-2011: Version 2.18:

                -

                Fixes TextMarker.clear, which is broken in 2.17.

                - -

                21-11-2011: Version 2.17:

                -
                  -
                • Add support for line - wrapping and code - folding.
                • -
                • Add Github-style Markdown mode.
                • -
                • Add Monokai - and Rubyblue themes.
                • -
                • Add setBookmark method.
                • -
                • Move some of the demo code into reusable components - under lib/util.
                • -
                • Make screen-coord-finding code faster and more reliable.
                • -
                • Fix drag-and-drop in Firefox.
                • -
                • Improve support for IME.
                • -
                • Speed up content rendering.
                • -
                • Fix browser's built-in search in Webkit.
                • -
                • Make double- and triple-click work in IE.
                • -
                • Various fixes to modes.
                • -
                - -

                27-10-2011: Version 2.16:

                -
                  -
                • Add Perl, Rust, TiddlyWiki, and Groovy modes.
                • -
                • Dragging text inside the editor now moves, rather than copies.
                • -
                • Add a coordsFromIndex method.
                • -
                • API change: setValue now no longer clears history. Use clearHistory for that.
                • -
                • API change: markText now - returns an object with clear and find - methods. Marked text is now more robust when edited.
                • -
                • Fix editing code with tabs in Internet Explorer.
                • -
                - -

                26-09-2011: Version 2.15:

                -

                Fix bug that snuck into 2.14: Clicking the - character that currently has the cursor didn't re-focus the - editor.

                - -

                26-09-2011: Version 2.14:

                - - - -

                23-08-2011: Version 2.13:

                - - -

                25-07-2011: Version 2.12:

                -
                  -
                • Add a SPARQL mode.
                • -
                • Fix bug with cursor jumping around in an unfocused editor in IE.
                • -
                • Allow key and mouse events to bubble out of the editor. Ignore widget clicks.
                • -
                • Solve cursor flakiness after undo/redo.
                • -
                • Fix block-reindent ignoring the last few lines.
                • -
                • Fix parsing of multi-line attrs in XML mode.
                • -
                • Use innerHTML for HTML-escaping.
                • -
                • Some fixes to indentation in C-like mode.
                • -
                • Shrink horiz scrollbars when long lines removed.
                • -
                • Fix width feedback loop bug that caused the width of an inner DIV to shrink.
                • -
                - -

                04-07-2011: Version 2.11:

                -
                  -
                • Add a Scheme mode.
                • -
                • Add a replace method to search cursors, for cursor-preserving replacements.
                • -
                • Make the C-like mode mode more customizable.
                • -
                • Update XML mode to spot mismatched tags.
                • -
                • Add getStateAfter API and compareState mode API methods for finer-grained mode magic.
                • -
                • Add a getScrollerElement API method to manipulate the scrolling DIV.
                • -
                • Fix drag-and-drop for Firefox.
                • -
                • Add a C# configuration for the C-like mode.
                • -
                • Add full-screen editing and mode-changing demos.
                • -
                - -

                07-06-2011: Version 2.1:

                -

                Add - a theme system - (demo). Note that this is not - backwards-compatible—you'll have to update your styles and - modes!

                - -

                07-06-2011: Version 2.02:

                -
                  -
                • Add a Lua mode.
                • -
                • Fix reverse-searching for a regexp.
                • -
                • Empty lines can no longer break highlighting.
                • -
                • Rework scrolling model (the outer wrapper no longer does the scrolling).
                • -
                • Solve horizontal jittering on long lines.
                • -
                • Add runmode.js.
                • -
                • Immediately re-highlight text when typing.
                • -
                • Fix problem with 'sticking' horizontal scrollbar.
                • -
                - -

                26-05-2011: Version 2.01:

                -
                  -
                • Add a Smalltalk mode.
                • -
                • Add a reStructuredText mode.
                • -
                • Add a Python mode.
                • -
                • Add a PL/SQL mode.
                • -
                • coordsChar now works
                • -
                • Fix a problem where onCursorActivity interfered with onChange.
                • -
                • Fix a number of scrolling and mouse-click-position glitches.
                • -
                • Pass information about the changed lines to onChange.
                • -
                • Support cmd-up/down on OS X.
                • -
                • Add triple-click line selection.
                • -
                • Don't handle shift when changing the selection through the API.
                • -
                • Support "nocursor" mode for readOnly option.
                • -
                • Add an onHighlightComplete option.
                • -
                • Fix the context menu for Firefox.
                • -
                - -

                28-03-2011: Version 2.0:

                -

                CodeMirror 2 is a complete rewrite that's - faster, smaller, simpler to use, and less dependent on browser - quirks. See this - and this - for more information.

                - -

                22-02-2011: Version 2.0 beta 2:

                -

                Somewhat more mature API, lots of bugs shaken out.

                - -

                17-02-2011: Version 0.94:

                -
                  -
                • tabMode: "spaces" was modified slightly (now indents when something is selected).
                • -
                • Fixes a bug that would cause the selection code to break on some IE versions.
                • -
                • Disabling spell-check on WebKit browsers now works.
                • -
                - -

                08-02-2011: Version 2.0 beta 1:

                -

                CodeMirror 2 is a complete rewrite of - CodeMirror, no longer depending on an editable frame.

                - -

                19-01-2011: Version 0.93:

                -
                  -
                • Added a Regular Expression parser.
                • -
                • Fixes to the PHP parser.
                • -
                • Support for regular expression in search/replace.
                • -
                • Add save method to instances created with fromTextArea.
                • -
                • Add support for MS T-SQL in the SQL parser.
                • -
                • Support use of CSS classes for highlighting brackets.
                • -
                • Fix yet another hang with line-numbering in hidden editors.
                • -
                -
                - -
                - -

                Version 0.x

                - -

                28-03-2011: Version 1.0:

                -
                  -
                • Fix error when debug history overflows.
                • -
                • Refine handling of C# verbatim strings.
                • -
                • Fix some issues with JavaScript indentation.
                • -
                - -

                17-12-2010: Version 0.92:

                -
                  -
                • Make CodeMirror work in XHTML documents.
                • -
                • Fix bug in handling of backslashes in Python strings.
                • -
                • The styleNumbers option is now officially - supported and documented.
                • -
                • onLineNumberClick option added.
                • -
                • More consistent names onLoad and - onCursorActivity callbacks. Old names still work, but - are deprecated.
                • -
                • Add a Freemarker mode.
                • -
                - -

                11-11-2010: Version 0.91:

                -
                  -
                • Adds support for Java.
                • -
                • Small additions to the PHP and SQL parsers.
                • -
                • Work around various Webkit issues.
                • -
                • Fix toTextArea to update the code in the textarea.
                • -
                • Add a noScriptCaching option (hack to ease development).
                • -
                • Make sub-modes of HTML mixed mode configurable.
                • -
                - -

                02-10-2010: Version 0.9:

                -
                  -
                • Add support for searching backwards.
                • -
                • There are now parsers for Scheme, XQuery, and OmetaJS.
                • -
                • Makes height: "dynamic" more robust.
                • -
                • Fixes bug where paste did not work on OS X.
                • -
                • Add a enterMode and electricChars options to make indentation even more customizable.
                • -
                • Add firstLineNumber option.
                • -
                • Fix bad handling of @media rules by the CSS parser.
                • -
                • Take a new, more robust approach to working around the invisible-last-line bug in WebKit.
                • -
                - -

                22-07-2010: Version 0.8:

                -
                  -
                • Add a cursorCoords method to find the screen - coordinates of the cursor.
                • -
                • A number of fixes and support for more syntax in the PHP parser.
                • -
                • Fix indentation problem with JSON-mode JS parser in Webkit.
                • -
                • Add a minification UI.
                • -
                • Support a height: dynamic mode, where the editor's - height will adjust to the size of its content.
                • -
                • Better support for IME input mode.
                • -
                • Fix JavaScript parser getting confused when seeing a no-argument - function call.
                • -
                • Have CSS parser see the difference between selectors and other - identifiers.
                • -
                • Fix scrolling bug when pasting in a horizontally-scrolled - editor.
                • -
                • Support toTextArea method in instances created with - fromTextArea.
                • -
                • Work around new Opera cursor bug that causes the cursor to jump - when pressing backspace at the end of a line.
                • -
                - -

                27-04-2010: Version - 0.67:

                -

                More consistent page-up/page-down behaviour - across browsers. Fix some issues with hidden editors looping forever - when line-numbers were enabled. Make PHP parser parse - "\\" correctly. Have jumpToLine work on - line handles, and add cursorLine function to fetch the - line handle where the cursor currently is. Add new - setStylesheet function to switch style-sheets in a - running editor.

                - -

                01-03-2010: Version - 0.66:

                -

                Adds removeLine method to API. - Introduces the PLSQL parser. - Marks XML errors by adding (rather than replacing) a CSS class, so - that they can be disabled by modifying their style. Fixes several - selection bugs, and a number of small glitches.

                - -

                12-11-2009: Version - 0.65:

                -

                Add support for having both line-wrapping and - line-numbers turned on, make paren-highlighting style customisable - (markParen and unmarkParen config - options), work around a selection bug that Opera - reintroduced in version 10.

                - -

                23-10-2009: Version - 0.64:

                -

                Solves some issues introduced by the - paste-handling changes from the previous release. Adds - setSpellcheck, setTextWrapping, - setIndentUnit, setUndoDepth, - setTabMode, and setLineNumbers to - customise a running editor. Introduces an SQL parser. Fixes a few small - problems in the Python - parser. And, as usual, add workarounds for various newly discovered - browser incompatibilities.

                - -

                31-08-2009: Version 0.63:

                -

                Overhaul of paste-handling (less fragile), fixes for several - serious IE8 issues (cursor jumping, end-of-document bugs) and a number - of small problems.

                - -

                30-05-2009: Version 0.62:

                -

                Introduces Python - and Lua parsers. Add - setParser (on-the-fly mode changing) and - clearHistory methods. Make parsing passes time-based - instead of lines-based (see the passTime option).

                - -
                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/reporting.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/reporting.html deleted file mode 100644 index 3c582d9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/reporting.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: Reporting Bugs - - - - - -
                - -

                Reporting bugs effectively

                - -
                - -

                So you found a problem in CodeMirror. By all means, report it! Bug -reports from users are the main drive behind improvements to -CodeMirror. But first, please read over these points:

                - -
                  -
                1. CodeMirror is maintained by volunteers. They don't owe you - anything, so be polite. Reports with an indignant or belligerent - tone tend to be moved to the bottom of the pile.
                2. - -
                3. Include information about the browser in which the - problem occurred. Even if you tested several browsers, and - the problem occurred in all of them, mention this fact in the bug - report. Also include browser version numbers and the operating - system that you're on.
                4. - -
                5. Mention which release of CodeMirror you're using. Preferably, - try also with the current development snapshot, to ensure the - problem has not already been fixed.
                6. - -
                7. Mention very precisely what went wrong. "X is broken" is not a - good bug report. What did you expect to happen? What happened - instead? Describe the exact steps a maintainer has to take to make - the problem occur. We can not fix something that we can not - observe.
                8. - -
                9. If the problem can not be reproduced in any of the demos - included in the CodeMirror distribution, please provide an HTML - document that demonstrates the problem. The best way to do this is - to go to jsbin.com, enter - it there, press save, and include the resulting link in your bug - report.
                10. -
                - -
                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v2.2.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v2.2.html deleted file mode 100644 index 3948ce6..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v2.2.html +++ /dev/null @@ -1,96 +0,0 @@ - - -CodeMirror: Version 2.2 upgrade guide - - - - - -
                - -

                Upgrading to v2.2

                - -

                There are a few things in the 2.2 release that require some care -when upgrading.

                - -

                No more default.css

                - -

                The default theme is now included -in codemirror.css, so -you do not have to included it separately anymore. (It was tiny, so -even if you're not using it, the extra data overhead is negligible.) - -

                Different key customization

                - -

                CodeMirror has moved to a system -where keymaps are used to -bind behavior to keys. This means custom -bindings are now possible.

                - -

                Three options that influenced key -behavior, tabMode, enterMode, -and smartHome, are no longer supported. Instead, you can -provide custom bindings to influence the way these keys act. This is -done through the -new extraKeys -option, which can hold an object mapping key names to functionality. A -simple example would be:

                - -
                  extraKeys: {
                -    "Ctrl-S": function(instance) { saveText(instance.getValue()); },
                -    "Ctrl-/": "undo"
                -  }
                - -

                Keys can be mapped either to functions, which will be given the -editor instance as argument, or to strings, which are mapped through -functions through the CodeMirror.commands table, which -contains all the built-in editing commands, and can be inspected and -extended by external code.

                - -

                By default, the Home key is bound to -the "goLineStartSmart" command, which moves the cursor to -the first non-whitespace character on the line. You can set do this to -make it always go to the very start instead:

                - -
                  extraKeys: {"Home": "goLineStart"}
                - -

                Similarly, Enter is bound -to "newlineAndIndent" by default. You can bind it to -something else to get different behavior. To disable special handling -completely and only get a newline character inserted, you can bind it -to false:

                - -
                  extraKeys: {"Enter": false}
                - -

                The same works for Tab. If you don't want CodeMirror -to handle it, bind it to false. The default behaviour is -to indent the current line more ("indentMore" command), -and indent it less when shift is held ("indentLess"). -There are also "indentAuto" (smart indent) -and "insertTab" commands provided for alternate -behaviors. Or you can write your own handler function to do something -different altogether.

                - -

                Tabs

                - -

                Handling of tabs changed completely. The display width of tabs can -now be set with the tabSize option, and tabs can -be styled by setting CSS rules -for the cm-tab class.

                - -

                The default width for tabs is now 4, as opposed to the 8 that is -hard-wired into browsers. If you are relying on 8-space tabs, make -sure you explicitly set tabSize: 8 in your options.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v3.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v3.html deleted file mode 100644 index 5f94067..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v3.html +++ /dev/null @@ -1,230 +0,0 @@ - - -CodeMirror: Version 3 upgrade guide - - - - - - - - - - - - - - -
                - -

                Upgrading to version 3

                - -

                Version 3 does not depart too much from 2.x API, and sites that use -CodeMirror in a very simple way might be able to upgrade without -trouble. But it does introduce a number of incompatibilities. Please -at least skim this text before upgrading.

                - -

                Note that version 3 drops full support for Internet -Explorer 7. The editor will mostly work on that browser, but -it'll be significantly glitchy.

                - -
                -

                DOM structure

                - -

                This one is the most likely to cause problems. The internal -structure of the editor has changed quite a lot, mostly to implement a -new scrolling model.

                - -

                Editor height is now set on the outer wrapper element (CSS -class CodeMirror), not on the scroller element -(CodeMirror-scroll).

                - -

                Other nodes were moved, dropped, and added. If you have any code -that makes assumptions about the internal DOM structure of the editor, -you'll have to re-test it and probably update it to work with v3.

                - -

                See the styling section of the -manual for more information.

                -
                -
                -

                Gutter model

                - -

                In CodeMirror 2.x, there was a single gutter, and line markers -created with setMarker would have to somehow coexist with -the line numbers (if present). Version 3 allows you to specify an -array of gutters, by class -name, -use setGutterMarker -to add or remove markers in individual gutters, and clear whole -gutters -with clearGutter. -Gutter markers are now specified as DOM nodes, rather than HTML -snippets.

                - -

                The gutters no longer horizontally scrolls along with the content. -The fixedGutter option was removed (since it is now the -only behavior).

                - -
                -<style>
                -  /* Define a gutter style */
                -  .note-gutter { width: 3em; background: cyan; }
                -</style>
                -<script>
                -  // Create an instance with two gutters -- line numbers and notes
                -  var cm = new CodeMirror(document.body, {
                -    gutters: ["note-gutter", "CodeMirror-linenumbers"],
                -    lineNumbers: true
                -  });
                -  // Add a note to line 0
                -  cm.setGutterMarker(0, "note-gutter", document.createTextNode("hi"));
                -</script>
                -
                -
                -
                -

                Event handling

                - -

                Most of the onXYZ options have been removed. The same -effect is now obtained by calling -the on method with a string -identifying the event type. Multiple handlers can now be registered -(and individually unregistered) for an event, and objects such as line -handlers now also expose events. See the -full list here.

                - -

                (The onKeyEvent and onDragEvent options, -which act more as hooks than as event handlers, are still there in -their old form.)

                - -
                -cm.on("change", function(cm, change) {
                -  console.log("something changed! (" + change.origin + ")");
                -});
                -
                -
                -
                -

                markText method arguments

                - -

                The markText method -(which has gained some interesting new features, such as creating -atomic and read-only spans, or replacing spans with widgets) no longer -takes the CSS class name as a separate argument, but makes it an -optional field in the options object instead.

                - -
                -// Style first ten lines, and forbid the cursor from entering them
                -cm.markText({line: 0, ch: 0}, {line: 10, ch: 0}, {
                -  className: "magic-text",
                -  inclusiveLeft: true,
                -  atomic: true
                -});
                -
                -
                -
                -

                Line folding

                - -

                The interface for hiding lines has been -removed. markText can -now be used to do the same in a more flexible and powerful way.

                - -

                The folding script has been -updated to use the new interface, and should now be more robust.

                - -
                -// Fold a range, replacing it with the text "??"
                -var range = cm.markText({line: 4, ch: 2}, {line: 8, ch: 1}, {
                -  replacedWith: document.createTextNode("??"),
                -  // Auto-unfold when cursor moves into the range
                -  clearOnEnter: true
                -});
                -// Get notified when auto-unfolding
                -CodeMirror.on(range, "clear", function() {
                -  console.log("boom");
                -});
                -
                -
                -
                -

                Line CSS classes

                - -

                The setLineClass method has been replaced -by addLineClass -and removeLineClass, -which allow more modular control over the classes attached to a line.

                - -
                -var marked = cm.addLineClass(10, "background", "highlighted-line");
                -setTimeout(function() {
                -  cm.removeLineClass(marked, "background", "highlighted-line");
                -});
                -
                -
                -
                -

                Position properties

                - -

                All methods that take or return objects that represent screen -positions now use {left, top, bottom, right} properties -(not always all of them) instead of the {x, y, yBot} used -by some methods in v2.x.

                - -

                Affected methods -are cursorCoords, charCoords, coordsChar, -and getScrollInfo.

                -
                -
                -

                Bracket matching no longer in core

                - -

                The matchBrackets -option is no longer defined in the core editor. -Load addon/edit/matchbrackets.js to enable it.

                -
                -
                -

                Mode management

                - -

                The CodeMirror.listModes -and CodeMirror.listMIMEs functions, used for listing -defined modes, are gone. You are now encouraged to simply -inspect CodeMirror.modes (mapping mode names to mode -constructors) and CodeMirror.mimeModes (mapping MIME -strings to mode specs).

                -
                -
                -

                New features

                - -

                Some more reasons to upgrade to version 3.

                - -
                  -
                • Bi-directional text support. CodeMirror will now mostly do the - right thing when editing Arabic or Hebrew text.
                • -
                • Arbitrary line heights. Using fonts with different heights - inside the editor (whether off by one pixel or fifty) is now - supported and handled gracefully.
                • -
                • In-line widgets. See the demo - and the docs.
                • -
                • Defining custom options - with CodeMirror.defineOption.
                • -
                -
                -
                - - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v4.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v4.html deleted file mode 100644 index 09df00c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v4.html +++ /dev/null @@ -1,144 +0,0 @@ - - -CodeMirror: Version 4 upgrade guide - - - - - - -
                - -

                Upgrading to version 4

                - -

                CodeMirror 4's interface is very close version 3, but it -does fix a few awkward details in a backwards-incompatible ways. At -least skim the text below before upgrading.

                - -

                Multiple selections

                - -

                The main new feature in version 4 is multiple selections. The -single-selection variants of methods are still there, but now -typically act only on the primary selection (usually the last -one added).

                - -

                The exception to this -is getSelection, -which will now return the content of all selections -(separated by newlines, or whatever lineSep parameter you passed -it).

                - -
                - -

                The beforeSelectionChange event

                - -

                This event still exists, but the object it is passed has -a completely new -interface, because such changes now concern multiple -selections.

                - -
                - -

                replaceSelection's collapsing behavior

                - -

                By -default, replaceSelection -would leave the newly inserted text selected. This is only rarely what -you want, and also (slightly) more expensive in the new model, so the -default was changed to "end", meaning the old behavior -must be explicitly specified by passing a second argument -of "around".

                - -
                - -

                change event data

                - -

                Rather than forcing client code to follow next -pointers from one change object to the next, the library will now -simply fire -multiple "change" -events. Existing code will probably continue to work unmodified.

                - -
                - -

                showIfHidden option to line widgets

                - -

                This option, which conceptually caused line widgets to be visible -even if their line was hidden, was never really well-defined, and was -buggy from the start. It would be a rather expensive feature, both in -code complexity and run-time performance, to implement properly. It -has been dropped entirely in 4.0.

                - -
                - -

                Module loaders

                - -

                All modules in the CodeMirror distribution are now wrapped in a -shim function to make them compatible with both AMD -(requirejs) and CommonJS (as used -by node -and browserify) module loaders. -When neither of these is present, they fall back to simply using the -global CodeMirror variable.

                - -

                If you have a module loader present in your environment, CodeMirror -will attempt to use it, and you might need to change the way you load -CodeMirror modules.

                - -
                - -

                Mutating shared data structures

                - -

                Data structures produced by the library should not be mutated -unless explicitly allowed, in general. This is slightly more strict in -4.0 than it was in earlier versions, which copied the position objects -returned by getCursor -for nebulous, historic reasons. In 4.0, mutating these -objects will corrupt your editor's selection.

                - -
                - -

                Deprecated interfaces dropped

                - -

                A few properties and methods that have been deprecated for a while -are now gone. Most notably, the onKeyEvent -and onDragEvent options (use the -corresponding events instead).

                - -

                Two silly methods, which were mostly there to stay close to the 0.x -API, setLine and removeLine are now gone. -Use the more -flexible replaceRange -method instead.

                - -

                The long names for folding and completing functions -(CodeMirror.braceRangeFinder, CodeMirror.javascriptHint, -etc) are also gone -(use CodeMirror.fold.brace, CodeMirror.hint.javascript).

                - -

                The className property in the return value -of getTokenAt, which -has been superseded by the type property, is also no -longer present.

                - -
                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/yinyang.png b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/yinyang.png deleted file mode 100644 index 2eafd3f..0000000 Binary files a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/yinyang.png and /dev/null differ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/index.html deleted file mode 100644 index bca7e02..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/index.html +++ /dev/null @@ -1,199 +0,0 @@ - - -CodeMirror - - - - - - - - - - - - - - - - - -
                - -
                -

                CodeMirror is a versatile text editor - implemented in JavaScript for the browser. It is specialized for - editing code, and comes with a number of language modes and addons - that implement more advanced editing functionality.

                - -

                A rich programming API and a - CSS theming system are - available for customizing CodeMirror to fit your application, and - extending it with new functionality.

                -
                - -
                -

                This is CodeMirror

                -
                -
                - - -
                -
                - - - -
                -
                - Get the current version: 5.5.
                - You can see the code or
                - read the release notes.
                - There is a minification helper. -
                -
                - Software needs maintenance,
                - maintainers need to subsist.
                - Current funding status =
                - You can help per month or - once. -
                - - -
                -
                -
                - -
                - -
                -

                Features

                - -
                - -
                -

                Community

                - -

                CodeMirror is an open-source project shared under - an MIT license. It is the editor used in the - dev tools for - both Firefox - and Chrome, Light - Table, Adobe - Brackets, Bitbucket, - and many other projects.

                - -

                Development and bug tracking happens - on github - (alternate git - repository). - Please read these - pointers before submitting a bug. Use pull requests to submit - patches. All contributions must be released under the same MIT - license that CodeMirror uses.

                - -

                Discussion around the project is done on - a discussion forum. - There is also - the codemirror-announce - list, which is only used for major announcements (such as new - versions). If needed, you can - contact the maintainer - directly. We aim to be an inclusive, welcoming community. To make - that explicit, we have - a code of - conduct that applies to communication around the project.

                - -

                A list of CodeMirror-related software that is not part of the - main distribution is maintained - on our - wiki. Feel free to add your project.

                -
                - -
                -

                Browser support

                -

                The desktop versions of the following browsers, - in standards mode (HTML5 <!doctype html> - recommended) are supported:

                - - - - - - -
                Firefoxversion 4 and up
                Chromeany version
                Safariversion 5.2 and up
                Internet Explorerversion 8 and up
                Operaversion 9 and up
                -

                Support for modern mobile browsers is experimental. Recent - versions of the iOS browser and Chrome on Android should work - pretty well.

                -
                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/emacs.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/emacs.js deleted file mode 100644 index 3eec1e5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/emacs.js +++ /dev/null @@ -1,412 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - function posEq(a, b) { return a.line == b.line && a.ch == b.ch; } - - // Kill 'ring' - - var killRing = []; - function addToRing(str) { - killRing.push(str); - if (killRing.length > 50) killRing.shift(); - } - function growRingTop(str) { - if (!killRing.length) return addToRing(str); - killRing[killRing.length - 1] += str; - } - function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || ""; } - function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); } - - var lastKill = null; - - function kill(cm, from, to, mayGrow, text) { - if (text == null) text = cm.getRange(from, to); - - if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen)) - growRingTop(text); - else - addToRing(text); - cm.replaceRange("", from, to, "+delete"); - - if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()}; - else lastKill = null; - } - - // Boundaries of various units - - function byChar(cm, pos, dir) { - return cm.findPosH(pos, dir, "char", true); - } - - function byWord(cm, pos, dir) { - return cm.findPosH(pos, dir, "word", true); - } - - function byLine(cm, pos, dir) { - return cm.findPosV(pos, dir, "line", cm.doc.sel.goalColumn); - } - - function byPage(cm, pos, dir) { - return cm.findPosV(pos, dir, "page", cm.doc.sel.goalColumn); - } - - function byParagraph(cm, pos, dir) { - var no = pos.line, line = cm.getLine(no); - var sawText = /\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch)); - var fst = cm.firstLine(), lst = cm.lastLine(); - for (;;) { - no += dir; - if (no < fst || no > lst) - return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null)); - line = cm.getLine(no); - var hasText = /\S/.test(line); - if (hasText) sawText = true; - else if (sawText) return Pos(no, 0); - } - } - - function bySentence(cm, pos, dir) { - var line = pos.line, ch = pos.ch; - var text = cm.getLine(pos.line), sawWord = false; - for (;;) { - var next = text.charAt(ch + (dir < 0 ? -1 : 0)); - if (!next) { // End/beginning of line reached - if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch); - text = cm.getLine(line + dir); - if (!/\S/.test(text)) return Pos(line, ch); - line += dir; - ch = dir < 0 ? text.length : 0; - continue; - } - if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0)); - if (!sawWord) sawWord = /\w/.test(next); - ch += dir; - } - } - - function byExpr(cm, pos, dir) { - var wrap; - if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true)) - && wrap.match && (wrap.forward ? 1 : -1) == dir) - return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to; - - for (var first = true;; first = false) { - var token = cm.getTokenAt(pos); - var after = Pos(pos.line, dir < 0 ? token.start : token.end); - if (first && dir > 0 && token.end == pos.ch || !/\w/.test(token.string)) { - var newPos = cm.findPosH(after, dir, "char"); - if (posEq(after, newPos)) return pos; - else pos = newPos; - } else { - return after; - } - } - } - - // Prefixes (only crudely supported) - - function getPrefix(cm, precise) { - var digits = cm.state.emacsPrefix; - if (!digits) return precise ? null : 1; - clearPrefix(cm); - return digits == "-" ? -1 : Number(digits); - } - - function repeated(cmd) { - var f = typeof cmd == "string" ? function(cm) { cm.execCommand(cmd); } : cmd; - return function(cm) { - var prefix = getPrefix(cm); - f(cm); - for (var i = 1; i < prefix; ++i) f(cm); - }; - } - - function findEnd(cm, pos, by, dir) { - var prefix = getPrefix(cm); - if (prefix < 0) { dir = -dir; prefix = -prefix; } - for (var i = 0; i < prefix; ++i) { - var newPos = by(cm, pos, dir); - if (posEq(newPos, pos)) break; - pos = newPos; - } - return pos; - } - - function move(by, dir) { - var f = function(cm) { - cm.extendSelection(findEnd(cm, cm.getCursor(), by, dir)); - }; - f.motion = true; - return f; - } - - function killTo(cm, by, dir) { - var selections = cm.listSelections(), cursor; - var i = selections.length; - while (i--) { - cursor = selections[i].head; - kill(cm, cursor, findEnd(cm, cursor, by, dir), true); - } - } - - function killRegion(cm) { - if (cm.somethingSelected()) { - var selections = cm.listSelections(), selection; - var i = selections.length; - while (i--) { - selection = selections[i]; - kill(cm, selection.anchor, selection.head); - } - return true; - } - } - - function addPrefix(cm, digit) { - if (cm.state.emacsPrefix) { - if (digit != "-") cm.state.emacsPrefix += digit; - return; - } - // Not active yet - cm.state.emacsPrefix = digit; - cm.on("keyHandled", maybeClearPrefix); - cm.on("inputRead", maybeDuplicateInput); - } - - var prefixPreservingKeys = {"Alt-G": true, "Ctrl-X": true, "Ctrl-Q": true, "Ctrl-U": true}; - - function maybeClearPrefix(cm, arg) { - if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg)) - clearPrefix(cm); - } - - function clearPrefix(cm) { - cm.state.emacsPrefix = null; - cm.off("keyHandled", maybeClearPrefix); - cm.off("inputRead", maybeDuplicateInput); - } - - function maybeDuplicateInput(cm, event) { - var dup = getPrefix(cm); - if (dup > 1 && event.origin == "+input") { - var one = event.text.join("\n"), txt = ""; - for (var i = 1; i < dup; ++i) txt += one; - cm.replaceSelection(txt); - } - } - - function addPrefixMap(cm) { - cm.state.emacsPrefixMap = true; - cm.addKeyMap(prefixMap); - cm.on("keyHandled", maybeRemovePrefixMap); - cm.on("inputRead", maybeRemovePrefixMap); - } - - function maybeRemovePrefixMap(cm, arg) { - if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return; - cm.removeKeyMap(prefixMap); - cm.state.emacsPrefixMap = false; - cm.off("keyHandled", maybeRemovePrefixMap); - cm.off("inputRead", maybeRemovePrefixMap); - } - - // Utilities - - function setMark(cm) { - cm.setCursor(cm.getCursor()); - cm.setExtending(!cm.getExtending()); - cm.on("change", function() { cm.setExtending(false); }); - } - - function clearMark(cm) { - cm.setExtending(false); - cm.setCursor(cm.getCursor()); - } - - function getInput(cm, msg, f) { - if (cm.openDialog) - cm.openDialog(msg + ": ", f, {bottom: true}); - else - f(prompt(msg, "")); - } - - function operateOnWord(cm, op) { - var start = cm.getCursor(), end = cm.findPosH(start, 1, "word"); - cm.replaceRange(op(cm.getRange(start, end)), start, end); - cm.setCursor(end); - } - - function toEnclosingExpr(cm) { - var pos = cm.getCursor(), line = pos.line, ch = pos.ch; - var stack = []; - while (line >= cm.firstLine()) { - var text = cm.getLine(line); - for (var i = ch == null ? text.length : ch; i > 0;) { - var ch = text.charAt(--i); - if (ch == ")") - stack.push("("); - else if (ch == "]") - stack.push("["); - else if (ch == "}") - stack.push("{"); - else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch)) - return cm.extendSelection(Pos(line, i)); - } - --line; ch = null; - } - } - - function quit(cm) { - cm.execCommand("clearSearch"); - clearMark(cm); - } - - // Actual keymap - - var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({ - "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));}, - "Ctrl-K": repeated(function(cm) { - var start = cm.getCursor(), end = cm.clipPos(Pos(start.line)); - var text = cm.getRange(start, end); - if (!/\S/.test(text)) { - text += "\n"; - end = Pos(start.line + 1, 0); - } - kill(cm, start, end, true, text); - }), - "Alt-W": function(cm) { - addToRing(cm.getSelection()); - clearMark(cm); - }, - "Ctrl-Y": function(cm) { - var start = cm.getCursor(); - cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste"); - cm.setSelection(start, cm.getCursor()); - }, - "Alt-Y": function(cm) {cm.replaceSelection(popFromRing(), "around", "paste");}, - - "Ctrl-Space": setMark, "Ctrl-Shift-2": setMark, - - "Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1), - "Right": move(byChar, 1), "Left": move(byChar, -1), - "Ctrl-D": function(cm) { killTo(cm, byChar, 1); }, - "Delete": function(cm) { killRegion(cm) || killTo(cm, byChar, 1); }, - "Ctrl-H": function(cm) { killTo(cm, byChar, -1); }, - "Backspace": function(cm) { killRegion(cm) || killTo(cm, byChar, -1); }, - - "Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1), - "Alt-D": function(cm) { killTo(cm, byWord, 1); }, - "Alt-Backspace": function(cm) { killTo(cm, byWord, -1); }, - - "Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1), - "Down": move(byLine, 1), "Up": move(byLine, -1), - "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "End": "goLineEnd", "Home": "goLineStart", - - "Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1), - "PageUp": move(byPage, -1), "PageDown": move(byPage, 1), - - "Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1), - - "Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1), - "Alt-K": function(cm) { killTo(cm, bySentence, 1); }, - - "Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1); }, - "Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1); }, - "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1), - - "Shift-Ctrl-Alt-2": function(cm) { - var cursor = cm.getCursor(); - cm.setSelection(findEnd(cm, cursor, byExpr, 1), cursor); - }, - "Ctrl-Alt-T": function(cm) { - var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1); - var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1); - cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) + - cm.getRange(leftStart, leftEnd), leftStart, rightEnd); - }, - "Ctrl-Alt-U": repeated(toEnclosingExpr), - - "Alt-Space": function(cm) { - var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line); - while (from && /\s/.test(text.charAt(from - 1))) --from; - while (to < text.length && /\s/.test(text.charAt(to))) ++to; - cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to)); - }, - "Ctrl-O": repeated(function(cm) { cm.replaceSelection("\n", "start"); }), - "Ctrl-T": repeated(function(cm) { - cm.execCommand("transposeChars"); - }), - - "Alt-C": repeated(function(cm) { - operateOnWord(cm, function(w) { - var letter = w.search(/\w/); - if (letter == -1) return w; - return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase(); - }); - }), - "Alt-U": repeated(function(cm) { - operateOnWord(cm, function(w) { return w.toUpperCase(); }); - }), - "Alt-L": repeated(function(cm) { - operateOnWord(cm, function(w) { return w.toLowerCase(); }); - }), - - "Alt-;": "toggleComment", - - "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"), - "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"), - "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd", - "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace", - "Alt-/": "autocomplete", - "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto", - - "Alt-G G": function(cm) { - var prefix = getPrefix(cm, true); - if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1); - - getInput(cm, "Goto line", function(str) { - var num; - if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0) - cm.setCursor(num - 1); - }); - }, - - "Ctrl-X Tab": function(cm) { - cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit")); - }, - "Ctrl-X Ctrl-X": function(cm) { - cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor")); - }, - "Ctrl-X Ctrl-S": "save", - "Ctrl-X Ctrl-W": "save", - "Ctrl-X S": "saveAll", - "Ctrl-X F": "open", - "Ctrl-X U": repeated("undo"), - "Ctrl-X K": "close", - "Ctrl-X Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); }, - "Ctrl-X H": "selectAll", - - "Ctrl-Q Tab": repeated("insertTab"), - "Ctrl-U": addPrefixMap - }); - - var prefixMap = {"Ctrl-G": clearPrefix}; - function regPrefix(d) { - prefixMap[d] = function(cm) { addPrefix(cm, d); }; - keyMap["Ctrl-" + d] = function(cm) { addPrefix(cm, d); }; - prefixPreservingKeys["Ctrl-" + d] = true; - } - for (var i = 0; i < 10; ++i) regPrefix(String(i)); - regPrefix("-"); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/sublime.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/sublime.js deleted file mode 100644 index 1d9a9d8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/sublime.js +++ /dev/null @@ -1,555 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// A rough approximation of Sublime Text's keybindings -// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/edit/matchbrackets")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/edit/matchbrackets"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var map = CodeMirror.keyMap.sublime = {fallthrough: "default"}; - var cmds = CodeMirror.commands; - var Pos = CodeMirror.Pos; - var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault; - var ctrl = mac ? "Cmd-" : "Ctrl-"; - - // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that. - function findPosSubword(doc, start, dir) { - if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1)); - var line = doc.getLine(start.line); - if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0)); - var state = "start", type; - for (var pos = start.ch, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) { - var next = line.charAt(dir < 0 ? pos - 1 : pos); - var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o"; - if (cat == "w" && next.toUpperCase() == next) cat = "W"; - if (state == "start") { - if (cat != "o") { state = "in"; type = cat; } - } else if (state == "in") { - if (type != cat) { - if (type == "w" && cat == "W" && dir < 0) pos--; - if (type == "W" && cat == "w" && dir > 0) { type = "w"; continue; } - break; - } - } - } - return Pos(start.line, pos); - } - - function moveSubword(cm, dir) { - cm.extendSelectionsBy(function(range) { - if (cm.display.shift || cm.doc.extend || range.empty()) - return findPosSubword(cm.doc, range.head, dir); - else - return dir < 0 ? range.from() : range.to(); - }); - } - - cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); }; - cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); }; - - var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-"; - - cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) { - var info = cm.getScrollInfo(); - if (!cm.somethingSelected()) { - var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local"); - if (cm.getCursor().line >= visibleBottomLine) - cm.execCommand("goLineUp"); - } - cm.scrollTo(null, info.top - cm.defaultTextHeight()); - }; - cmds[map[scrollLineCombo + "Down"] = "scrollLineDown"] = function(cm) { - var info = cm.getScrollInfo(); - if (!cm.somethingSelected()) { - var visibleTopLine = cm.lineAtHeight(info.top, "local")+1; - if (cm.getCursor().line <= visibleTopLine) - cm.execCommand("goLineDown"); - } - cm.scrollTo(null, info.top + cm.defaultTextHeight()); - }; - - cmds[map["Shift-" + ctrl + "L"] = "splitSelectionByLine"] = function(cm) { - var ranges = cm.listSelections(), lineRanges = []; - for (var i = 0; i < ranges.length; i++) { - var from = ranges[i].from(), to = ranges[i].to(); - for (var line = from.line; line <= to.line; ++line) - if (!(to.line > from.line && line == to.line && to.ch == 0)) - lineRanges.push({anchor: line == from.line ? from : Pos(line, 0), - head: line == to.line ? to : Pos(line)}); - } - cm.setSelections(lineRanges, 0); - }; - - map["Shift-Tab"] = "indentLess"; - - cmds[map["Esc"] = "singleSelectionTop"] = function(cm) { - var range = cm.listSelections()[0]; - cm.setSelection(range.anchor, range.head, {scroll: false}); - }; - - cmds[map[ctrl + "L"] = "selectLine"] = function(cm) { - var ranges = cm.listSelections(), extended = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - extended.push({anchor: Pos(range.from().line, 0), - head: Pos(range.to().line + 1, 0)}); - } - cm.setSelections(extended); - }; - - map["Shift-" + ctrl + "K"] = "deleteLine"; - - function insertLine(cm, above) { - cm.operation(function() { - var len = cm.listSelections().length, newSelection = [], last = -1; - for (var i = 0; i < len; i++) { - var head = cm.listSelections()[i].head; - if (head.line <= last) continue; - var at = Pos(head.line + (above ? 0 : 1), 0); - cm.replaceRange("\n", at, null, "+insertLine"); - cm.indentLine(at.line, null, true); - newSelection.push({head: at, anchor: at}); - last = head.line + 1; - } - cm.setSelections(newSelection); - }); - } - - cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { insertLine(cm, false); }; - - cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { insertLine(cm, true); }; - - function wordAt(cm, pos) { - var start = pos.ch, end = start, line = cm.getLine(pos.line); - while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start; - while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end; - return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)}; - } - - cmds[map[ctrl + "D"] = "selectNextOccurrence"] = function(cm) { - var from = cm.getCursor("from"), to = cm.getCursor("to"); - var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel; - if (CodeMirror.cmpPos(from, to) == 0) { - var word = wordAt(cm, from); - if (!word.word) return; - cm.setSelection(word.from, word.to); - fullWord = true; - } else { - var text = cm.getRange(from, to); - var query = fullWord ? new RegExp("\\b" + text + "\\b") : text; - var cur = cm.getSearchCursor(query, to); - if (cur.findNext()) { - cm.addSelection(cur.from(), cur.to()); - } else { - cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0)); - if (cur.findNext()) - cm.addSelection(cur.from(), cur.to()); - } - } - if (fullWord) - cm.state.sublimeFindFullWord = cm.doc.sel; - }; - - var mirror = "(){}[]"; - function selectBetweenBrackets(cm) { - var pos = cm.getCursor(), opening = cm.scanForBracket(pos, -1); - if (!opening) return; - for (;;) { - var closing = cm.scanForBracket(pos, 1); - if (!closing) return; - if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) { - cm.setSelection(Pos(opening.pos.line, opening.pos.ch + 1), closing.pos, false); - return true; - } - pos = Pos(closing.pos.line, closing.pos.ch + 1); - } - } - - cmds[map["Shift-" + ctrl + "Space"] = "selectScope"] = function(cm) { - selectBetweenBrackets(cm) || cm.execCommand("selectAll"); - }; - cmds[map["Shift-" + ctrl + "M"] = "selectBetweenBrackets"] = function(cm) { - if (!selectBetweenBrackets(cm)) return CodeMirror.Pass; - }; - - cmds[map[ctrl + "M"] = "goToBracket"] = function(cm) { - cm.extendSelectionsBy(function(range) { - var next = cm.scanForBracket(range.head, 1); - if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos; - var prev = cm.scanForBracket(range.head, -1); - return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head; - }); - }; - - var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-"; - - cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) { - var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], from = range.from().line - 1, to = range.to().line; - newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch), - head: Pos(range.head.line - 1, range.head.ch)}); - if (range.to().ch == 0 && !range.empty()) --to; - if (from > at) linesToMove.push(from, to); - else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; - at = to; - } - cm.operation(function() { - for (var i = 0; i < linesToMove.length; i += 2) { - var from = linesToMove[i], to = linesToMove[i + 1]; - var line = cm.getLine(from); - cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine"); - if (to > cm.lastLine()) - cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine"); - else - cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine"); - } - cm.setSelections(newSels); - cm.scrollIntoView(); - }); - }; - - cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) { - var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1; - for (var i = ranges.length - 1; i >= 0; i--) { - var range = ranges[i], from = range.to().line + 1, to = range.from().line; - if (range.to().ch == 0 && !range.empty()) from--; - if (from < at) linesToMove.push(from, to); - else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; - at = to; - } - cm.operation(function() { - for (var i = linesToMove.length - 2; i >= 0; i -= 2) { - var from = linesToMove[i], to = linesToMove[i + 1]; - var line = cm.getLine(from); - if (from == cm.lastLine()) - cm.replaceRange("", Pos(from - 1), Pos(from), "+swapLine"); - else - cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine"); - cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine"); - } - cm.scrollIntoView(); - }); - }; - - map[ctrl + "/"] = "toggleComment"; - - cmds[map[ctrl + "J"] = "joinLines"] = function(cm) { - var ranges = cm.listSelections(), joined = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], from = range.from(); - var start = from.line, end = range.to().line; - while (i < ranges.length - 1 && ranges[i + 1].from().line == end) - end = ranges[++i].to().line; - joined.push({start: start, end: end, anchor: !range.empty() && from}); - } - cm.operation(function() { - var offset = 0, ranges = []; - for (var i = 0; i < joined.length; i++) { - var obj = joined[i]; - var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head; - for (var line = obj.start; line <= obj.end; line++) { - var actual = line - offset; - if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1); - if (actual < cm.lastLine()) { - cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length)); - ++offset; - } - } - ranges.push({anchor: anchor || head, head: head}); - } - cm.setSelections(ranges, 0); - }); - }; - - cmds[map["Shift-" + ctrl + "D"] = "duplicateLine"] = function(cm) { - cm.operation(function() { - var rangeCount = cm.listSelections().length; - for (var i = 0; i < rangeCount; i++) { - var range = cm.listSelections()[i]; - if (range.empty()) - cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0)); - else - cm.replaceRange(cm.getRange(range.from(), range.to()), range.from()); - } - cm.scrollIntoView(); - }); - }; - - map[ctrl + "T"] = "transposeChars"; - - function sortLines(cm, caseSensitive) { - var ranges = cm.listSelections(), toSort = [], selected; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.empty()) continue; - var from = range.from().line, to = range.to().line; - while (i < ranges.length - 1 && ranges[i + 1].from().line == to) - to = range[++i].to().line; - toSort.push(from, to); - } - if (toSort.length) selected = true; - else toSort.push(cm.firstLine(), cm.lastLine()); - - cm.operation(function() { - var ranges = []; - for (var i = 0; i < toSort.length; i += 2) { - var from = toSort[i], to = toSort[i + 1]; - var start = Pos(from, 0), end = Pos(to); - var lines = cm.getRange(start, end, false); - if (caseSensitive) - lines.sort(); - else - lines.sort(function(a, b) { - var au = a.toUpperCase(), bu = b.toUpperCase(); - if (au != bu) { a = au; b = bu; } - return a < b ? -1 : a == b ? 0 : 1; - }); - cm.replaceRange(lines, start, end); - if (selected) ranges.push({anchor: start, head: end}); - } - if (selected) cm.setSelections(ranges, 0); - }); - } - - cmds[map["F9"] = "sortLines"] = function(cm) { sortLines(cm, true); }; - cmds[map[ctrl + "F9"] = "sortLinesInsensitive"] = function(cm) { sortLines(cm, false); }; - - cmds[map["F2"] = "nextBookmark"] = function(cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) while (marks.length) { - var current = marks.shift(); - var found = current.find(); - if (found) { - marks.push(current); - return cm.setSelection(found.from, found.to); - } - } - }; - - cmds[map["Shift-F2"] = "prevBookmark"] = function(cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) while (marks.length) { - marks.unshift(marks.pop()); - var found = marks[marks.length - 1].find(); - if (!found) - marks.pop(); - else - return cm.setSelection(found.from, found.to); - } - }; - - cmds[map[ctrl + "F2"] = "toggleBookmark"] = function(cm) { - var ranges = cm.listSelections(); - var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []); - for (var i = 0; i < ranges.length; i++) { - var from = ranges[i].from(), to = ranges[i].to(); - var found = cm.findMarks(from, to); - for (var j = 0; j < found.length; j++) { - if (found[j].sublimeBookmark) { - found[j].clear(); - for (var k = 0; k < marks.length; k++) - if (marks[k] == found[j]) - marks.splice(k--, 1); - break; - } - } - if (j == found.length) - marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false})); - } - }; - - cmds[map["Shift-" + ctrl + "F2"] = "clearBookmarks"] = function(cm) { - var marks = cm.state.sublimeBookmarks; - if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear(); - marks.length = 0; - }; - - cmds[map["Alt-F2"] = "selectBookmarks"] = function(cm) { - var marks = cm.state.sublimeBookmarks, ranges = []; - if (marks) for (var i = 0; i < marks.length; i++) { - var found = marks[i].find(); - if (!found) - marks.splice(i--, 0); - else - ranges.push({anchor: found.from, head: found.to}); - } - if (ranges.length) - cm.setSelections(ranges, 0); - }; - - map["Alt-Q"] = "wrapLines"; - - var cK = ctrl + "K "; - - function modifyWordOrSelection(cm, mod) { - cm.operation(function() { - var ranges = cm.listSelections(), indices = [], replacements = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.empty()) { indices.push(i); replacements.push(""); } - else replacements.push(mod(cm.getRange(range.from(), range.to()))); - } - cm.replaceSelections(replacements, "around", "case"); - for (var i = indices.length - 1, at; i >= 0; i--) { - var range = ranges[indices[i]]; - if (at && CodeMirror.cmpPos(range.head, at) > 0) continue; - var word = wordAt(cm, range.head); - at = word.from; - cm.replaceRange(mod(word.word), word.from, word.to); - } - }); - } - - map[cK + ctrl + "Backspace"] = "delLineLeft"; - - cmds[map["Backspace"] = "smartBackspace"] = function(cm) { - if (cm.somethingSelected()) return CodeMirror.Pass; - - var cursor = cm.getCursor(); - var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor); - var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); - - if (toStartOfLine && !/\S/.test(toStartOfLine) && column % cm.getOption("indentUnit") == 0) - return cm.indentSelection("subtract"); - else - return CodeMirror.Pass; - }; - - cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(); - for (var i = ranges.length - 1; i >= 0; i--) - cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete"); - cm.scrollIntoView(); - }); - }; - - cmds[map[cK + ctrl + "U"] = "upcaseAtCursor"] = function(cm) { - modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); }); - }; - cmds[map[cK + ctrl + "L"] = "downcaseAtCursor"] = function(cm) { - modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); }); - }; - - cmds[map[cK + ctrl + "Space"] = "setSublimeMark"] = function(cm) { - if (cm.state.sublimeMark) cm.state.sublimeMark.clear(); - cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); - }; - cmds[map[cK + ctrl + "A"] = "selectToSublimeMark"] = function(cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) cm.setSelection(cm.getCursor(), found); - }; - cmds[map[cK + ctrl + "W"] = "deleteToSublimeMark"] = function(cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) { - var from = cm.getCursor(), to = found; - if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; } - cm.state.sublimeKilled = cm.getRange(from, to); - cm.replaceRange("", from, to); - } - }; - cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) { - var found = cm.state.sublimeMark && cm.state.sublimeMark.find(); - if (found) { - cm.state.sublimeMark.clear(); - cm.state.sublimeMark = cm.setBookmark(cm.getCursor()); - cm.setCursor(found); - } - }; - cmds[map[cK + ctrl + "Y"] = "sublimeYank"] = function(cm) { - if (cm.state.sublimeKilled != null) - cm.replaceSelection(cm.state.sublimeKilled, null, "paste"); - }; - - map[cK + ctrl + "G"] = "clearBookmarks"; - cmds[map[cK + ctrl + "C"] = "showInCenter"] = function(cm) { - var pos = cm.cursorCoords(null, "local"); - cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2); - }; - - cmds[map["Shift-Alt-Up"] = "selectLinesUpward"] = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.head.line > cm.firstLine()) - cm.addSelection(Pos(range.head.line - 1, range.head.ch)); - } - }); - }; - cmds[map["Shift-Alt-Down"] = "selectLinesDownward"] = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (range.head.line < cm.lastLine()) - cm.addSelection(Pos(range.head.line + 1, range.head.ch)); - } - }); - }; - - function getTarget(cm) { - var from = cm.getCursor("from"), to = cm.getCursor("to"); - if (CodeMirror.cmpPos(from, to) == 0) { - var word = wordAt(cm, from); - if (!word.word) return; - from = word.from; - to = word.to; - } - return {from: from, to: to, query: cm.getRange(from, to), word: word}; - } - - function findAndGoTo(cm, forward) { - var target = getTarget(cm); - if (!target) return; - var query = target.query; - var cur = cm.getSearchCursor(query, forward ? target.to : target.from); - - if (forward ? cur.findNext() : cur.findPrevious()) { - cm.setSelection(cur.from(), cur.to()); - } else { - cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0) - : cm.clipPos(Pos(cm.lastLine()))); - if (forward ? cur.findNext() : cur.findPrevious()) - cm.setSelection(cur.from(), cur.to()); - else if (target.word) - cm.setSelection(target.from, target.to); - } - }; - cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); }; - cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); }; - cmds[map["Alt-F3"] = "findAllUnder"] = function(cm) { - var target = getTarget(cm); - if (!target) return; - var cur = cm.getSearchCursor(target.query); - var matches = []; - var primaryIndex = -1; - while (cur.findNext()) { - matches.push({anchor: cur.from(), head: cur.to()}); - if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch) - primaryIndex++; - } - cm.setSelections(matches, primaryIndex); - }; - - map["Shift-" + ctrl + "["] = "fold"; - map["Shift-" + ctrl + "]"] = "unfold"; - map[cK + ctrl + "0"] = map[cK + ctrl + "j"] = "unfoldAll"; - - map[ctrl + "I"] = "findIncremental"; - map["Shift-" + ctrl + "I"] = "findIncrementalReverse"; - map[ctrl + "H"] = "replace"; - map["F3"] = "findNext"; - map["Shift-F3"] = "findPrev"; - - CodeMirror.normalizeKeyMap(map); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/vim.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/vim.js deleted file mode 100644 index 14897a8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/vim.js +++ /dev/null @@ -1,5060 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Supported keybindings: - * Too many to list. Refer to defaultKeyMap below. - * - * Supported Ex commands: - * Refer to defaultExCommandMap below. - * - * Registers: unnamed, -, a-z, A-Z, 0-9 - * (Does not respect the special case for number registers when delete - * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) - * TODO: Implement the remaining registers. - * - * Marks: a-z, A-Z, and 0-9 - * TODO: Implement the remaining special marks. They have more complex - * behavior. - * - * Events: - * 'vim-mode-change' - raised on the editor anytime the current mode changes, - * Event object: {mode: "visual", subMode: "linewise"} - * - * Code structure: - * 1. Default keymap - * 2. Variable declarations and short basic helpers - * 3. Instance (External API) implementation - * 4. Internal state tracking objects (input state, counter) implementation - * and instanstiation - * 5. Key handler (the main command dispatcher) implementation - * 6. Motion, operator, and action implementations - * 7. Helper functions for the key handler, motions, operators, and actions - * 8. Set up Vim to work as a keymap for CodeMirror. - * 9. Ex command implementations. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/dialog/dialog"), require("../addon/edit/matchbrackets.js")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/dialog/dialog", "../addon/edit/matchbrackets"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - 'use strict'; - - var defaultKeymap = [ - // Key to key mapping. This goes first to make it possible to override - // existing mappings. - { keys: '', type: 'keyToKey', toKeys: 'h' }, - { keys: '', type: 'keyToKey', toKeys: 'l' }, - { keys: '', type: 'keyToKey', toKeys: 'k' }, - { keys: '', type: 'keyToKey', toKeys: 'j' }, - { keys: '', type: 'keyToKey', toKeys: 'l' }, - { keys: '', type: 'keyToKey', toKeys: 'h', context: 'normal'}, - { keys: '', type: 'keyToKey', toKeys: 'W' }, - { keys: '', type: 'keyToKey', toKeys: 'B', context: 'normal' }, - { keys: '', type: 'keyToKey', toKeys: 'w' }, - { keys: '', type: 'keyToKey', toKeys: 'b', context: 'normal' }, - { keys: '', type: 'keyToKey', toKeys: 'j' }, - { keys: '', type: 'keyToKey', toKeys: 'k' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, - { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, - { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' }, - { keys: 's', type: 'keyToKey', toKeys: 'xi', context: 'visual'}, - { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, - { keys: 'S', type: 'keyToKey', toKeys: 'dcc', context: 'visual' }, - { keys: '', type: 'keyToKey', toKeys: '0' }, - { keys: '', type: 'keyToKey', toKeys: '$' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: 'j^', context: 'normal' }, - // Motions - { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false }}, - { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true }}, - { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true }}, - { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true }}, - { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }}, - { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false }}, - { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false }}, - { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true }}, - { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true }}, - { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true }}, - { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }}, - { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true }}, - { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }}, - { keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true }}, - { keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true }}, - { keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true }}, - { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true }}, - { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }}, - { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: '0', type: 'motion', motion: 'moveToStartOfLine' }, - { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }}, - { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar:true }}, - { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }}, - { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true }}, - { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true }}, - { keys: 'f', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }}, - { keys: 'F', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }}, - { keys: 't', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }}, - { keys: 'T', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }}, - { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }}, - { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }}, - { keys: '\'', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}}, - { keys: '`', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true}}, - { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } }, - { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } }, - { keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } }, - { keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } }, - // the next two aren't motions but must come before more general motion declarations - { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}}, - { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}}, - { keys: ']', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}}, - { keys: '[', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}}, - { keys: '|', type: 'motion', motion: 'moveToColumn'}, - { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'}, - { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'}, - // Operators - { keys: 'd', type: 'operator', operator: 'delete' }, - { keys: 'y', type: 'operator', operator: 'yank' }, - { keys: 'c', type: 'operator', operator: 'change' }, - { keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true }}, - { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }}, - { keys: 'g~', type: 'operator', operator: 'changeCase' }, - { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true }, - { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true }, - { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }}, - { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }}, - // Operator-Motion dual commands - { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }}, - { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }}, - { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'}, - { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'}, - { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' }, - // Actions - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }}, - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }}, - { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' }, - { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' }, - { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' }, - { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' }, - { keys: 'v', type: 'action', action: 'toggleVisualMode' }, - { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }}, - { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, - { keys: 'gv', type: 'action', action: 'reselectLastSelection' }, - { keys: 'J', type: 'action', action: 'joinLines', isEdit: true }, - { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }}, - { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }}, - { keys: 'r', type: 'action', action: 'replace', isEdit: true }, - { keys: '@', type: 'action', action: 'replayMacro' }, - { keys: 'q', type: 'action', action: 'enterMacroRecordMode' }, - // Handle Replace-mode as a special case of insert mode. - { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }}, - { keys: 'u', type: 'action', action: 'undo', context: 'normal' }, - { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true }, - { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true }, - { keys: '', type: 'action', action: 'redo' }, - { keys: 'm', type: 'action', action: 'setMark' }, - { keys: '"', type: 'action', action: 'setRegister' }, - { keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }}, - { keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: 'zt', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }}, - { keys: 'z', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: 'z-', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }}, - { keys: 'zb', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: '.', type: 'action', action: 'repeatLastEdit' }, - { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: true, backtrack: false}}, - { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: false, backtrack: false}}, - // Text object motions - { keys: 'a', type: 'motion', motion: 'textObjectManipulation' }, - { keys: 'i', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }}, - // Search - { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }}, - { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }}, - { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }}, - { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }}, - // Ex command - { keys: ':', type: 'ex' } - ]; - - /** - * Ex commands - * Care must be taken when adding to the default Ex command map. For any - * pair of commands that have a shared prefix, at least one of their - * shortNames must not match the prefix of the other command. - */ - var defaultExCommandMap = [ - { name: 'colorscheme', shortName: 'colo' }, - { name: 'map' }, - { name: 'imap', shortName: 'im' }, - { name: 'nmap', shortName: 'nm' }, - { name: 'vmap', shortName: 'vm' }, - { name: 'unmap' }, - { name: 'write', shortName: 'w' }, - { name: 'undo', shortName: 'u' }, - { name: 'redo', shortName: 'red' }, - { name: 'set', shortName: 'se' }, - { name: 'set', shortName: 'se' }, - { name: 'setlocal', shortName: 'setl' }, - { name: 'setglobal', shortName: 'setg' }, - { name: 'sort', shortName: 'sor' }, - { name: 'substitute', shortName: 's', possiblyAsync: true }, - { name: 'nohlsearch', shortName: 'noh' }, - { name: 'delmarks', shortName: 'delm' }, - { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, - { name: 'global', shortName: 'g' } - ]; - - var Pos = CodeMirror.Pos; - - var Vim = function() { - function enterVimMode(cm) { - cm.setOption('disableInput', true); - cm.setOption('showCursorWhenSelecting', false); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - cm.on('cursorActivity', onCursorActivity); - maybeInitVimState(cm); - CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm)); - } - - function leaveVimMode(cm) { - cm.setOption('disableInput', false); - cm.off('cursorActivity', onCursorActivity); - CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm)); - cm.state.vim = null; - } - - function detachVimMap(cm, next) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!next || next.attach != attachVimMap) - leaveVimMode(cm, false); - } - function attachVimMap(cm, prev) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!prev || prev.attach != attachVimMap) - enterVimMode(cm); - } - - // Deprecated, simply setting the keymap works again. - CodeMirror.defineOption('vimMode', false, function(cm, val, prev) { - if (val && cm.getOption("keyMap") != "vim") - cm.setOption("keyMap", "vim"); - else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap"))) - cm.setOption("keyMap", "default"); - }); - - function cmKey(key, cm) { - if (!cm) { return undefined; } - var vimKey = cmKeyToVimKey(key); - if (!vimKey) { - return false; - } - var cmd = CodeMirror.Vim.findKey(cm, vimKey); - if (typeof cmd == 'function') { - CodeMirror.signal(cm, 'vim-keypress', vimKey); - } - return cmd; - } - - var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'}; - var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del'}; - function cmKeyToVimKey(key) { - if (key.charAt(0) == '\'') { - // Keypress character binding of format "'a'" - return key.charAt(1); - } - var pieces = key.split('-'); - if (/-$/.test(key)) { - // If the - key was typed, split will result in 2 extra empty strings - // in the array. Replace them with 1 '-'. - pieces.splice(-2, 2, '-'); - } - var lastPiece = pieces[pieces.length - 1]; - if (pieces.length == 1 && pieces[0].length == 1) { - // No-modifier bindings use literal character bindings above. Skip. - return false; - } else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) { - // Ignore Shift+char bindings as they should be handled by literal character. - return false; - } - var hasCharacter = false; - for (var i = 0; i < pieces.length; i++) { - var piece = pieces[i]; - if (piece in modifiers) { pieces[i] = modifiers[piece]; } - else { hasCharacter = true; } - if (piece in specialKeys) { pieces[i] = specialKeys[piece]; } - } - if (!hasCharacter) { - // Vim does not support modifier only keys. - return false; - } - // TODO: Current bindings expect the character to be lower case, but - // it looks like vim key notation uses upper case. - if (isUpperCase(lastPiece)) { - pieces[pieces.length - 1] = lastPiece.toLowerCase(); - } - return '<' + pieces.join('-') + '>'; - } - - function getOnPasteFn(cm) { - var vim = cm.state.vim; - if (!vim.onPasteFn) { - vim.onPasteFn = function() { - if (!vim.insertMode) { - cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); - actions.enterInsertMode(cm, {}, vim); - } - }; - } - return vim.onPasteFn; - } - - var numberRegex = /[\d]/; - var wordCharTest = [CodeMirror.isWordChar, function(ch) { - return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch); - }], bigWordCharTest = [function(ch) { - return /\S/.test(ch); - }]; - function makeKeyRange(start, size) { - var keys = []; - for (var i = start; i < start + size; i++) { - keys.push(String.fromCharCode(i)); - } - return keys; - } - var upperCaseAlphabet = makeKeyRange(65, 26); - var lowerCaseAlphabet = makeKeyRange(97, 26); - var numbers = makeKeyRange(48, 10); - var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']); - var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']); - - function isLine(cm, line) { - return line >= cm.firstLine() && line <= cm.lastLine(); - } - function isLowerCase(k) { - return (/^[a-z]$/).test(k); - } - function isMatchableSymbol(k) { - return '()[]{}'.indexOf(k) != -1; - } - function isNumber(k) { - return numberRegex.test(k); - } - function isUpperCase(k) { - return (/^[A-Z]$/).test(k); - } - function isWhiteSpaceString(k) { - return (/^\s*$/).test(k); - } - function inArray(val, arr) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == val) { - return true; - } - } - return false; - } - - var options = {}; - function defineOption(name, defaultValue, type, aliases, callback) { - if (defaultValue === undefined && !callback) { - throw Error('defaultValue is required unless callback is provided'); - } - if (!type) { type = 'string'; } - options[name] = { - type: type, - defaultValue: defaultValue, - callback: callback - }; - if (aliases) { - for (var i = 0; i < aliases.length; i++) { - options[aliases[i]] = options[name]; - } - } - if (defaultValue) { - setOption(name, defaultValue); - } - } - - function setOption(name, value, cm, cfg) { - var option = options[name]; - cfg = cfg || {}; - var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } - if (option.type == 'boolean') { - if (value && value !== true) { - throw Error('Invalid argument: ' + name + '=' + value); - } else if (value !== false) { - // Boolean options are set to true if value is not defined. - value = true; - } - } - if (option.callback) { - if (scope !== 'local') { - option.callback(value, undefined); - } - if (scope !== 'global' && cm) { - option.callback(value, cm); - } - } else { - if (scope !== 'local') { - option.value = option.type == 'boolean' ? !!value : value; - } - if (scope !== 'global' && cm) { - cm.state.vim.options[name] = {value: value}; - } - } - } - - function getOption(name, cm, cfg) { - var option = options[name]; - cfg = cfg || {}; - var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } - if (option.callback) { - var local = cm && option.callback(undefined, cm); - if (scope !== 'global' && local !== undefined) { - return local; - } - if (scope !== 'local') { - return option.callback(); - } - return; - } else { - var local = (scope !== 'global') && (cm && cm.state.vim.options[name]); - return (local || (scope !== 'local') && option || {}).value; - } - } - - defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) { - // Option is local. Do nothing for global. - if (cm === undefined) { - return; - } - // The 'filetype' option proxies to the CodeMirror 'mode' option. - if (name === undefined) { - var mode = cm.getOption('mode'); - return mode == 'null' ? '' : mode; - } else { - var mode = name == '' ? 'null' : name; - cm.setOption('mode', mode); - } - }); - - var createCircularJumpList = function() { - var size = 100; - var pointer = -1; - var head = 0; - var tail = 0; - var buffer = new Array(size); - function add(cm, oldCur, newCur) { - var current = pointer % size; - var curMark = buffer[current]; - function useNextSlot(cursor) { - var next = ++pointer % size; - var trashMark = buffer[next]; - if (trashMark) { - trashMark.clear(); - } - buffer[next] = cm.setBookmark(cursor); - } - if (curMark) { - var markPos = curMark.find(); - // avoid recording redundant cursor position - if (markPos && !cursorEqual(markPos, oldCur)) { - useNextSlot(oldCur); - } - } else { - useNextSlot(oldCur); - } - useNextSlot(newCur); - head = pointer; - tail = pointer - size + 1; - if (tail < 0) { - tail = 0; - } - } - function move(cm, offset) { - pointer += offset; - if (pointer > head) { - pointer = head; - } else if (pointer < tail) { - pointer = tail; - } - var mark = buffer[(size + pointer) % size]; - // skip marks that are temporarily removed from text buffer - if (mark && !mark.find()) { - var inc = offset > 0 ? 1 : -1; - var newCur; - var oldCur = cm.getCursor(); - do { - pointer += inc; - mark = buffer[(size + pointer) % size]; - // skip marks that are the same as current position - if (mark && - (newCur = mark.find()) && - !cursorEqual(oldCur, newCur)) { - break; - } - } while (pointer < head && pointer > tail); - } - return mark; - } - return { - cachedCursor: undefined, //used for # and * jumps - add: add, - move: move - }; - }; - - // Returns an object to track the changes associated insert mode. It - // clones the object that is passed in, or creates an empty object one if - // none is provided. - var createInsertModeChanges = function(c) { - if (c) { - // Copy construction - return { - changes: c.changes, - expectCursorActivityForChange: c.expectCursorActivityForChange - }; - } - return { - // Change list - changes: [], - // Set to true on change, false on cursorActivity. - expectCursorActivityForChange: false - }; - }; - - function MacroModeState() { - this.latestRegister = undefined; - this.isPlaying = false; - this.isRecording = false; - this.replaySearchQueries = []; - this.onRecordingDone = undefined; - this.lastInsertModeChanges = createInsertModeChanges(); - } - MacroModeState.prototype = { - exitMacroRecordMode: function() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.onRecordingDone) { - macroModeState.onRecordingDone(); // close dialog - } - macroModeState.onRecordingDone = undefined; - macroModeState.isRecording = false; - }, - enterMacroRecordMode: function(cm, registerName) { - var register = - vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.clear(); - this.latestRegister = registerName; - if (cm.openDialog) { - this.onRecordingDone = cm.openDialog( - '(recording)['+registerName+']', null, {bottom:true}); - } - this.isRecording = true; - } - } - }; - - function maybeInitVimState(cm) { - if (!cm.state.vim) { - // Store instance state in the CodeMirror object. - cm.state.vim = { - inputState: new InputState(), - // Vim's input state that triggered the last edit, used to repeat - // motions and operators with '.'. - lastEditInputState: undefined, - // Vim's action command before the last edit, used to repeat actions - // with '.' and insert mode repeat. - lastEditActionCommand: undefined, - // When using jk for navigation, if you move from a longer line to a - // shorter line, the cursor may clip to the end of the shorter line. - // If j is pressed again and cursor goes to the next line, the - // cursor should go back to its horizontal position on the longer - // line if it can. This is to keep track of the horizontal position. - lastHPos: -1, - // Doing the same with screen-position for gj/gk - lastHSPos: -1, - // The last motion command run. Cleared if a non-motion command gets - // executed in between. - lastMotion: null, - marks: {}, - // Mark for rendering fake cursor for visual mode. - fakeCursor: null, - insertMode: false, - // Repeat count for changes made in insert mode, triggered by key - // sequences like 3,i. Only exists when insertMode is true. - insertModeRepeat: undefined, - visualMode: false, - // If we are in visual line mode. No effect if visualMode is false. - visualLine: false, - visualBlock: false, - lastSelection: null, - lastPastedText: null, - sel: {}, - // Buffer-local/window-local values of vim options. - options: {} - }; - } - return cm.state.vim; - } - var vimGlobalState; - function resetVimGlobalState() { - vimGlobalState = { - // The current search query. - searchQuery: null, - // Whether we are searching backwards. - searchIsReversed: false, - // Replace part of the last substituted pattern - lastSubstituteReplacePart: undefined, - jumpList: createCircularJumpList(), - macroModeState: new MacroModeState, - // Recording latest f, t, F or T motion command. - lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''}, - registerController: new RegisterController({}), - // search history buffer - searchHistoryController: new HistoryController({}), - // ex Command history buffer - exCommandHistoryController : new HistoryController({}) - }; - for (var optionName in options) { - var option = options[optionName]; - option.value = option.defaultValue; - } - } - - var lastInsertModeKeyTimer; - var vimApi= { - buildKeyMap: function() { - // TODO: Convert keymap into dictionary format for fast lookup. - }, - // Testing hook, though it might be useful to expose the register - // controller anyways. - getRegisterController: function() { - return vimGlobalState.registerController; - }, - // Testing hook. - resetVimGlobalState_: resetVimGlobalState, - - // Testing hook. - getVimGlobalState_: function() { - return vimGlobalState; - }, - - // Testing hook. - maybeInitVimState_: maybeInitVimState, - - suppressErrorLogging: false, - - InsertModeKey: InsertModeKey, - map: function(lhs, rhs, ctx) { - // Add user defined key bindings. - exCommandDispatcher.map(lhs, rhs, ctx); - }, - // TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace - // them, or somehow make them work with the existing CodeMirror setOption/getOption API. - setOption: setOption, - getOption: getOption, - defineOption: defineOption, - defineEx: function(name, prefix, func){ - if (!prefix) { - prefix = name; - } else if (name.indexOf(prefix) !== 0) { - throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); - } - exCommands[name]=func; - exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'}; - }, - handleKey: function (cm, key, origin) { - var command = this.findKey(cm, key, origin); - if (typeof command === 'function') { - return command(); - } - }, - /** - * This is the outermost function called by CodeMirror, after keys have - * been mapped to their Vim equivalents. - * - * Finds a command based on the key (and cached keys if there is a - * multi-key sequence). Returns `undefined` if no key is matched, a noop - * function if a partial match is found (multi-key), and a function to - * execute the bound command if a a key is matched. The function always - * returns true. - */ - findKey: function(cm, key, origin) { - var vim = maybeInitVimState(cm); - function handleMacroRecording() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - if (key == 'q') { - macroModeState.exitMacroRecordMode(); - clearInputState(cm); - return true; - } - if (origin != 'mapping') { - logKey(macroModeState, key); - } - } - } - function handleEsc() { - if (key == '') { - // Clear input state and get back to normal mode. - clearInputState(cm); - if (vim.visualMode) { - exitVisualMode(cm); - } else if (vim.insertMode) { - exitInsertMode(cm); - } - return true; - } - } - function doKeyToKey(keys) { - // TODO: prevent infinite recursion. - var match; - while (keys) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(keys); - key = match[0]; - keys = keys.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'mapping'); - } - } - - function handleKeyInsertMode() { - if (handleEsc()) { return true; } - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - var keysAreChars = key.length == 1; - var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - // Need to check all key substrings in insert mode. - while (keys.length > 1 && match.type != 'full') { - var keys = vim.inputState.keyBuffer = keys.slice(1); - var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - if (thisMatch.type != 'none') { match = thisMatch; } - } - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - lastInsertModeKeyTimer = window.setTimeout( - function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } }, - getOption('insertModeEscKeysTimeout')); - return !keysAreChars; - } - - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - if (keysAreChars) { - var here = cm.getCursor(); - cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); - } - clearInputState(cm); - return match.command; - } - - function handleKeyNonInsertMode() { - if (handleMacroRecording() || handleEsc()) { return true; }; - - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - if (/^[1-9]\d*$/.test(keys)) { return true; } - - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (!keysMatcher) { clearInputState(cm); return false; } - var context = vim.visualMode ? 'visual' : - 'normal'; - var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context); - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { return true; } - - vim.inputState.keyBuffer = ''; - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (keysMatcher[1] && keysMatcher[1] != '0') { - vim.inputState.pushRepeatDigit(keysMatcher[1]); - } - return match.command; - } - - var command; - if (vim.insertMode) { command = handleKeyInsertMode(); } - else { command = handleKeyNonInsertMode(); } - if (command === false) { - return undefined; - } else if (command === true) { - // TODO: Look into using CodeMirror's multi-key handling. - // Return no-op since we are caching the key. Counts as handled, but - // don't want act on it just yet. - return function() {}; - } else { - return function() { - return cm.operation(function() { - cm.curOp.isVimOp = true; - try { - if (command.type == 'keyToKey') { - doKeyToKey(command.toKeys); - } else { - commandDispatcher.processCommand(cm, vim, command); - } - } catch (e) { - // clear VIM state in case it's in a bad state. - cm.state.vim = undefined; - maybeInitVimState(cm); - if (!CodeMirror.Vim.suppressErrorLogging) { - console['log'](e); - } - throw e; - } - return true; - }); - }; - } - }, - handleEx: function(cm, input) { - exCommandDispatcher.processCommand(cm, input); - }, - - defineMotion: defineMotion, - defineAction: defineAction, - defineOperator: defineOperator, - mapCommand: mapCommand, - _mapCommand: _mapCommand, - - defineRegister: defineRegister, - - exitVisualMode: exitVisualMode, - exitInsertMode: exitInsertMode - }; - - // Represents the current input state. - function InputState() { - this.prefixRepeat = []; - this.motionRepeat = []; - - this.operator = null; - this.operatorArgs = null; - this.motion = null; - this.motionArgs = null; - this.keyBuffer = []; // For matching multi-key commands. - this.registerName = null; // Defaults to the unnamed register. - } - InputState.prototype.pushRepeatDigit = function(n) { - if (!this.operator) { - this.prefixRepeat = this.prefixRepeat.concat(n); - } else { - this.motionRepeat = this.motionRepeat.concat(n); - } - }; - InputState.prototype.getRepeat = function() { - var repeat = 0; - if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) { - repeat = 1; - if (this.prefixRepeat.length > 0) { - repeat *= parseInt(this.prefixRepeat.join(''), 10); - } - if (this.motionRepeat.length > 0) { - repeat *= parseInt(this.motionRepeat.join(''), 10); - } - } - return repeat; - }; - - function clearInputState(cm, reason) { - cm.state.vim.inputState = new InputState(); - CodeMirror.signal(cm, 'vim-command-done', reason); - } - - /* - * Register stores information about copy and paste registers. Besides - * text, a register must store whether it is linewise (i.e., when it is - * pasted, should it insert itself into a new line, or should the text be - * inserted at the cursor position.) - */ - function Register(text, linewise, blockwise) { - this.clear(); - this.keyBuffer = [text || '']; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - } - Register.prototype = { - setText: function(text, linewise, blockwise) { - this.keyBuffer = [text || '']; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - }, - pushText: function(text, linewise) { - // if this register has ever been set to linewise, use linewise. - if (linewise) { - if (!this.linewise) { - this.keyBuffer.push('\n'); - } - this.linewise = true; - } - this.keyBuffer.push(text); - }, - pushInsertModeChanges: function(changes) { - this.insertModeChanges.push(createInsertModeChanges(changes)); - }, - pushSearchQuery: function(query) { - this.searchQueries.push(query); - }, - clear: function() { - this.keyBuffer = []; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = false; - }, - toString: function() { - return this.keyBuffer.join(''); - } - }; - - /** - * Defines an external register. - * - * The name should be a single character that will be used to reference the register. - * The register should support setText, pushText, clear, and toString(). See Register - * for a reference implementation. - */ - function defineRegister(name, register) { - var registers = vimGlobalState.registerController.registers[name]; - if (!name || name.length != 1) { - throw Error('Register name must be 1 character'); - } - if (registers[name]) { - throw Error('Register already defined ' + name); - } - registers[name] = register; - validRegisters.push(name); - } - - /* - * vim registers allow you to keep many independent copy and paste buffers. - * See http://usevim.com/2012/04/13/registers/ for an introduction. - * - * RegisterController keeps the state of all the registers. An initial - * state may be passed in. The unnamed register '"' will always be - * overridden. - */ - function RegisterController(registers) { - this.registers = registers; - this.unnamedRegister = registers['"'] = new Register(); - registers['.'] = new Register(); - registers[':'] = new Register(); - registers['/'] = new Register(); - } - RegisterController.prototype = { - pushText: function(registerName, operator, text, linewise, blockwise) { - if (linewise && text.charAt(0) == '\n') { - text = text.slice(1) + '\n'; - } - if (linewise && text.charAt(text.length - 1) !== '\n'){ - text += '\n'; - } - // Lowercase and uppercase registers refer to the same register. - // Uppercase just means append. - var register = this.isValidRegister(registerName) ? - this.getRegister(registerName) : null; - // if no register/an invalid register was specified, things go to the - // default registers - if (!register) { - switch (operator) { - case 'yank': - // The 0 register contains the text from the most recent yank. - this.registers['0'] = new Register(text, linewise, blockwise); - break; - case 'delete': - case 'change': - if (text.indexOf('\n') == -1) { - // Delete less than 1 line. Update the small delete register. - this.registers['-'] = new Register(text, linewise); - } else { - // Shift down the contents of the numbered registers and put the - // deleted text into register 1. - this.shiftNumericRegisters_(); - this.registers['1'] = new Register(text, linewise); - } - break; - } - // Make sure the unnamed register is set to what just happened - this.unnamedRegister.setText(text, linewise, blockwise); - return; - } - - // If we've gotten to this point, we've actually specified a register - var append = isUpperCase(registerName); - if (append) { - register.pushText(text, linewise); - } else { - register.setText(text, linewise, blockwise); - } - // The unnamed register always has the same value as the last used - // register. - this.unnamedRegister.setText(register.toString(), linewise); - }, - // Gets the register named @name. If one of @name doesn't already exist, - // create it. If @name is invalid, return the unnamedRegister. - getRegister: function(name) { - if (!this.isValidRegister(name)) { - return this.unnamedRegister; - } - name = name.toLowerCase(); - if (!this.registers[name]) { - this.registers[name] = new Register(); - } - return this.registers[name]; - }, - isValidRegister: function(name) { - return name && inArray(name, validRegisters); - }, - shiftNumericRegisters_: function() { - for (var i = 9; i >= 2; i--) { - this.registers[i] = this.getRegister('' + (i - 1)); - } - } - }; - function HistoryController() { - this.historyBuffer = []; - this.iterator; - this.initialPrefix = null; - } - HistoryController.prototype = { - // the input argument here acts a user entered prefix for a small time - // until we start autocompletion in which case it is the autocompleted. - nextMatch: function (input, up) { - var historyBuffer = this.historyBuffer; - var dir = up ? -1 : 1; - if (this.initialPrefix === null) this.initialPrefix = input; - for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) { - var element = historyBuffer[i]; - for (var j = 0; j <= element.length; j++) { - if (this.initialPrefix == element.substring(0, j)) { - this.iterator = i; - return element; - } - } - } - // should return the user input in case we reach the end of buffer. - if (i >= historyBuffer.length) { - this.iterator = historyBuffer.length; - return this.initialPrefix; - } - // return the last autocompleted query or exCommand as it is. - if (i < 0 ) return input; - }, - pushInput: function(input) { - var index = this.historyBuffer.indexOf(input); - if (index > -1) this.historyBuffer.splice(index, 1); - if (input.length) this.historyBuffer.push(input); - }, - reset: function() { - this.initialPrefix = null; - this.iterator = this.historyBuffer.length; - } - }; - var commandDispatcher = { - matchCommand: function(keys, keyMap, inputState, context) { - var matches = commandMatches(keys, keyMap, context, inputState); - if (!matches.full && !matches.partial) { - return {type: 'none'}; - } else if (!matches.full && matches.partial) { - return {type: 'partial'}; - } - - var bestMatch; - for (var i = 0; i < matches.full.length; i++) { - var match = matches.full[i]; - if (!bestMatch) { - bestMatch = match; - } - } - if (bestMatch.keys.slice(-11) == '') { - inputState.selectedCharacter = lastChar(keys); - } - return {type: 'full', command: bestMatch}; - }, - processCommand: function(cm, vim, command) { - vim.inputState.repeatOverride = command.repeatOverride; - switch (command.type) { - case 'motion': - this.processMotion(cm, vim, command); - break; - case 'operator': - this.processOperator(cm, vim, command); - break; - case 'operatorMotion': - this.processOperatorMotion(cm, vim, command); - break; - case 'action': - this.processAction(cm, vim, command); - break; - case 'search': - this.processSearch(cm, vim, command); - break; - case 'ex': - case 'keyToEx': - this.processEx(cm, vim, command); - break; - default: - break; - } - }, - processMotion: function(cm, vim, command) { - vim.inputState.motion = command.motion; - vim.inputState.motionArgs = copyArgs(command.motionArgs); - this.evalInput(cm, vim); - }, - processOperator: function(cm, vim, command) { - var inputState = vim.inputState; - if (inputState.operator) { - if (inputState.operator == command.operator) { - // Typing an operator twice like 'dd' makes the operator operate - // linewise - inputState.motion = 'expandToLine'; - inputState.motionArgs = { linewise: true }; - this.evalInput(cm, vim); - return; - } else { - // 2 different operators in a row doesn't make sense. - clearInputState(cm); - } - } - inputState.operator = command.operator; - inputState.operatorArgs = copyArgs(command.operatorArgs); - if (vim.visualMode) { - // Operating on a selection in visual mode. We don't need a motion. - this.evalInput(cm, vim); - } - }, - processOperatorMotion: function(cm, vim, command) { - var visualMode = vim.visualMode; - var operatorMotionArgs = copyArgs(command.operatorMotionArgs); - if (operatorMotionArgs) { - // Operator motions may have special behavior in visual mode. - if (visualMode && operatorMotionArgs.visualLine) { - vim.visualLine = true; - } - } - this.processOperator(cm, vim, command); - if (!visualMode) { - this.processMotion(cm, vim, command); - } - }, - processAction: function(cm, vim, command) { - var inputState = vim.inputState; - var repeat = inputState.getRepeat(); - var repeatIsExplicit = !!repeat; - var actionArgs = copyArgs(command.actionArgs) || {}; - if (inputState.selectedCharacter) { - actionArgs.selectedCharacter = inputState.selectedCharacter; - } - // Actions may or may not have motions and operators. Do these first. - if (command.operator) { - this.processOperator(cm, vim, command); - } - if (command.motion) { - this.processMotion(cm, vim, command); - } - if (command.motion || command.operator) { - this.evalInput(cm, vim); - } - actionArgs.repeat = repeat || 1; - actionArgs.repeatIsExplicit = repeatIsExplicit; - actionArgs.registerName = inputState.registerName; - clearInputState(cm); - vim.lastMotion = null; - if (command.isEdit) { - this.recordLastEdit(vim, inputState, command); - } - actions[command.action](cm, actionArgs, vim); - }, - processSearch: function(cm, vim, command) { - if (!cm.getSearchCursor) { - // Search depends on SearchCursor. - return; - } - var forward = command.searchArgs.forward; - var wholeWordOnly = command.searchArgs.wholeWordOnly; - getSearchState(cm).setReversed(!forward); - var promptPrefix = (forward) ? '/' : '?'; - var originalQuery = getSearchState(cm).getQuery(); - var originalScrollPos = cm.getScrollInfo(); - function handleQuery(query, ignoreCase, smartCase) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - try { - updateSearchQuery(cm, query, ignoreCase, smartCase); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + query); - clearInputState(cm); - return; - } - commandDispatcher.processMotion(cm, vim, { - type: 'motion', - motion: 'findNext', - motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist } - }); - } - function onPromptClose(query) { - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - handleQuery(query, true /** ignoreCase */, true /** smartCase */); - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - logSearchQuery(macroModeState, query); - } - } - function onPromptKeyUp(e, query, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - query = vimGlobalState.searchHistoryController.nextMatch(query, up) || ''; - close(query); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.searchHistoryController.reset(); - } - var parsedQuery; - try { - parsedQuery = updateSearchQuery(cm, query, - true /** ignoreCase */, true /** smartCase */); - } catch (e) { - // Swallow bad regexes for incremental search. - } - if (parsedQuery) { - cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30); - } else { - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - } - } - function onPromptKeyDown(e, query, close) { - var keyName = CodeMirror.keyName(e); - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || - (keyName == 'Backspace' && query == '')) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - updateSearchQuery(cm, originalQuery); - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - CodeMirror.e_stop(e); - clearInputState(cm); - close(); - cm.focus(); - } else if (keyName == 'Ctrl-U') { - // Ctrl-U clears input. - CodeMirror.e_stop(e); - close(''); - } - } - switch (command.searchArgs.querySrc) { - case 'prompt': - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { - var query = macroModeState.replaySearchQueries.shift(); - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - } else { - showPrompt(cm, { - onClose: onPromptClose, - prefix: promptPrefix, - desc: searchPromptDesc, - onKeyUp: onPromptKeyUp, - onKeyDown: onPromptKeyDown - }); - } - break; - case 'wordUnderCursor': - var word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - true /** noSymbol */); - var isKeyword = true; - if (!word) { - word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - false /** noSymbol */); - isKeyword = false; - } - if (!word) { - return; - } - var query = cm.getLine(word.start.line).substring(word.start.ch, - word.end.ch); - if (isKeyword && wholeWordOnly) { - query = '\\b' + query + '\\b'; - } else { - query = escapeRegex(query); - } - - // cachedCursor is used to save the old position of the cursor - // when * or # causes vim to seek for the nearest word and shift - // the cursor before entering the motion. - vimGlobalState.jumpList.cachedCursor = cm.getCursor(); - cm.setCursor(word.start); - - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - break; - } - }, - processEx: function(cm, vim, command) { - function onPromptClose(input) { - // Give the prompt some time to close so that if processCommand shows - // an error, the elements don't overlap. - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - exCommandDispatcher.processCommand(cm, input); - } - function onPromptKeyDown(e, input, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || - (keyName == 'Backspace' && input == '')) { - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - CodeMirror.e_stop(e); - clearInputState(cm); - close(); - cm.focus(); - } - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; - close(input); - } else if (keyName == 'Ctrl-U') { - // Ctrl-U clears input. - CodeMirror.e_stop(e); - close(''); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.exCommandHistoryController.reset(); - } - } - if (command.type == 'keyToEx') { - // Handle user defined Ex to Ex mappings - exCommandDispatcher.processCommand(cm, command.exArgs.input); - } else { - if (vim.visualMode) { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>', - onKeyDown: onPromptKeyDown}); - } else { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', - onKeyDown: onPromptKeyDown}); - } - } - }, - evalInput: function(cm, vim) { - // If the motion comand is set, execute both the operator and motion. - // Otherwise return. - var inputState = vim.inputState; - var motion = inputState.motion; - var motionArgs = inputState.motionArgs || {}; - var operator = inputState.operator; - var operatorArgs = inputState.operatorArgs || {}; - var registerName = inputState.registerName; - var sel = vim.sel; - // TODO: Make sure cm and vim selections are identical outside visual mode. - var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head')); - var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor')); - var oldHead = copyCursor(origHead); - var oldAnchor = copyCursor(origAnchor); - var newHead, newAnchor; - var repeat; - if (operator) { - this.recordLastEdit(vim, inputState); - } - if (inputState.repeatOverride !== undefined) { - // If repeatOverride is specified, that takes precedence over the - // input state's repeat. Used by Ex mode and can be user defined. - repeat = inputState.repeatOverride; - } else { - repeat = inputState.getRepeat(); - } - if (repeat > 0 && motionArgs.explicitRepeat) { - motionArgs.repeatIsExplicit = true; - } else if (motionArgs.noRepeat || - (!motionArgs.explicitRepeat && repeat === 0)) { - repeat = 1; - motionArgs.repeatIsExplicit = false; - } - if (inputState.selectedCharacter) { - // If there is a character input, stick it in all of the arg arrays. - motionArgs.selectedCharacter = operatorArgs.selectedCharacter = - inputState.selectedCharacter; - } - motionArgs.repeat = repeat; - clearInputState(cm); - if (motion) { - var motionResult = motions[motion](cm, origHead, motionArgs, vim); - vim.lastMotion = motions[motion]; - if (!motionResult) { - return; - } - if (motionArgs.toJumplist) { - var jumpList = vimGlobalState.jumpList; - // if the current motion is # or *, use cachedCursor - var cachedCursor = jumpList.cachedCursor; - if (cachedCursor) { - recordJumpPosition(cm, cachedCursor, motionResult); - delete jumpList.cachedCursor; - } else { - recordJumpPosition(cm, origHead, motionResult); - } - } - if (motionResult instanceof Array) { - newAnchor = motionResult[0]; - newHead = motionResult[1]; - } else { - newHead = motionResult; - } - // TODO: Handle null returns from motion commands better. - if (!newHead) { - newHead = copyCursor(origHead); - } - if (vim.visualMode) { - if (!(vim.visualBlock && newHead.ch === Infinity)) { - newHead = clipCursorToContent(cm, newHead, vim.visualBlock); - } - if (newAnchor) { - newAnchor = clipCursorToContent(cm, newAnchor, true); - } - newAnchor = newAnchor || oldAnchor; - sel.anchor = newAnchor; - sel.head = newHead; - updateCmSelection(cm); - updateMark(cm, vim, '<', - cursorIsBefore(newAnchor, newHead) ? newAnchor - : newHead); - updateMark(cm, vim, '>', - cursorIsBefore(newAnchor, newHead) ? newHead - : newAnchor); - } else if (!operator) { - newHead = clipCursorToContent(cm, newHead); - cm.setCursor(newHead.line, newHead.ch); - } - } - if (operator) { - if (operatorArgs.lastSel) { - // Replaying a visual mode operation - newAnchor = oldAnchor; - var lastSel = operatorArgs.lastSel; - var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line); - var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch); - if (lastSel.visualLine) { - // Linewise Visual mode: The same number of lines. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } else if (lastSel.visualBlock) { - // Blockwise Visual mode: The same number of lines and columns. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset); - } else if (lastSel.head.line == lastSel.anchor.line) { - // Normal Visual mode within one line: The same number of characters. - newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset); - } else { - // Normal Visual mode with several lines: The same number of lines, in the - // last line the same number of characters as in the last line the last time. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } - vim.visualMode = true; - vim.visualLine = lastSel.visualLine; - vim.visualBlock = lastSel.visualBlock; - sel = vim.sel = { - anchor: newAnchor, - head: newHead - }; - updateCmSelection(cm); - } else if (vim.visualMode) { - operatorArgs.lastSel = { - anchor: copyCursor(sel.anchor), - head: copyCursor(sel.head), - visualBlock: vim.visualBlock, - visualLine: vim.visualLine - }; - } - var curStart, curEnd, linewise, mode; - var cmSel; - if (vim.visualMode) { - // Init visual op - curStart = cursorMin(sel.head, sel.anchor); - curEnd = cursorMax(sel.head, sel.anchor); - linewise = vim.visualLine || operatorArgs.linewise; - mode = vim.visualBlock ? 'block' : - linewise ? 'line' : - 'char'; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode); - if (linewise) { - var ranges = cmSel.ranges; - if (mode == 'block') { - // Linewise operators in visual block mode extend to end of line - for (var i = 0; i < ranges.length; i++) { - ranges[i].head.ch = lineLength(cm, ranges[i].head.line); - } - } else if (mode == 'line') { - ranges[0].head = Pos(ranges[0].head.line + 1, 0); - } - } - } else { - // Init motion op - curStart = copyCursor(newAnchor || oldAnchor); - curEnd = copyCursor(newHead || oldHead); - if (cursorIsBefore(curEnd, curStart)) { - var tmp = curStart; - curStart = curEnd; - curEnd = tmp; - } - linewise = motionArgs.linewise || operatorArgs.linewise; - if (linewise) { - // Expand selection to entire line. - expandSelectionToLine(cm, curStart, curEnd); - } else if (motionArgs.forward) { - // Clip to trailing newlines only if the motion goes forward. - clipToLine(cm, curStart, curEnd); - } - mode = 'char'; - var exclusive = !motionArgs.inclusive || linewise; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode, exclusive); - } - cm.setSelections(cmSel.ranges, cmSel.primary); - vim.lastMotion = null; - operatorArgs.repeat = repeat; // For indent in visual mode. - operatorArgs.registerName = registerName; - // Keep track of linewise as it affects how paste and change behave. - operatorArgs.linewise = linewise; - var operatorMoveTo = operators[operator]( - cm, operatorArgs, cmSel.ranges, oldAnchor, newHead); - if (vim.visualMode) { - exitVisualMode(cm, operatorMoveTo != null); - } - if (operatorMoveTo) { - cm.setCursor(operatorMoveTo); - } - } - }, - recordLastEdit: function(vim, inputState, actionCommand) { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - vim.lastEditInputState = inputState; - vim.lastEditActionCommand = actionCommand; - macroModeState.lastInsertModeChanges.changes = []; - macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false; - } - }; - - /** - * typedef {Object{line:number,ch:number}} Cursor An object containing the - * position of the cursor. - */ - // All of the functions below return Cursor objects. - var motions = { - moveToTopLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).top + motionArgs.repeat -1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToMiddleLine: function(cm) { - var range = getUserVisibleLines(cm); - var line = Math.floor((range.top + range.bottom) * 0.5); - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToBottomLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - expandToLine: function(_cm, head, motionArgs) { - // Expands forward to end of line, and then to next line if repeat is - // >1. Does not handle backward motion! - var cur = head; - return Pos(cur.line + motionArgs.repeat - 1, Infinity); - }, - findNext: function(cm, _head, motionArgs) { - var state = getSearchState(cm); - var query = state.getQuery(); - if (!query) { - return; - } - var prev = !motionArgs.forward; - // If search is initiated with ? instead of /, negate direction. - prev = (state.isReversed()) ? !prev : prev; - highlightSearchMatches(cm, query); - return findNext(cm, prev/** prev */, query, motionArgs.repeat); - }, - goToMark: function(cm, _head, motionArgs, vim) { - var mark = vim.marks[motionArgs.selectedCharacter]; - if (mark) { - var pos = mark.find(); - return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos; - } - return null; - }, - moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) { - if (vim.visualBlock && motionArgs.sameLine) { - var sel = vim.sel; - return [ - clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)), - clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch)) - ]; - } else { - return ([vim.sel.head, vim.sel.anchor]); - } - }, - jumpToMark: function(cm, head, motionArgs, vim) { - var best = head; - for (var i = 0; i < motionArgs.repeat; i++) { - var cursor = best; - for (var key in vim.marks) { - if (!isLowerCase(key)) { - continue; - } - var mark = vim.marks[key].find(); - var isWrongDirection = (motionArgs.forward) ? - cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark); - - if (isWrongDirection) { - continue; - } - if (motionArgs.linewise && (mark.line == cursor.line)) { - continue; - } - - var equal = cursorEqual(cursor, best); - var between = (motionArgs.forward) ? - cursorIsBetween(cursor, mark, best) : - cursorIsBetween(best, mark, cursor); - - if (equal || between) { - best = mark; - } - } - } - - if (motionArgs.linewise) { - // Vim places the cursor on the first non-whitespace character of - // the line if there is one, else it places the cursor at the end - // of the line, regardless of whether a mark was found. - best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line))); - } - return best; - }, - moveByCharacters: function(_cm, head, motionArgs) { - var cur = head; - var repeat = motionArgs.repeat; - var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat; - return Pos(cur.line, ch); - }, - moveByLines: function(cm, head, motionArgs, vim) { - var cur = head; - var endCh = cur.ch; - // Depending what our last motion was, we may want to do different - // things. If our last motion was moving vertically, we want to - // preserve the HPos from our last horizontal move. If our last motion - // was going to the end of a line, moving vertically we should go to - // the end of the line, etc. - switch (vim.lastMotion) { - case this.moveByLines: - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveToColumn: - case this.moveToEol: - endCh = vim.lastHPos; - break; - default: - vim.lastHPos = endCh; - } - var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0); - var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat; - var first = cm.firstLine(); - var last = cm.lastLine(); - // Vim cancels linewise motions that start on an edge and move beyond - // that edge. It does not cancel motions that do not start on an edge. - if ((line < first && cur.line == first) || - (line > last && cur.line == last)) { - return; - } - if (motionArgs.toFirstChar){ - endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); - vim.lastHPos = endCh; - } - vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left; - return Pos(line, endCh); - }, - moveByDisplayLines: function(cm, head, motionArgs, vim) { - var cur = head; - switch (vim.lastMotion) { - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveByLines: - case this.moveToColumn: - case this.moveToEol: - break; - default: - vim.lastHSPos = cm.charCoords(cur,'div').left; - } - var repeat = motionArgs.repeat; - var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos); - if (res.hitSide) { - if (motionArgs.forward) { - var lastCharCoords = cm.charCoords(res, 'div'); - var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos }; - var res = cm.coordsChar(goalCoords, 'div'); - } else { - var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div'); - resCoords.left = vim.lastHSPos; - res = cm.coordsChar(resCoords, 'div'); - } - } - vim.lastHPos = res.ch; - return res; - }, - moveByPage: function(cm, head, motionArgs) { - // CodeMirror only exposes functions that move the cursor page down, so - // doing this bad hack to move the cursor and move it back. evalInput - // will move the cursor to where it should be in the end. - var curStart = head; - var repeat = motionArgs.repeat; - return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page'); - }, - moveByParagraph: function(cm, head, motionArgs) { - var dir = motionArgs.forward ? 1 : -1; - return findParagraph(cm, head, motionArgs.repeat, dir); - }, - moveByScroll: function(cm, head, motionArgs, vim) { - var scrollbox = cm.getScrollInfo(); - var curEnd = null; - var repeat = motionArgs.repeat; - if (!repeat) { - repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight()); - } - var orig = cm.charCoords(head, 'local'); - motionArgs.repeat = repeat; - var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim); - if (!curEnd) { - return null; - } - var dest = cm.charCoords(curEnd, 'local'); - cm.scrollTo(null, scrollbox.top + dest.top - orig.top); - return curEnd; - }, - moveByWords: function(cm, head, motionArgs) { - return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, - !!motionArgs.wordEnd, !!motionArgs.bigWord); - }, - moveTillCharacter: function(cm, _head, motionArgs) { - var repeat = motionArgs.repeat; - var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter); - var increment = motionArgs.forward ? -1 : 1; - recordLastCharacterSearch(increment, motionArgs); - if (!curEnd) return null; - curEnd.ch += increment; - return curEnd; - }, - moveToCharacter: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - recordLastCharacterSearch(0, motionArgs); - return moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToSymbol: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - return findSymbol(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToColumn: function(cm, head, motionArgs, vim) { - var repeat = motionArgs.repeat; - // repeat is equivalent to which column we want to move to! - vim.lastHPos = repeat - 1; - vim.lastHSPos = cm.charCoords(head,'div').left; - return moveToColumn(cm, repeat); - }, - moveToEol: function(cm, head, motionArgs, vim) { - var cur = head; - vim.lastHPos = Infinity; - var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity); - var end=cm.clipPos(retval); - end.ch--; - vim.lastHSPos = cm.charCoords(end,'div').left; - return retval; - }, - moveToFirstNonWhiteSpaceCharacter: function(cm, head) { - // Go to the start of the line where the text begins, or the end for - // whitespace-only lines - var cursor = head; - return Pos(cursor.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line))); - }, - moveToMatchedSymbol: function(cm, head) { - var cursor = head; - var line = cursor.line; - var ch = cursor.ch; - var lineText = cm.getLine(line); - var symbol; - do { - symbol = lineText.charAt(ch++); - if (symbol && isMatchableSymbol(symbol)) { - var style = cm.getTokenTypeAt(Pos(line, ch)); - if (style !== "string" && style !== "comment") { - break; - } - } - } while (symbol); - if (symbol) { - var matched = cm.findMatchingBracket(Pos(line, ch)); - return matched.to; - } else { - return cursor; - } - }, - moveToStartOfLine: function(_cm, head) { - return Pos(head.line, 0); - }, - moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) { - var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine(); - if (motionArgs.repeatIsExplicit) { - lineNum = motionArgs.repeat - cm.getOption('firstLineNumber'); - } - return Pos(lineNum, - findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum))); - }, - textObjectManipulation: function(cm, head, motionArgs, vim) { - // TODO: lots of possible exceptions that can be thrown here. Try da( - // outside of a () block. - - // TODO: adding <> >< to this map doesn't work, presumably because - // they're operators - var mirroredPairs = {'(': ')', ')': '(', - '{': '}', '}': '{', - '[': ']', ']': '['}; - var selfPaired = {'\'': true, '"': true}; - - var character = motionArgs.selectedCharacter; - // 'b' refers to '()' block. - // 'B' refers to '{}' block. - if (character == 'b') { - character = '('; - } else if (character == 'B') { - character = '{'; - } - - // Inclusive is the difference between a and i - // TODO: Instead of using the additional text object map to perform text - // object operations, merge the map into the defaultKeyMap and use - // motionArgs to define behavior. Define separate entries for 'aw', - // 'iw', 'a[', 'i[', etc. - var inclusive = !motionArgs.textObjectInner; - - var tmp; - if (mirroredPairs[character]) { - tmp = selectCompanionObject(cm, head, character, inclusive); - } else if (selfPaired[character]) { - tmp = findBeginningAndEnd(cm, head, character, inclusive); - } else if (character === 'W') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - true /** bigWord */); - } else if (character === 'w') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - false /** bigWord */); - } else if (character === 'p') { - tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive); - motionArgs.linewise = true; - if (vim.visualMode) { - if (!vim.visualLine) { vim.visualLine = true; } - } else { - var operatorArgs = vim.inputState.operatorArgs; - if (operatorArgs) { operatorArgs.linewise = true; } - tmp.end.line--; - } - } else { - // No text object defined for this, don't move. - return null; - } - - if (!cm.state.vim.visualMode) { - return [tmp.start, tmp.end]; - } else { - return expandSelection(cm, tmp.start, tmp.end); - } - }, - - repeatLastCharacterSearch: function(cm, head, motionArgs) { - var lastSearch = vimGlobalState.lastChararacterSearch; - var repeat = motionArgs.repeat; - var forward = motionArgs.forward === lastSearch.forward; - var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1); - cm.moveH(-increment, 'char'); - motionArgs.inclusive = forward ? true : false; - var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter); - if (!curEnd) { - cm.moveH(increment, 'char'); - return head; - } - curEnd.ch += increment; - return curEnd; - } - }; - - function defineMotion(name, fn) { - motions[name] = fn; - } - - function fillArray(val, times) { - var arr = []; - for (var i = 0; i < times; i++) { - arr.push(val); - } - return arr; - } - /** - * An operator acts on a text selection. It receives the list of selections - * as input. The corresponding CodeMirror selection is guaranteed to - * match the input selection. - */ - var operators = { - change: function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock; - if (!vim.visualMode) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - text = cm.getRange(anchor, head); - var lastState = vim.lastEditInputState || {}; - if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) { - // Exclude trailing whitespace if the range is not all whitespace. - var match = (/\s+$/).exec(text); - if (match && lastState.motionArgs && lastState.motionArgs.forward) { - head = offsetCursor(head, 0, - match[0].length); - text = text.slice(0, - match[0].length); - } - } - var wasLastLine = head.line - 1 == cm.lastLine(); - cm.replaceRange('', anchor, head); - if (args.linewise && !wasLastLine) { - // Push the next line back down, if there is a next line. - CodeMirror.commands.newlineAndIndent(cm); - // null ch so setCursor moves to end of line. - anchor.ch = null; - } - finalHead = anchor; - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = cursorMin(ranges[0].head, ranges[0].anchor); - } - vimGlobalState.registerController.pushText( - args.registerName, 'change', text, - args.linewise, ranges.length > 1); - actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim); - }, - // delete is a javascript keyword. - 'delete': function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - if (!vim.visualBlock) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - if (args.linewise && - head.line != cm.firstLine() && - anchor.line == cm.lastLine() && - anchor.line == head.line - 1) { - // Special case for dd on last line (and first line). - if (anchor.line == cm.firstLine()) { - anchor.ch = 0; - } else { - anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1)); - } - } - text = cm.getRange(anchor, head); - cm.replaceRange('', anchor, head); - finalHead = anchor; - if (args.linewise) { - finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor); - } - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = ranges[0].anchor; - } - vimGlobalState.registerController.pushText( - args.registerName, 'delete', text, - args.linewise, vim.visualBlock); - return clipCursorToContent(cm, finalHead); - }, - indent: function(cm, args, ranges) { - var vim = cm.state.vim; - var startLine = ranges[0].anchor.line; - var endLine = vim.visualBlock ? - ranges[ranges.length - 1].anchor.line : - ranges[0].head.line; - // In visual mode, n> shifts the selection right n times, instead of - // shifting n lines right once. - var repeat = (vim.visualMode) ? args.repeat : 1; - if (args.linewise) { - // The only way to delete a newline is to delete until the start of - // the next line, so in linewise mode evalInput will include the next - // line. We don't want this in indent, so we go back a line. - endLine--; - } - for (var i = startLine; i <= endLine; i++) { - for (var j = 0; j < repeat; j++) { - cm.indentLine(i, args.indentRight); - } - } - return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor); - }, - changeCase: function(cm, args, ranges, oldAnchor, newHead) { - var selections = cm.getSelections(); - var swapped = []; - var toLower = args.toLower; - for (var j = 0; j < selections.length; j++) { - var toSwap = selections[j]; - var text = ''; - if (toLower === true) { - text = toSwap.toLowerCase(); - } else if (toLower === false) { - text = toSwap.toUpperCase(); - } else { - for (var i = 0; i < toSwap.length; i++) { - var character = toSwap.charAt(i); - text += isUpperCase(character) ? character.toLowerCase() : - character.toUpperCase(); - } - } - swapped.push(text); - } - cm.replaceSelections(swapped); - if (args.shouldMoveCursor){ - return newHead; - } else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) { - return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor); - } else if (args.linewise){ - return oldAnchor; - } else { - return cursorMin(ranges[0].anchor, ranges[0].head); - } - }, - yank: function(cm, args, ranges, oldAnchor) { - var vim = cm.state.vim; - var text = cm.getSelection(); - var endPos = vim.visualMode - ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor) - : oldAnchor; - vimGlobalState.registerController.pushText( - args.registerName, 'yank', - text, args.linewise, vim.visualBlock); - return endPos; - } - }; - - function defineOperator(name, fn) { - operators[name] = fn; - } - - var actions = { - jumpListWalk: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat; - var forward = actionArgs.forward; - var jumpList = vimGlobalState.jumpList; - - var mark = jumpList.move(cm, forward ? repeat : -repeat); - var markPos = mark ? mark.find() : undefined; - markPos = markPos ? markPos : cm.getCursor(); - cm.setCursor(markPos); - }, - scroll: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat || 1; - var lineHeight = cm.defaultTextHeight(); - var top = cm.getScrollInfo().top; - var delta = lineHeight * repeat; - var newPos = actionArgs.forward ? top + delta : top - delta; - var cursor = copyCursor(cm.getCursor()); - var cursorCoords = cm.charCoords(cursor, 'local'); - if (actionArgs.forward) { - if (newPos > cursorCoords.top) { - cursor.line += (newPos - cursorCoords.top) / lineHeight; - cursor.line = Math.ceil(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo(null, cursorCoords.top); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } else { - var newBottom = newPos + cm.getScrollInfo().clientHeight; - if (newBottom < cursorCoords.bottom) { - cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight; - cursor.line = Math.floor(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo( - null, cursorCoords.bottom - cm.getScrollInfo().clientHeight); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } - }, - scrollToCursor: function(cm, actionArgs) { - var lineNum = cm.getCursor().line; - var charCoords = cm.charCoords(Pos(lineNum, 0), 'local'); - var height = cm.getScrollInfo().clientHeight; - var y = charCoords.top; - var lineHeight = charCoords.bottom - y; - switch (actionArgs.position) { - case 'center': y = y - (height / 2) + lineHeight; - break; - case 'bottom': y = y - height + lineHeight*1.4; - break; - case 'top': y = y + lineHeight*0.4; - break; - } - cm.scrollTo(null, y); - }, - replayMacro: function(cm, actionArgs, vim) { - var registerName = actionArgs.selectedCharacter; - var repeat = actionArgs.repeat; - var macroModeState = vimGlobalState.macroModeState; - if (registerName == '@') { - registerName = macroModeState.latestRegister; - } - while(repeat--){ - executeMacroRegister(cm, vim, macroModeState, registerName); - } - }, - enterMacroRecordMode: function(cm, actionArgs) { - var macroModeState = vimGlobalState.macroModeState; - var registerName = actionArgs.selectedCharacter; - macroModeState.enterMacroRecordMode(cm, registerName); - }, - enterInsertMode: function(cm, actionArgs, vim) { - if (cm.getOption('readOnly')) { return; } - vim.insertMode = true; - vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1; - var insertAt = (actionArgs) ? actionArgs.insertAt : null; - var sel = vim.sel; - var head = actionArgs.head || cm.getCursor('head'); - var height = cm.listSelections().length; - if (insertAt == 'eol') { - head = Pos(head.line, lineLength(cm, head.line)); - } else if (insertAt == 'charAfter') { - head = offsetCursor(head, 0, 1); - } else if (insertAt == 'firstNonBlank') { - head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head); - } else if (insertAt == 'startOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line < sel.anchor.line) { - head = sel.head; - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.min(sel.head.ch, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'endOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line >= sel.anchor.line) { - head = offsetCursor(sel.head, 0, 1); - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.max(sel.head.ch + 1, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'inplace') { - if (vim.visualMode){ - return; - } - } - cm.setOption('keyMap', 'vim-insert'); - cm.setOption('disableInput', false); - if (actionArgs && actionArgs.replace) { - // Handle Replace-mode as a special case of insert mode. - cm.toggleOverwrite(true); - cm.setOption('keyMap', 'vim-replace'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"}); - } else { - cm.setOption('keyMap', 'vim-insert'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"}); - } - if (!vimGlobalState.macroModeState.isPlaying) { - // Only record if not replaying. - cm.on('change', onChange); - CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (vim.visualMode) { - exitVisualMode(cm); - } - selectForInsert(cm, head, height); - }, - toggleVisualMode: function(cm, actionArgs, vim) { - var repeat = actionArgs.repeat; - var anchor = cm.getCursor(); - var head; - // TODO: The repeat should actually select number of characters/lines - // equal to the repeat times the size of the previous visual - // operation. - if (!vim.visualMode) { - // Entering visual mode - vim.visualMode = true; - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - head = clipCursorToContent( - cm, Pos(anchor.line, anchor.ch + repeat - 1), - true /** includeLineBreak */); - vim.sel = { - anchor: anchor, - head: head - }; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - } else if (vim.visualLine ^ actionArgs.linewise || - vim.visualBlock ^ actionArgs.blockwise) { - // Toggling between modes - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - } else { - exitVisualMode(cm); - } - }, - reselectLastSelection: function(cm, _actionArgs, vim) { - var lastSelection = vim.lastSelection; - if (vim.visualMode) { - updateLastSelection(cm, vim); - } - if (lastSelection) { - var anchor = lastSelection.anchorMark.find(); - var head = lastSelection.headMark.find(); - if (!anchor || !head) { - // If the marks have been destroyed due to edits, do nothing. - return; - } - vim.sel = { - anchor: anchor, - head: head - }; - vim.visualMode = true; - vim.visualLine = lastSelection.visualLine; - vim.visualBlock = lastSelection.visualBlock; - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - CodeMirror.signal(cm, 'vim-mode-change', { - mode: 'visual', - subMode: vim.visualLine ? 'linewise' : - vim.visualBlock ? 'blockwise' : ''}); - } - }, - joinLines: function(cm, actionArgs, vim) { - var curStart, curEnd; - if (vim.visualMode) { - curStart = cm.getCursor('anchor'); - curEnd = cm.getCursor('head'); - if (cursorIsBefore(curEnd, curStart)) { - var tmp = curEnd; - curEnd = curStart; - curStart = tmp; - } - curEnd.ch = lineLength(cm, curEnd.line) - 1; - } else { - // Repeat is the number of lines to join. Minimum 2 lines. - var repeat = Math.max(actionArgs.repeat, 2); - curStart = cm.getCursor(); - curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1, - Infinity)); - } - var finalCh = 0; - for (var i = curStart.line; i < curEnd.line; i++) { - finalCh = lineLength(cm, curStart.line); - var tmp = Pos(curStart.line + 1, - lineLength(cm, curStart.line + 1)); - var text = cm.getRange(curStart, tmp); - text = text.replace(/\n\s*/g, ' '); - cm.replaceRange(text, curStart, tmp); - } - var curFinalPos = Pos(curStart.line, finalCh); - if (vim.visualMode) { - exitVisualMode(cm, false); - } - cm.setCursor(curFinalPos); - }, - newLineAndEnterInsertMode: function(cm, actionArgs, vim) { - vim.insertMode = true; - var insertAt = copyCursor(cm.getCursor()); - if (insertAt.line === cm.firstLine() && !actionArgs.after) { - // Special case for inserting newline before start of document. - cm.replaceRange('\n', Pos(cm.firstLine(), 0)); - cm.setCursor(cm.firstLine(), 0); - } else { - insertAt.line = (actionArgs.after) ? insertAt.line : - insertAt.line - 1; - insertAt.ch = lineLength(cm, insertAt.line); - cm.setCursor(insertAt); - var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - newlineFn(cm); - } - this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim); - }, - paste: function(cm, actionArgs, vim) { - var cur = copyCursor(cm.getCursor()); - var register = vimGlobalState.registerController.getRegister( - actionArgs.registerName); - var text = register.toString(); - if (!text) { - return; - } - if (actionArgs.matchIndent) { - var tabSize = cm.getOption("tabSize"); - // length that considers tabs and tabSize - var whitespaceLength = function(str) { - var tabs = (str.split("\t").length - 1); - var spaces = (str.split(" ").length - 1); - return tabs * tabSize + spaces * 1; - }; - var currentLine = cm.getLine(cm.getCursor().line); - var indent = whitespaceLength(currentLine.match(/^\s*/)[0]); - // chomp last newline b/c don't want it to match /^\s*/gm - var chompedText = text.replace(/\n$/, ''); - var wasChomped = text !== chompedText; - var firstIndent = whitespaceLength(text.match(/^\s*/)[0]); - var text = chompedText.replace(/^\s*/gm, function(wspace) { - var newIndent = indent + (whitespaceLength(wspace) - firstIndent); - if (newIndent < 0) { - return ""; - } - else if (cm.getOption("indentWithTabs")) { - var quotient = Math.floor(newIndent / tabSize); - return Array(quotient + 1).join('\t'); - } - else { - return Array(newIndent + 1).join(' '); - } - }); - text += wasChomped ? "\n" : ""; - } - if (actionArgs.repeat > 1) { - var text = Array(actionArgs.repeat + 1).join(text); - } - var linewise = register.linewise; - var blockwise = register.blockwise; - if (linewise) { - if(vim.visualMode) { - text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; - } else if (actionArgs.after) { - // Move the newline at the end to the start instead, and paste just - // before the newline character of the line we are on right now. - text = '\n' + text.slice(0, text.length - 1); - cur.ch = lineLength(cm, cur.line); - } else { - cur.ch = 0; - } - } else { - if (blockwise) { - text = text.split('\n'); - for (var i = 0; i < text.length; i++) { - text[i] = (text[i] == '') ? ' ' : text[i]; - } - } - cur.ch += actionArgs.after ? 1 : 0; - } - var curPosFinal; - var idx; - if (vim.visualMode) { - // save the pasted text for reselection if the need arises - vim.lastPastedText = text; - var lastSelectionCurEnd; - var selectedArea = getSelectedAreaRange(cm, vim); - var selectionStart = selectedArea[0]; - var selectionEnd = selectedArea[1]; - var selectedText = cm.getSelection(); - var selections = cm.listSelections(); - var emptyStrings = new Array(selections.length).join('1').split('1'); - // save the curEnd marker before it get cleared due to cm.replaceRange. - if (vim.lastSelection) { - lastSelectionCurEnd = vim.lastSelection.headMark.find(); - } - // push the previously selected text to unnamed register - vimGlobalState.registerController.unnamedRegister.setText(selectedText); - if (blockwise) { - // first delete the selected text - cm.replaceSelections(emptyStrings); - // Set new selections as per the block length of the yanked text - selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch); - cm.setCursor(selectionStart); - selectBlock(cm, selectionEnd); - cm.replaceSelections(text); - curPosFinal = selectionStart; - } else if (vim.visualBlock) { - cm.replaceSelections(emptyStrings); - cm.setCursor(selectionStart); - cm.replaceRange(text, selectionStart, selectionStart); - curPosFinal = selectionStart; - } else { - cm.replaceRange(text, selectionStart, selectionEnd); - curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1); - } - // restore the the curEnd marker - if(lastSelectionCurEnd) { - vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd); - } - if (linewise) { - curPosFinal.ch=0; - } - } else { - if (blockwise) { - cm.setCursor(cur); - for (var i = 0; i < text.length; i++) { - var line = cur.line+i; - if (line > cm.lastLine()) { - cm.replaceRange('\n', Pos(line, 0)); - } - var lastCh = lineLength(cm, line); - if (lastCh < cur.ch) { - extendLineToColumn(cm, line, cur.ch); - } - } - cm.setCursor(cur); - selectBlock(cm, Pos(cur.line + text.length-1, cur.ch)); - cm.replaceSelections(text); - curPosFinal = cur; - } else { - cm.replaceRange(text, cur); - // Now fine tune the cursor to where we want it. - if (linewise && actionArgs.after) { - curPosFinal = Pos( - cur.line + 1, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); - } else if (linewise && !actionArgs.after) { - curPosFinal = Pos( - cur.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))); - } else if (!linewise && actionArgs.after) { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length - 1); - } else { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length); - } - } - } - if (vim.visualMode) { - exitVisualMode(cm, false); - } - cm.setCursor(curPosFinal); - }, - undo: function(cm, actionArgs) { - cm.operation(function() { - repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)(); - cm.setCursor(cm.getCursor('anchor')); - }); - }, - redo: function(cm, actionArgs) { - repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)(); - }, - setRegister: function(_cm, actionArgs, vim) { - vim.inputState.registerName = actionArgs.selectedCharacter; - }, - setMark: function(cm, actionArgs, vim) { - var markName = actionArgs.selectedCharacter; - updateMark(cm, vim, markName, cm.getCursor()); - }, - replace: function(cm, actionArgs, vim) { - var replaceWith = actionArgs.selectedCharacter; - var curStart = cm.getCursor(); - var replaceTo; - var curEnd; - var selections = cm.listSelections(); - if (vim.visualMode) { - curStart = cm.getCursor('start'); - curEnd = cm.getCursor('end'); - } else { - var line = cm.getLine(curStart.line); - replaceTo = curStart.ch + actionArgs.repeat; - if (replaceTo > line.length) { - replaceTo=line.length; - } - curEnd = Pos(curStart.line, replaceTo); - } - if (replaceWith=='\n') { - if (!vim.visualMode) cm.replaceRange('', curStart, curEnd); - // special case, where vim help says to replace by just one line-break - (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm); - } else { - var replaceWithStr = cm.getRange(curStart, curEnd); - //replace all characters in range by selected, but keep linebreaks - replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith); - if (vim.visualBlock) { - // Tabs are split in visua block before replacing - var spaces = new Array(cm.getOption("tabSize")+1).join(' '); - replaceWithStr = cm.getSelection(); - replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n'); - cm.replaceSelections(replaceWithStr); - } else { - cm.replaceRange(replaceWithStr, curStart, curEnd); - } - if (vim.visualMode) { - curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ? - selections[0].anchor : selections[0].head; - cm.setCursor(curStart); - exitVisualMode(cm, false); - } else { - cm.setCursor(offsetCursor(curEnd, 0, -1)); - } - } - }, - incrementNumberToken: function(cm, actionArgs) { - var cur = cm.getCursor(); - var lineStr = cm.getLine(cur.line); - var re = /-?\d+/g; - var match; - var start; - var end; - var numberStr; - var token; - while ((match = re.exec(lineStr)) !== null) { - token = match[0]; - start = match.index; - end = start + token.length; - if (cur.ch < end)break; - } - if (!actionArgs.backtrack && (end <= cur.ch))return; - if (token) { - var increment = actionArgs.increase ? 1 : -1; - var number = parseInt(token) + (increment * actionArgs.repeat); - var from = Pos(cur.line, start); - var to = Pos(cur.line, end); - numberStr = number.toString(); - cm.replaceRange(numberStr, from, to); - } else { - return; - } - cm.setCursor(Pos(cur.line, start + numberStr.length - 1)); - }, - repeatLastEdit: function(cm, actionArgs, vim) { - var lastEditInputState = vim.lastEditInputState; - if (!lastEditInputState) { return; } - var repeat = actionArgs.repeat; - if (repeat && actionArgs.repeatIsExplicit) { - vim.lastEditInputState.repeatOverride = repeat; - } else { - repeat = vim.lastEditInputState.repeatOverride || repeat; - } - repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */); - }, - exitInsertMode: exitInsertMode - }; - - function defineAction(name, fn) { - actions[name] = fn; - } - - /* - * Below are miscellaneous utility functions used by vim.js - */ - - /** - * Clips cursor to ensure that line is within the buffer's range - * If includeLineBreak is true, then allow cur.ch == lineLength. - */ - function clipCursorToContent(cm, cur, includeLineBreak) { - var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() ); - var maxCh = lineLength(cm, line) - 1; - maxCh = (includeLineBreak) ? maxCh + 1 : maxCh; - var ch = Math.min(Math.max(0, cur.ch), maxCh); - return Pos(line, ch); - } - function copyArgs(args) { - var ret = {}; - for (var prop in args) { - if (args.hasOwnProperty(prop)) { - ret[prop] = args[prop]; - } - } - return ret; - } - function offsetCursor(cur, offsetLine, offsetCh) { - if (typeof offsetLine === 'object') { - offsetCh = offsetLine.ch; - offsetLine = offsetLine.line; - } - return Pos(cur.line + offsetLine, cur.ch + offsetCh); - } - function getOffset(anchor, head) { - return { - line: head.line - anchor.line, - ch: head.line - anchor.line - }; - } - function commandMatches(keys, keyMap, context, inputState) { - // Partial matches are not applied. They inform the key handler - // that the current key sequence is a subsequence of a valid key - // sequence, so that the key buffer is not cleared. - var match, partial = [], full = []; - for (var i = 0; i < keyMap.length; i++) { - var command = keyMap[i]; - if (context == 'insert' && command.context != 'insert' || - command.context && command.context != context || - inputState.operator && command.type == 'action' || - !(match = commandMatch(keys, command.keys))) { continue; } - if (match == 'partial') { partial.push(command); } - if (match == 'full') { full.push(command); } - } - return { - partial: partial.length && partial, - full: full.length && full - }; - } - function commandMatch(pressed, mapped) { - if (mapped.slice(-11) == '') { - // Last character matches anything. - var prefixLen = mapped.length - 11; - var pressedPrefix = pressed.slice(0, prefixLen); - var mappedPrefix = mapped.slice(0, prefixLen); - return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' : - mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false; - } else { - return pressed == mapped ? 'full' : - mapped.indexOf(pressed) == 0 ? 'partial' : false; - } - } - function lastChar(keys) { - var match = /^.*(<[\w\-]+>)$/.exec(keys); - var selectedCharacter = match ? match[1] : keys.slice(-1); - if (selectedCharacter.length > 1){ - switch(selectedCharacter){ - case '': - selectedCharacter='\n'; - break; - case '': - selectedCharacter=' '; - break; - default: - break; - } - } - return selectedCharacter; - } - function repeatFn(cm, fn, repeat) { - return function() { - for (var i = 0; i < repeat; i++) { - fn(cm); - } - }; - } - function copyCursor(cur) { - return Pos(cur.line, cur.ch); - } - function cursorEqual(cur1, cur2) { - return cur1.ch == cur2.ch && cur1.line == cur2.line; - } - function cursorIsBefore(cur1, cur2) { - if (cur1.line < cur2.line) { - return true; - } - if (cur1.line == cur2.line && cur1.ch < cur2.ch) { - return true; - } - return false; - } - function cursorMin(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur1 : cur2; - } - function cursorMax(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur2 : cur1; - } - function cursorIsBetween(cur1, cur2, cur3) { - // returns true if cur2 is between cur1 and cur3. - var cur1before2 = cursorIsBefore(cur1, cur2); - var cur2before3 = cursorIsBefore(cur2, cur3); - return cur1before2 && cur2before3; - } - function lineLength(cm, lineNum) { - return cm.getLine(lineNum).length; - } - function trim(s) { - if (s.trim) { - return s.trim(); - } - return s.replace(/^\s+|\s+$/g, ''); - } - function escapeRegex(s) { - return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1'); - } - function extendLineToColumn(cm, lineNum, column) { - var endCh = lineLength(cm, lineNum); - var spaces = new Array(column-endCh+1).join(' '); - cm.setCursor(Pos(lineNum, endCh)); - cm.replaceRange(spaces, cm.getCursor()); - } - // This functions selects a rectangular block - // of text with selectionEnd as any of its corner - // Height of block: - // Difference in selectionEnd.line and first/last selection.line - // Width of the block: - // Distance between selectionEnd.ch and any(first considered here) selection.ch - function selectBlock(cm, selectionEnd) { - var selections = [], ranges = cm.listSelections(); - var head = copyCursor(cm.clipPos(selectionEnd)); - var isClipped = !cursorEqual(selectionEnd, head); - var curHead = cm.getCursor('head'); - var primIndex = getIndex(ranges, curHead); - var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor); - var max = ranges.length - 1; - var index = max - primIndex > primIndex ? max : 0; - var base = ranges[index].anchor; - - var firstLine = Math.min(base.line, head.line); - var lastLine = Math.max(base.line, head.line); - var baseCh = base.ch, headCh = head.ch; - - var dir = ranges[index].head.ch - baseCh; - var newDir = headCh - baseCh; - if (dir > 0 && newDir <= 0) { - baseCh++; - if (!isClipped) { headCh--; } - } else if (dir < 0 && newDir >= 0) { - baseCh--; - if (!wasClipped) { headCh++; } - } else if (dir < 0 && newDir == -1) { - baseCh--; - headCh++; - } - for (var line = firstLine; line <= lastLine; line++) { - var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)}; - selections.push(range); - } - primIndex = head.line == lastLine ? selections.length - 1 : 0; - cm.setSelections(selections); - selectionEnd.ch = headCh; - base.ch = baseCh; - return base; - } - function selectForInsert(cm, head, height) { - var sel = []; - for (var i = 0; i < height; i++) { - var lineHead = offsetCursor(head, i, 0); - sel.push({anchor: lineHead, head: lineHead}); - } - cm.setSelections(sel, 0); - } - // getIndex returns the index of the cursor in the selections. - function getIndex(ranges, cursor, end) { - for (var i = 0; i < ranges.length; i++) { - var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor); - var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor); - if (atAnchor || atHead) { - return i; - } - } - return -1; - } - function getSelectedAreaRange(cm, vim) { - var lastSelection = vim.lastSelection; - var getCurrentSelectedAreaRange = function() { - var selections = cm.listSelections(); - var start = selections[0]; - var end = selections[selections.length-1]; - var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head; - var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor; - return [selectionStart, selectionEnd]; - }; - var getLastSelectedAreaRange = function() { - var selectionStart = cm.getCursor(); - var selectionEnd = cm.getCursor(); - var block = lastSelection.visualBlock; - if (block) { - var width = block.width; - var height = block.height; - selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width); - var selections = []; - // selectBlock creates a 'proper' rectangular block. - // We do not want that in all cases, so we manually set selections. - for (var i = selectionStart.line; i < selectionEnd.line; i++) { - var anchor = Pos(i, selectionStart.ch); - var head = Pos(i, selectionEnd.ch); - var range = {anchor: anchor, head: head}; - selections.push(range); - } - cm.setSelections(selections); - } else { - var start = lastSelection.anchorMark.find(); - var end = lastSelection.headMark.find(); - var line = end.line - start.line; - var ch = end.ch - start.ch; - selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch}; - if (lastSelection.visualLine) { - selectionStart = Pos(selectionStart.line, 0); - selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line)); - } - cm.setSelection(selectionStart, selectionEnd); - } - return [selectionStart, selectionEnd]; - }; - if (!vim.visualMode) { - // In case of replaying the action. - return getLastSelectedAreaRange(); - } else { - return getCurrentSelectedAreaRange(); - } - } - // Updates the previous selection with the current selection's values. This - // should only be called in visual mode. - function updateLastSelection(cm, vim) { - var anchor = vim.sel.anchor; - var head = vim.sel.head; - // To accommodate the effect of lastPastedText in the last selection - if (vim.lastPastedText) { - head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); - vim.lastPastedText = null; - } - vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), - 'headMark': cm.setBookmark(head), - 'anchor': copyCursor(anchor), - 'head': copyCursor(head), - 'visualMode': vim.visualMode, - 'visualLine': vim.visualLine, - 'visualBlock': vim.visualBlock}; - } - function expandSelection(cm, start, end) { - var sel = cm.state.vim.sel; - var head = sel.head; - var anchor = sel.anchor; - var tmp; - if (cursorIsBefore(end, start)) { - tmp = end; - end = start; - start = tmp; - } - if (cursorIsBefore(head, anchor)) { - head = cursorMin(start, head); - anchor = cursorMax(anchor, end); - } else { - anchor = cursorMin(start, anchor); - head = cursorMax(head, end); - head = offsetCursor(head, 0, -1); - if (head.ch == -1 && head.line != cm.firstLine()) { - head = Pos(head.line - 1, lineLength(cm, head.line - 1)); - } - } - return [anchor, head]; - } - /** - * Updates the CodeMirror selection to match the provided vim selection. - * If no arguments are given, it uses the current vim selection state. - */ - function updateCmSelection(cm, sel, mode) { - var vim = cm.state.vim; - sel = sel || vim.sel; - var mode = mode || - vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char'; - var cmSel = makeCmSelection(cm, sel, mode); - cm.setSelections(cmSel.ranges, cmSel.primary); - updateFakeCursor(cm); - } - function makeCmSelection(cm, sel, mode, exclusive) { - var head = copyCursor(sel.head); - var anchor = copyCursor(sel.anchor); - if (mode == 'char') { - var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - head = offsetCursor(sel.head, 0, headOffset); - anchor = offsetCursor(sel.anchor, 0, anchorOffset); - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'line') { - if (!cursorIsBefore(sel.head, sel.anchor)) { - anchor.ch = 0; - - var lastLine = cm.lastLine(); - if (head.line > lastLine) { - head.line = lastLine; - } - head.ch = lineLength(cm, head.line); - } else { - head.ch = 0; - anchor.ch = lineLength(cm, anchor.line); - } - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'block') { - var top = Math.min(anchor.line, head.line), - left = Math.min(anchor.ch, head.ch), - bottom = Math.max(anchor.line, head.line), - right = Math.max(anchor.ch, head.ch) + 1; - var height = bottom - top + 1; - var primary = head.line == top ? 0 : height - 1; - var ranges = []; - for (var i = 0; i < height; i++) { - ranges.push({ - anchor: Pos(top + i, left), - head: Pos(top + i, right) - }); - } - return { - ranges: ranges, - primary: primary - }; - } - } - function getHead(cm) { - var cur = cm.getCursor('head'); - if (cm.getSelection().length == 1) { - // Small corner case when only 1 character is selected. The "real" - // head is the left of head and anchor. - cur = cursorMin(cur, cm.getCursor('anchor')); - } - return cur; - } - - /** - * If moveHead is set to false, the CodeMirror selection will not be - * touched. The caller assumes the responsibility of putting the cursor - * in the right place. - */ - function exitVisualMode(cm, moveHead) { - var vim = cm.state.vim; - if (moveHead !== false) { - cm.setCursor(clipCursorToContent(cm, vim.sel.head)); - } - updateLastSelection(cm, vim); - vim.visualMode = false; - vim.visualLine = false; - vim.visualBlock = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - } - - // Remove any trailing newlines from the selection. For - // example, with the caret at the start of the last word on the line, - // 'dw' should word, but not the newline, while 'w' should advance the - // caret to the first character of the next line. - function clipToLine(cm, curStart, curEnd) { - var selection = cm.getRange(curStart, curEnd); - // Only clip if the selection ends with trailing newline + whitespace - if (/\n\s*$/.test(selection)) { - var lines = selection.split('\n'); - // We know this is all whitepsace. - lines.pop(); - - // Cases: - // 1. Last word is an empty line - do not clip the trailing '\n' - // 2. Last word is not an empty line - clip the trailing '\n' - var line; - // Find the line containing the last word, and clip all whitespace up - // to it. - for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) { - curEnd.line--; - curEnd.ch = 0; - } - // If the last word is not an empty line, clip an additional newline - if (line) { - curEnd.line--; - curEnd.ch = lineLength(cm, curEnd.line); - } else { - curEnd.ch = 0; - } - } - } - - // Expand the selection to line ends. - function expandSelectionToLine(_cm, curStart, curEnd) { - curStart.ch = 0; - curEnd.ch = 0; - curEnd.line++; - } - - function findFirstNonWhiteSpaceCharacter(text) { - if (!text) { - return 0; - } - var firstNonWS = text.search(/\S/); - return firstNonWS == -1 ? text.length : firstNonWS; - } - - function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) { - var cur = getHead(cm); - var line = cm.getLine(cur.line); - var idx = cur.ch; - - // Seek to first word or non-whitespace character, depending on if - // noSymbol is true. - var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0]; - while (!test(line.charAt(idx))) { - idx++; - if (idx >= line.length) { return null; } - } - - if (bigWord) { - test = bigWordCharTest[0]; - } else { - test = wordCharTest[0]; - if (!test(line.charAt(idx))) { - test = wordCharTest[1]; - } - } - - var end = idx, start = idx; - while (test(line.charAt(end)) && end < line.length) { end++; } - while (test(line.charAt(start)) && start >= 0) { start--; } - start++; - - if (inclusive) { - // If present, include all whitespace after word. - // Otherwise, include all whitespace before word, except indentation. - var wordEnd = end; - while (/\s/.test(line.charAt(end)) && end < line.length) { end++; } - if (wordEnd == end) { - var wordStart = start; - while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; } - if (!start) { start = wordStart; } - } - } - return { start: Pos(cur.line, start), end: Pos(cur.line, end) }; - } - - function recordJumpPosition(cm, oldCur, newCur) { - if (!cursorEqual(oldCur, newCur)) { - vimGlobalState.jumpList.add(cm, oldCur, newCur); - } - } - - function recordLastCharacterSearch(increment, args) { - vimGlobalState.lastChararacterSearch.increment = increment; - vimGlobalState.lastChararacterSearch.forward = args.forward; - vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter; - } - - var symbolToMode = { - '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket', - '[': 'section', ']': 'section', - '*': 'comment', '/': 'comment', - 'm': 'method', 'M': 'method', - '#': 'preprocess' - }; - var findSymbolModes = { - bracket: { - isComplete: function(state) { - if (state.nextCh === state.symb) { - state.depth++; - if (state.depth >= 1)return true; - } else if (state.nextCh === state.reverseSymb) { - state.depth--; - } - return false; - } - }, - section: { - init: function(state) { - state.curMoveThrough = true; - state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}'; - }, - isComplete: function(state) { - return state.index === 0 && state.nextCh === state.symb; - } - }, - comment: { - isComplete: function(state) { - var found = state.lastCh === '*' && state.nextCh === '/'; - state.lastCh = state.nextCh; - return found; - } - }, - // TODO: The original Vim implementation only operates on level 1 and 2. - // The current implementation doesn't check for code block level and - // therefore it operates on any levels. - method: { - init: function(state) { - state.symb = (state.symb === 'm' ? '{' : '}'); - state.reverseSymb = state.symb === '{' ? '}' : '{'; - }, - isComplete: function(state) { - if (state.nextCh === state.symb)return true; - return false; - } - }, - preprocess: { - init: function(state) { - state.index = 0; - }, - isComplete: function(state) { - if (state.nextCh === '#') { - var token = state.lineText.match(/#(\w+)/)[1]; - if (token === 'endif') { - if (state.forward && state.depth === 0) { - return true; - } - state.depth++; - } else if (token === 'if') { - if (!state.forward && state.depth === 0) { - return true; - } - state.depth--; - } - if (token === 'else' && state.depth === 0)return true; - } - return false; - } - } - }; - function findSymbol(cm, repeat, forward, symb) { - var cur = copyCursor(cm.getCursor()); - var increment = forward ? 1 : -1; - var endLine = forward ? cm.lineCount() : -1; - var curCh = cur.ch; - var line = cur.line; - var lineText = cm.getLine(line); - var state = { - lineText: lineText, - nextCh: lineText.charAt(curCh), - lastCh: null, - index: curCh, - symb: symb, - reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb], - forward: forward, - depth: 0, - curMoveThrough: false - }; - var mode = symbolToMode[symb]; - if (!mode)return cur; - var init = findSymbolModes[mode].init; - var isComplete = findSymbolModes[mode].isComplete; - if (init) { init(state); } - while (line !== endLine && repeat) { - state.index += increment; - state.nextCh = state.lineText.charAt(state.index); - if (!state.nextCh) { - line += increment; - state.lineText = cm.getLine(line) || ''; - if (increment > 0) { - state.index = 0; - } else { - var lineLen = state.lineText.length; - state.index = (lineLen > 0) ? (lineLen-1) : 0; - } - state.nextCh = state.lineText.charAt(state.index); - } - if (isComplete(state)) { - cur.line = line; - cur.ch = state.index; - repeat--; - } - } - if (state.nextCh || state.curMoveThrough) { - return Pos(line, state.index); - } - return cur; - } - - /* - * Returns the boundaries of the next word. If the cursor in the middle of - * the word, then returns the boundaries of the current word, starting at - * the cursor. If the cursor is at the start/end of a word, and we are going - * forward/backward, respectively, find the boundaries of the next word. - * - * @param {CodeMirror} cm CodeMirror object. - * @param {Cursor} cur The cursor position. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only [a-zA-Z0-9] characters count as part of the word. - * @param {boolean} emptyLineIsWord True if empty lines should be treated - * as words. - * @return {Object{from:number, to:number, line: number}} The boundaries of - * the word, or null if there are no more words. - */ - function findWord(cm, cur, forward, bigWord, emptyLineIsWord) { - var lineNum = cur.line; - var pos = cur.ch; - var line = cm.getLine(lineNum); - var dir = forward ? 1 : -1; - var charTests = bigWord ? bigWordCharTest: wordCharTest; - - if (emptyLineIsWord && line == '') { - lineNum += dir; - line = cm.getLine(lineNum); - if (!isLine(cm, lineNum)) { - return null; - } - pos = (forward) ? 0 : line.length; - } - - while (true) { - if (emptyLineIsWord && line == '') { - return { from: 0, to: 0, line: lineNum }; - } - var stop = (dir > 0) ? line.length : -1; - var wordStart = stop, wordEnd = stop; - // Find bounds of next word. - while (pos != stop) { - var foundWord = false; - for (var i = 0; i < charTests.length && !foundWord; ++i) { - if (charTests[i](line.charAt(pos))) { - wordStart = pos; - // Advance to end of word. - while (pos != stop && charTests[i](line.charAt(pos))) { - pos += dir; - } - wordEnd = pos; - foundWord = wordStart != wordEnd; - if (wordStart == cur.ch && lineNum == cur.line && - wordEnd == wordStart + dir) { - // We started at the end of a word. Find the next one. - continue; - } else { - return { - from: Math.min(wordStart, wordEnd + 1), - to: Math.max(wordStart, wordEnd), - line: lineNum }; - } - } - } - if (!foundWord) { - pos += dir; - } - } - // Advance to next/prev line. - lineNum += dir; - if (!isLine(cm, lineNum)) { - return null; - } - line = cm.getLine(lineNum); - pos = (dir > 0) ? 0 : line.length; - } - // Should never get here. - throw new Error('The impossible happened.'); - } - - /** - * @param {CodeMirror} cm CodeMirror object. - * @param {Pos} cur The position to start from. - * @param {int} repeat Number of words to move past. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} wordEnd True to move to end of word. False to move to - * beginning of word. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only alphabet characters count as part of the word. - * @return {Cursor} The position the cursor should move to. - */ - function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) { - var curStart = copyCursor(cur); - var words = []; - if (forward && !wordEnd || !forward && wordEnd) { - repeat++; - } - // For 'e', empty lines are not considered words, go figure. - var emptyLineIsWord = !(forward && wordEnd); - for (var i = 0; i < repeat; i++) { - var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord); - if (!word) { - var eodCh = lineLength(cm, cm.lastLine()); - words.push(forward - ? {line: cm.lastLine(), from: eodCh, to: eodCh} - : {line: 0, from: 0, to: 0}); - break; - } - words.push(word); - cur = Pos(word.line, forward ? (word.to - 1) : word.from); - } - var shortCircuit = words.length != repeat; - var firstWord = words[0]; - var lastWord = words.pop(); - if (forward && !wordEnd) { - // w - if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.from); - } else if (forward && wordEnd) { - return Pos(lastWord.line, lastWord.to - 1); - } else if (!forward && wordEnd) { - // ge - if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.to); - } else { - // b - return Pos(lastWord.line, lastWord.from); - } - } - - function moveToCharacter(cm, repeat, forward, character) { - var cur = cm.getCursor(); - var start = cur.ch; - var idx; - for (var i = 0; i < repeat; i ++) { - var line = cm.getLine(cur.line); - idx = charIdxInLine(start, line, character, forward, true); - if (idx == -1) { - return null; - } - start = idx; - } - return Pos(cm.getCursor().line, idx); - } - - function moveToColumn(cm, repeat) { - // repeat is always >= 1, so repeat - 1 always corresponds - // to the column we want to go to. - var line = cm.getCursor().line; - return clipCursorToContent(cm, Pos(line, repeat - 1)); - } - - function updateMark(cm, vim, markName, pos) { - if (!inArray(markName, validMarks)) { - return; - } - if (vim.marks[markName]) { - vim.marks[markName].clear(); - } - vim.marks[markName] = cm.setBookmark(pos); - } - - function charIdxInLine(start, line, character, forward, includeChar) { - // Search for char in line. - // motion_options: {forward, includeChar} - // If includeChar = true, include it too. - // If forward = true, search forward, else search backwards. - // If char is not found on this line, do nothing - var idx; - if (forward) { - idx = line.indexOf(character, start + 1); - if (idx != -1 && !includeChar) { - idx -= 1; - } - } else { - idx = line.lastIndexOf(character, start - 1); - if (idx != -1 && !includeChar) { - idx += 1; - } - } - return idx; - } - - function findParagraph(cm, head, repeat, dir, inclusive) { - var line = head.line; - var min = cm.firstLine(); - var max = cm.lastLine(); - var start, end, i = line; - function isEmpty(i) { return !cm.getLine(i); } - function isBoundary(i, dir, any) { - if (any) { return isEmpty(i) != isEmpty(i + dir); } - return !isEmpty(i) && isEmpty(i + dir); - } - if (dir) { - while (min <= i && i <= max && repeat > 0) { - if (isBoundary(i, dir)) { repeat--; } - i += dir; - } - return new Pos(i, 0); - } - - var vim = cm.state.vim; - if (vim.visualLine && isBoundary(line, 1, true)) { - var anchor = vim.sel.anchor; - if (isBoundary(anchor.line, -1, true)) { - if (!inclusive || anchor.line != line) { - line += 1; - } - } - } - var startState = isEmpty(line); - for (i = line; i <= max && repeat; i++) { - if (isBoundary(i, 1, true)) { - if (!inclusive || isEmpty(i) != startState) { - repeat--; - } - } - } - end = new Pos(i, 0); - // select boundary before paragraph for the last one - if (i > max && !startState) { startState = true; } - else { inclusive = false; } - for (i = line; i > min; i--) { - if (!inclusive || isEmpty(i) == startState || i == line) { - if (isBoundary(i, -1, true)) { break; } - } - } - start = new Pos(i, 0); - return { start: start, end: end }; - } - - // TODO: perhaps this finagling of start and end positions belonds - // in codmirror/replaceRange? - function selectCompanionObject(cm, head, symb, inclusive) { - var cur = head, start, end; - - var bracketRegexp = ({ - '(': /[()]/, ')': /[()]/, - '[': /[[\]]/, ']': /[[\]]/, - '{': /[{}]/, '}': /[{}]/})[symb]; - var openSym = ({ - '(': '(', ')': '(', - '[': '[', ']': '[', - '{': '{', '}': '{'})[symb]; - var curChar = cm.getLine(cur.line).charAt(cur.ch); - // Due to the behavior of scanForBracket, we need to add an offset if the - // cursor is on a matching open bracket. - var offset = curChar === openSym ? 1 : 0; - - start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp}); - end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp}); - - if (!start || !end) { - return { start: cur, end: cur }; - } - - start = start.pos; - end = end.pos; - - if ((start.line == end.line && start.ch > end.ch) - || (start.line > end.line)) { - var tmp = start; - start = end; - end = tmp; - } - - if (inclusive) { - end.ch += 1; - } else { - start.ch += 1; - } - - return { start: start, end: end }; - } - - // Takes in a symbol and a cursor and tries to simulate text objects that - // have identical opening and closing symbols - // TODO support across multiple lines - function findBeginningAndEnd(cm, head, symb, inclusive) { - var cur = copyCursor(head); - var line = cm.getLine(cur.line); - var chars = line.split(''); - var start, end, i, len; - var firstIndex = chars.indexOf(symb); - - // the decision tree is to always look backwards for the beginning first, - // but if the cursor is in front of the first instance of the symb, - // then move the cursor forward - if (cur.ch < firstIndex) { - cur.ch = firstIndex; - // Why is this line even here??? - // cm.setCursor(cur.line, firstIndex+1); - } - // otherwise if the cursor is currently on the closing symbol - else if (firstIndex < cur.ch && chars[cur.ch] == symb) { - end = cur.ch; // assign end to the current cursor - --cur.ch; // make sure to look backwards - } - - // if we're currently on the symbol, we've got a start - if (chars[cur.ch] == symb && !end) { - start = cur.ch + 1; // assign start to ahead of the cursor - } else { - // go backwards to find the start - for (i = cur.ch; i > -1 && !start; i--) { - if (chars[i] == symb) { - start = i + 1; - } - } - } - - // look forwards for the end symbol - if (start && !end) { - for (i = start, len = chars.length; i < len && !end; i++) { - if (chars[i] == symb) { - end = i; - } - } - } - - // nothing found - if (!start || !end) { - return { start: cur, end: cur }; - } - - // include the symbols - if (inclusive) { - --start; ++end; - } - - return { - start: Pos(cur.line, start), - end: Pos(cur.line, end) - }; - } - - // Search functions - defineOption('pcre', true, 'boolean'); - function SearchState() {} - SearchState.prototype = { - getQuery: function() { - return vimGlobalState.query; - }, - setQuery: function(query) { - vimGlobalState.query = query; - }, - getOverlay: function() { - return this.searchOverlay; - }, - setOverlay: function(overlay) { - this.searchOverlay = overlay; - }, - isReversed: function() { - return vimGlobalState.isReversed; - }, - setReversed: function(reversed) { - vimGlobalState.isReversed = reversed; - }, - getScrollbarAnnotate: function() { - return this.annotate; - }, - setScrollbarAnnotate: function(annotate) { - this.annotate = annotate; - } - }; - function getSearchState(cm) { - var vim = cm.state.vim; - return vim.searchState_ || (vim.searchState_ = new SearchState()); - } - function dialog(cm, template, shortText, onClose, options) { - if (cm.openDialog) { - cm.openDialog(template, onClose, { bottom: true, value: options.value, - onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, - selectValueOnOpen: false}); - } - else { - onClose(prompt(shortText, '')); - } - } - function splitBySlash(argString) { - var slashes = findUnescapedSlashes(argString) || []; - if (!slashes.length) return []; - var tokens = []; - // in case of strings like foo/bar - if (slashes[0] !== 0) return; - for (var i = 0; i < slashes.length; i++) { - if (typeof slashes[i] == 'number') - tokens.push(argString.substring(slashes[i] + 1, slashes[i+1])); - } - return tokens; - } - - function findUnescapedSlashes(str) { - var escapeNextChar = false; - var slashes = []; - for (var i = 0; i < str.length; i++) { - var c = str.charAt(i); - if (!escapeNextChar && c == '/') { - slashes.push(i); - } - escapeNextChar = !escapeNextChar && (c == '\\'); - } - return slashes; - } - - // Translates a search string from ex (vim) syntax into javascript form. - function translateRegex(str) { - // When these match, add a '\' if unescaped or remove one if escaped. - var specials = '|(){'; - // Remove, but never add, a '\' for these. - var unescape = '}'; - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - var specialComesNext = (n && specials.indexOf(n) != -1); - if (escapeNextChar) { - if (c !== '\\' || !specialComesNext) { - out.push(c); - } - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - // Treat the unescape list as special for removing, but not adding '\'. - if (n && unescape.indexOf(n) != -1) { - specialComesNext = true; - } - // Not passing this test means removing a '\'. - if (!specialComesNext || n === '\\') { - out.push(c); - } - } else { - out.push(c); - if (specialComesNext && n !== '\\') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Translates the replace part of a search and replace from ex (vim) syntax into - // javascript form. Similar to translateRegex, but additionally fixes back references - // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. - var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'}; - function translateRegexReplace(str) { - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - if (charUnescapes[c + n]) { - out.push(charUnescapes[c+n]); - i++; - } else if (escapeNextChar) { - // At any point in the loop, escapeNextChar is true if the previous - // character was a '\' and was not escaped. - out.push(c); - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - if ((isNumber(n) || n === '$')) { - out.push('$'); - } else if (n !== '/' && n !== '\\') { - out.push('\\'); - } - } else { - if (c === '$') { - out.push('$'); - } - out.push(c); - if (n === '/') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Unescape \ and / in the replace part, for PCRE mode. - var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'}; - function unescapeRegexReplace(str) { - var stream = new CodeMirror.StringStream(str); - var output = []; - while (!stream.eol()) { - // Search for \. - while (stream.peek() && stream.peek() != '\\') { - output.push(stream.next()); - } - var matched = false; - for (var matcher in unescapes) { - if (stream.match(matcher, true)) { - matched = true; - output.push(unescapes[matcher]); - break; - } - } - if (!matched) { - // Don't change anything - output.push(stream.next()); - } - } - return output.join(''); - } - - /** - * Extract the regular expression from the query and return a Regexp object. - * Returns null if the query is blank. - * If ignoreCase is passed in, the Regexp object will have the 'i' flag set. - * If smartCase is passed in, and the query contains upper case letters, - * then ignoreCase is overridden, and the 'i' flag will not be set. - * If the query contains the /i in the flag part of the regular expression, - * then both ignoreCase and smartCase are ignored, and 'i' will be passed - * through to the Regex object. - */ - function parseQuery(query, ignoreCase, smartCase) { - // First update the last search register - var lastSearchRegister = vimGlobalState.registerController.getRegister('/'); - lastSearchRegister.setText(query); - // Check if the query is already a regex. - if (query instanceof RegExp) { return query; } - // First try to extract regex + flags from the input. If no flags found, - // extract just the regex. IE does not accept flags directly defined in - // the regex string in the form /regex/flags - var slashes = findUnescapedSlashes(query); - var regexPart; - var forceIgnoreCase; - if (!slashes.length) { - // Query looks like 'regexp' - regexPart = query; - } else { - // Query looks like 'regexp/...' - regexPart = query.substring(0, slashes[0]); - var flagsPart = query.substring(slashes[0]); - forceIgnoreCase = (flagsPart.indexOf('i') != -1); - } - if (!regexPart) { - return null; - } - if (!getOption('pcre')) { - regexPart = translateRegex(regexPart); - } - if (smartCase) { - ignoreCase = (/^[^A-Z]*$/).test(regexPart); - } - var regexp = new RegExp(regexPart, - (ignoreCase || forceIgnoreCase) ? 'i' : undefined); - return regexp; - } - function showConfirm(cm, text) { - if (cm.openNotification) { - cm.openNotification('' + text + '', - {bottom: true, duration: 5000}); - } else { - alert(text); - } - } - function makePrompt(prefix, desc) { - var raw = ''; - if (prefix) { - raw += '' + prefix + ''; - } - raw += ' ' + - ''; - if (desc) { - raw += ''; - raw += desc; - raw += ''; - } - return raw; - } - var searchPromptDesc = '(Javascript regexp)'; - function showPrompt(cm, options) { - var shortText = (options.prefix || '') + ' ' + (options.desc || ''); - var prompt = makePrompt(options.prefix, options.desc); - dialog(cm, prompt, shortText, options.onClose, options); - } - function regexEqual(r1, r2) { - if (r1 instanceof RegExp && r2 instanceof RegExp) { - var props = ['global', 'multiline', 'ignoreCase', 'source']; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (r1[prop] !== r2[prop]) { - return false; - } - } - return true; - } - return false; - } - // Returns true if the query is valid. - function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) { - if (!rawQuery) { - return; - } - var state = getSearchState(cm); - var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase); - if (!query) { - return; - } - highlightSearchMatches(cm, query); - if (regexEqual(query, state.getQuery())) { - return query; - } - state.setQuery(query); - return query; - } - function searchOverlay(query) { - if (query.source.charAt(0) == '^') { - var matchSol = true; - } - return { - token: function(stream) { - if (matchSol && !stream.sol()) { - stream.skipToEnd(); - return; - } - var match = stream.match(query, false); - if (match) { - if (match[0].length == 0) { - // Matched empty string, skip to next. - stream.next(); - return 'searching'; - } - if (!stream.sol()) { - // Backtrack 1 to match \b - stream.backUp(1); - if (!query.exec(stream.next() + match[0])) { - stream.next(); - return null; - } - } - stream.match(query); - return 'searching'; - } - while (!stream.eol()) { - stream.next(); - if (stream.match(query, false)) break; - } - }, - query: query - }; - } - function highlightSearchMatches(cm, query) { - var searchState = getSearchState(cm); - var overlay = searchState.getOverlay(); - if (!overlay || query != overlay.query) { - if (overlay) { - cm.removeOverlay(overlay); - } - overlay = searchOverlay(query); - cm.addOverlay(overlay); - if (cm.showMatchesOnScrollbar) { - if (searchState.getScrollbarAnnotate()) { - searchState.getScrollbarAnnotate().clear(); - } - searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query)); - } - searchState.setOverlay(overlay); - } - } - function findNext(cm, prev, query, repeat) { - if (repeat === undefined) { repeat = 1; } - return cm.operation(function() { - var pos = cm.getCursor(); - var cursor = cm.getSearchCursor(query, pos); - for (var i = 0; i < repeat; i++) { - var found = cursor.find(prev); - if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); } - if (!found) { - // SearchCursor may have returned null because it hit EOF, wrap - // around and try again. - cursor = cm.getSearchCursor(query, - (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) ); - if (!cursor.find(prev)) { - return; - } - } - } - return cursor.from(); - }); - } - function clearSearchHighlight(cm) { - var state = getSearchState(cm); - cm.removeOverlay(getSearchState(cm).getOverlay()); - state.setOverlay(null); - if (state.getScrollbarAnnotate()) { - state.getScrollbarAnnotate().clear(); - state.setScrollbarAnnotate(null); - } - } - /** - * Check if pos is in the specified range, INCLUSIVE. - * Range can be specified with 1 or 2 arguments. - * If the first range argument is an array, treat it as an array of line - * numbers. Match pos against any of the lines. - * If the first range argument is a number, - * if there is only 1 range argument, check if pos has the same line - * number - * if there are 2 range arguments, then check if pos is in between the two - * range arguments. - */ - function isInRange(pos, start, end) { - if (typeof pos != 'number') { - // Assume it is a cursor position. Get the line number. - pos = pos.line; - } - if (start instanceof Array) { - return inArray(pos, start); - } else { - if (end) { - return (pos >= start && pos <= end); - } else { - return pos == start; - } - } - } - function getUserVisibleLines(cm) { - var scrollInfo = cm.getScrollInfo(); - var occludeToleranceTop = 6; - var occludeToleranceBottom = 10; - var from = cm.coordsChar({left:0, top: occludeToleranceTop + scrollInfo.top}, 'local'); - var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + scrollInfo.top; - var to = cm.coordsChar({left:0, top: bottomY}, 'local'); - return {top: from.line, bottom: to.line}; - } - - var ExCommandDispatcher = function() { - this.buildCommandMap_(); - }; - ExCommandDispatcher.prototype = { - processCommand: function(cm, input, opt_params) { - var that = this; - cm.operation(function () { - cm.curOp.isVimOp = true; - that._processCommand(cm, input, opt_params); - }); - }, - _processCommand: function(cm, input, opt_params) { - var vim = cm.state.vim; - var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); - var previousCommand = commandHistoryRegister.toString(); - if (vim.visualMode) { - exitVisualMode(cm); - } - var inputStream = new CodeMirror.StringStream(input); - // update ": with the latest command whether valid or invalid - commandHistoryRegister.setText(input); - var params = opt_params || {}; - params.input = input; - try { - this.parseInput_(cm, inputStream, params); - } catch(e) { - showConfirm(cm, e); - throw e; - } - var command; - var commandName; - if (!params.commandName) { - // If only a line range is defined, move to the line. - if (params.line !== undefined) { - commandName = 'move'; - } - } else { - command = this.matchCommand_(params.commandName); - if (command) { - commandName = command.name; - if (command.excludeFromCommandHistory) { - commandHistoryRegister.setText(previousCommand); - } - this.parseCommandArgs_(inputStream, params, command); - if (command.type == 'exToKey') { - // Handle Ex to Key mapping. - for (var i = 0; i < command.toKeys.length; i++) { - CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping'); - } - return; - } else if (command.type == 'exToEx') { - // Handle Ex to Ex mapping. - this.processCommand(cm, command.toInput); - return; - } - } - } - if (!commandName) { - showConfirm(cm, 'Not an editor command ":' + input + '"'); - return; - } - try { - exCommands[commandName](cm, params); - // Possibly asynchronous commands (e.g. substitute, which might have a - // user confirmation), are responsible for calling the callback when - // done. All others have it taken care of for them here. - if ((!command || !command.possiblyAsync) && params.callback) { - params.callback(); - } - } catch(e) { - showConfirm(cm, e); - throw e; - } - }, - parseInput_: function(cm, inputStream, result) { - inputStream.eatWhile(':'); - // Parse range. - if (inputStream.eat('%')) { - result.line = cm.firstLine(); - result.lineEnd = cm.lastLine(); - } else { - result.line = this.parseLineSpec_(cm, inputStream); - if (result.line !== undefined && inputStream.eat(',')) { - result.lineEnd = this.parseLineSpec_(cm, inputStream); - } - } - - // Parse command name. - var commandMatch = inputStream.match(/^(\w+)/); - if (commandMatch) { - result.commandName = commandMatch[1]; - } else { - result.commandName = inputStream.match(/.*/)[0]; - } - - return result; - }, - parseLineSpec_: function(cm, inputStream) { - var numberMatch = inputStream.match(/^(\d+)/); - if (numberMatch) { - return parseInt(numberMatch[1], 10) - 1; - } - switch (inputStream.next()) { - case '.': - return cm.getCursor().line; - case '$': - return cm.lastLine(); - case '\'': - var mark = cm.state.vim.marks[inputStream.next()]; - if (mark && mark.find()) { - return mark.find().line; - } - throw new Error('Mark not set'); - default: - inputStream.backUp(1); - return undefined; - } - }, - parseCommandArgs_: function(inputStream, params, command) { - if (inputStream.eol()) { - return; - } - params.argString = inputStream.match(/.*/)[0]; - // Parse command-line arguments - var delim = command.argDelimiter || /\s+/; - var args = trim(params.argString).split(delim); - if (args.length && args[0]) { - params.args = args; - } - }, - matchCommand_: function(commandName) { - // Return the command in the command map that matches the shortest - // prefix of the passed in command name. The match is guaranteed to be - // unambiguous if the defaultExCommandMap's shortNames are set up - // correctly. (see @code{defaultExCommandMap}). - for (var i = commandName.length; i > 0; i--) { - var prefix = commandName.substring(0, i); - if (this.commandMap_[prefix]) { - var command = this.commandMap_[prefix]; - if (command.name.indexOf(commandName) === 0) { - return command; - } - } - } - return null; - }, - buildCommandMap_: function() { - this.commandMap_ = {}; - for (var i = 0; i < defaultExCommandMap.length; i++) { - var command = defaultExCommandMap[i]; - var key = command.shortName || command.name; - this.commandMap_[key] = command; - } - }, - map: function(lhs, rhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (rhs != ':' && rhs.charAt(0) == ':') { - // Ex to Ex mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToEx', - toInput: rhs.substring(1), - user: true - }; - } else { - // Ex to key mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToKey', - toKeys: rhs, - user: true - }; - } - } else { - if (rhs != ':' && rhs.charAt(0) == ':') { - // Key to Ex mapping. - var mapping = { - keys: lhs, - type: 'keyToEx', - exArgs: { input: rhs.substring(1) }, - user: true}; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } else { - // Key to key mapping - var mapping = { - keys: lhs, - type: 'keyToKey', - toKeys: rhs, - user: true - }; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } - } - }, - unmap: function(lhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - // Ex to Ex or Ex to key mapping - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (this.commandMap_[commandName] && this.commandMap_[commandName].user) { - delete this.commandMap_[commandName]; - return; - } - } else { - // Key to Ex or key to key mapping - var keys = lhs; - for (var i = 0; i < defaultKeymap.length; i++) { - if (keys == defaultKeymap[i].keys - && defaultKeymap[i].context === ctx - && defaultKeymap[i].user) { - defaultKeymap.splice(i, 1); - return; - } - } - } - throw Error('No such mapping.'); - } - }; - - var exCommands = { - colorscheme: function(cm, params) { - if (!params.args || params.args.length < 1) { - showConfirm(cm, cm.getOption('theme')); - return; - } - cm.setOption('theme', params.args[0]); - }, - map: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 2) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx); - }, - imap: function(cm, params) { this.map(cm, params, 'insert'); }, - nmap: function(cm, params) { this.map(cm, params, 'normal'); }, - vmap: function(cm, params) { this.map(cm, params, 'visual'); }, - unmap: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 1) { - if (cm) { - showConfirm(cm, 'No such mapping: ' + params.input); - } - return; - } - exCommandDispatcher.unmap(mapArgs[0], ctx); - }, - move: function(cm, params) { - commandDispatcher.processCommand(cm, cm.state.vim, { - type: 'motion', - motion: 'moveToLineOrEdgeOfDocument', - motionArgs: { forward: false, explicitRepeat: true, - linewise: true }, - repeatOverride: params.line+1}); - }, - set: function(cm, params) { - var setArgs = params.args; - // Options passed through to the setOption/getOption calls. May be passed in by the - // local/global versions of the set command - var setCfg = params.setCfg || {}; - if (!setArgs || setArgs.length < 1) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - var expr = setArgs[0].split('='); - var optionName = expr[0]; - var value = expr[1]; - var forceGet = false; - - if (optionName.charAt(optionName.length - 1) == '?') { - // If post-fixed with ?, then the set is actually a get. - if (value) { throw Error('Trailing characters: ' + params.argString); } - optionName = optionName.substring(0, optionName.length - 1); - forceGet = true; - } - if (value === undefined && optionName.substring(0, 2) == 'no') { - // To set boolean options to false, the option name is prefixed with - // 'no'. - optionName = optionName.substring(2); - value = false; - } - - var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; - if (optionIsBoolean && value == undefined) { - // Calling set with a boolean option sets it to true. - value = true; - } - // If no value is provided, then we assume this is a get. - if (!optionIsBoolean && value === undefined || forceGet) { - var oldValue = getOption(optionName, cm, setCfg); - if (oldValue === true || oldValue === false) { - showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); - } else { - showConfirm(cm, ' ' + optionName + '=' + oldValue); - } - } else { - setOption(optionName, value, cm, setCfg); - } - }, - setlocal: function (cm, params) { - // setCfg is passed through to setOption - params.setCfg = {scope: 'local'}; - this.set(cm, params); - }, - setglobal: function (cm, params) { - // setCfg is passed through to setOption - params.setCfg = {scope: 'global'}; - this.set(cm, params); - }, - registers: function(cm, params) { - var regArgs = params.args; - var registers = vimGlobalState.registerController.registers; - var regInfo = '----------Registers----------

                '; - if (!regArgs) { - for (var registerName in registers) { - var text = registers[registerName].toString(); - if (text.length) { - regInfo += '"' + registerName + ' ' + text + '
                '; - } - } - } else { - var registerName; - regArgs = regArgs.join(''); - for (var i = 0; i < regArgs.length; i++) { - registerName = regArgs.charAt(i); - if (!vimGlobalState.registerController.isValidRegister(registerName)) { - continue; - } - var register = registers[registerName] || new Register(); - regInfo += '"' + registerName + ' ' + register.toString() + '
                '; - } - } - showConfirm(cm, regInfo); - }, - sort: function(cm, params) { - var reverse, ignoreCase, unique, number; - function parseArgs() { - if (params.argString) { - var args = new CodeMirror.StringStream(params.argString); - if (args.eat('!')) { reverse = true; } - if (args.eol()) { return; } - if (!args.eatSpace()) { return 'Invalid arguments'; } - var opts = args.match(/[a-z]+/); - if (opts) { - opts = opts[0]; - ignoreCase = opts.indexOf('i') != -1; - unique = opts.indexOf('u') != -1; - var decimal = opts.indexOf('d') != -1 && 1; - var hex = opts.indexOf('x') != -1 && 1; - var octal = opts.indexOf('o') != -1 && 1; - if (decimal + hex + octal > 1) { return 'Invalid arguments'; } - number = decimal && 'decimal' || hex && 'hex' || octal && 'octal'; - } - if (args.match(/\/.*\//)) { return 'patterns not supported'; } - } - } - var err = parseArgs(); - if (err) { - showConfirm(cm, err + ': ' + params.argString); - return; - } - var lineStart = params.line || cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - if (lineStart == lineEnd) { return; } - var curStart = Pos(lineStart, 0); - var curEnd = Pos(lineEnd, lineLength(cm, lineEnd)); - var text = cm.getRange(curStart, curEnd).split('\n'); - var numberRegex = (number == 'decimal') ? /(-?)([\d]+)/ : - (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i : - (number == 'octal') ? /([0-7]+)/ : null; - var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null; - var numPart = [], textPart = []; - if (number) { - for (var i = 0; i < text.length; i++) { - if (numberRegex.exec(text[i])) { - numPart.push(text[i]); - } else { - textPart.push(text[i]); - } - } - } else { - textPart = text; - } - function compareFn(a, b) { - if (reverse) { var tmp; tmp = a; a = b; b = tmp; } - if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); } - var anum = number && numberRegex.exec(a); - var bnum = number && numberRegex.exec(b); - if (!anum) { return a < b ? -1 : 1; } - anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix); - bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix); - return anum - bnum; - } - numPart.sort(compareFn); - textPart.sort(compareFn); - text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart); - if (unique) { // Remove duplicate lines - var textOld = text; - var lastLine; - text = []; - for (var i = 0; i < textOld.length; i++) { - if (textOld[i] != lastLine) { - text.push(textOld[i]); - } - lastLine = textOld[i]; - } - } - cm.replaceRange(text.join('\n'), curStart, curEnd); - }, - global: function(cm, params) { - // a global command is of the form - // :[range]g/pattern/[cmd] - // argString holds the string /pattern/[cmd] - var argString = params.argString; - if (!argString) { - showConfirm(cm, 'Regular Expression missing from global'); - return; - } - // range is specified here - var lineStart = (params.line !== undefined) ? params.line : cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - // get the tokens from argString - var tokens = splitBySlash(argString); - var regexPart = argString, cmd; - if (tokens.length) { - regexPart = tokens[0]; - cmd = tokens.slice(1, tokens.length).join('/'); - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise - // use the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - // now that we have the regexPart, search for regex matches in the - // specified range of lines - var query = getSearchState(cm).getQuery(); - var matchedLines = [], content = ''; - for (var i = lineStart; i <= lineEnd; i++) { - var matched = query.test(cm.getLine(i)); - if (matched) { - matchedLines.push(i+1); - content+= cm.getLine(i) + '
                '; - } - } - // if there is no [cmd], just display the list of matched lines - if (!cmd) { - showConfirm(cm, content); - return; - } - var index = 0; - var nextCommand = function() { - if (index < matchedLines.length) { - var command = matchedLines[index] + cmd; - exCommandDispatcher.processCommand(cm, command, { - callback: nextCommand - }); - } - index++; - }; - nextCommand(); - }, - substitute: function(cm, params) { - if (!cm.getSearchCursor) { - throw new Error('Search feature not available. Requires searchcursor.js or ' + - 'any other getSearchCursor implementation.'); - } - var argString = params.argString; - var tokens = argString ? splitBySlash(argString) : []; - var regexPart, replacePart = '', trailing, flagsPart, count; - var confirm = false; // Whether to confirm each replace. - var global = false; // True to replace all instances on a line, false to replace only 1. - if (tokens.length) { - regexPart = tokens[0]; - replacePart = tokens[1]; - if (replacePart !== undefined) { - if (getOption('pcre')) { - replacePart = unescapeRegexReplace(replacePart); - } else { - replacePart = translateRegexReplace(replacePart); - } - vimGlobalState.lastSubstituteReplacePart = replacePart; - } - trailing = tokens[2] ? tokens[2].split(' ') : []; - } else { - // either the argString is empty or its of the form ' hello/world' - // actually splitBySlash returns a list of tokens - // only if the string starts with a '/' - if (argString && argString.length) { - showConfirm(cm, 'Substitutions should be of the form ' + - ':s/pattern/replace/'); - return; - } - } - // After the 3rd slash, we can have flags followed by a space followed - // by count. - if (trailing) { - flagsPart = trailing[0]; - count = parseInt(trailing[1]); - if (flagsPart) { - if (flagsPart.indexOf('c') != -1) { - confirm = true; - flagsPart.replace('c', ''); - } - if (flagsPart.indexOf('g') != -1) { - global = true; - flagsPart.replace('g', ''); - } - regexPart = regexPart + '/' + flagsPart; - } - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise use - // the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart; - if (replacePart === undefined) { - showConfirm(cm, 'No previous substitute regular expression'); - return; - } - var state = getSearchState(cm); - var query = state.getQuery(); - var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; - var lineEnd = params.lineEnd || lineStart; - if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) { - lineEnd = Infinity; - } - if (count) { - lineStart = lineEnd; - lineEnd = lineStart + count - 1; - } - var startPos = clipCursorToContent(cm, Pos(lineStart, 0)); - var cursor = cm.getSearchCursor(query, startPos); - doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback); - }, - redo: CodeMirror.commands.redo, - undo: CodeMirror.commands.undo, - write: function(cm) { - if (CodeMirror.commands.save) { - // If a save command is defined, call it. - CodeMirror.commands.save(cm); - } else { - // Saves to text area if no save command is defined. - cm.save(); - } - }, - nohlsearch: function(cm) { - clearSearchHighlight(cm); - }, - delmarks: function(cm, params) { - if (!params.argString || !trim(params.argString)) { - showConfirm(cm, 'Argument required'); - return; - } - - var state = cm.state.vim; - var stream = new CodeMirror.StringStream(trim(params.argString)); - while (!stream.eol()) { - stream.eatSpace(); - - // Record the streams position at the beginning of the loop for use - // in error messages. - var count = stream.pos; - - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var sym = stream.next(); - // Check if this symbol is part of a range - if (stream.match('-', true)) { - // This symbol is part of a range. - - // The range must terminate at an alphabetic character. - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var startMark = sym; - var finishMark = stream.next(); - // The range must terminate at an alphabetic character which - // shares the same case as the start of the range. - if (isLowerCase(startMark) && isLowerCase(finishMark) || - isUpperCase(startMark) && isUpperCase(finishMark)) { - var start = startMark.charCodeAt(0); - var finish = finishMark.charCodeAt(0); - if (start >= finish) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - // Because marks are always ASCII values, and we have - // determined that they are the same case, we can use - // their char codes to iterate through the defined range. - for (var j = 0; j <= finish - start; j++) { - var mark = String.fromCharCode(start + j); - delete state.marks[mark]; - } - } else { - showConfirm(cm, 'Invalid argument: ' + startMark + '-'); - return; - } - } else { - // This symbol is a valid mark, and is not part of a range. - delete state.marks[sym]; - } - } - } - }; - - var exCommandDispatcher = new ExCommandDispatcher(); - - /** - * @param {CodeMirror} cm CodeMirror instance we are in. - * @param {boolean} confirm Whether to confirm each replace. - * @param {Cursor} lineStart Line to start replacing from. - * @param {Cursor} lineEnd Line to stop replacing at. - * @param {RegExp} query Query for performing matches with. - * @param {string} replaceWith Text to replace matches with. May contain $1, - * $2, etc for replacing captured groups using Javascript replace. - * @param {function()} callback A callback for when the replace is done. - */ - function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, - replaceWith, callback) { - // Set up all the functions. - cm.state.vim.exMode = true; - var done = false; - var lastPos = searchCursor.from(); - function replaceAll() { - cm.operation(function() { - while (!done) { - replace(); - next(); - } - stop(); - }); - } - function replace() { - var text = cm.getRange(searchCursor.from(), searchCursor.to()); - var newText = text.replace(query, replaceWith); - searchCursor.replace(newText); - } - function next() { - // The below only loops to skip over multiple occurrences on the same - // line when 'global' is not true. - while(searchCursor.findNext() && - isInRange(searchCursor.from(), lineStart, lineEnd)) { - if (!global && lastPos && searchCursor.from().line == lastPos.line) { - continue; - } - cm.scrollIntoView(searchCursor.from(), 30); - cm.setSelection(searchCursor.from(), searchCursor.to()); - lastPos = searchCursor.from(); - done = false; - return; - } - done = true; - } - function stop(close) { - if (close) { close(); } - cm.focus(); - if (lastPos) { - cm.setCursor(lastPos); - var vim = cm.state.vim; - vim.exMode = false; - vim.lastHPos = vim.lastHSPos = lastPos.ch; - } - if (callback) { callback(); } - } - function onPromptKeyDown(e, _value, close) { - // Swallow all keys. - CodeMirror.e_stop(e); - var keyName = CodeMirror.keyName(e); - switch (keyName) { - case 'Y': - replace(); next(); break; - case 'N': - next(); break; - case 'A': - // replaceAll contains a call to close of its own. We don't want it - // to fire too early or multiple times. - var savedCallback = callback; - callback = undefined; - cm.operation(replaceAll); - callback = savedCallback; - break; - case 'L': - replace(); - // fall through and exit. - case 'Q': - case 'Esc': - case 'Ctrl-C': - case 'Ctrl-[': - stop(close); - break; - } - if (done) { stop(close); } - return true; - } - - // Actually do replace. - next(); - if (done) { - showConfirm(cm, 'No matches for ' + query.source); - return; - } - if (!confirm) { - replaceAll(); - if (callback) { callback(); }; - return; - } - showPrompt(cm, { - prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)', - onKeyDown: onPromptKeyDown - }); - } - - CodeMirror.keyMap.vim = { - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function exitInsertMode(cm) { - var vim = cm.state.vim; - var macroModeState = vimGlobalState.macroModeState; - var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.'); - var isPlaying = macroModeState.isPlaying; - var lastChange = macroModeState.lastInsertModeChanges; - // In case of visual block, the insertModeChanges are not saved as a - // single word, so we convert them to a single word - // so as to update the ". register as expected in real vim. - var text = []; - if (!isPlaying) { - var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1; - var changes = lastChange.changes; - var text = []; - var i = 0; - // In case of multiple selections in blockwise visual, - // the inserted text, for example: 'foo', is stored as - // 'f', 'f', InsertModeKey 'o', 'o', 'o', 'o'. (if you have a block with 2 lines). - // We push the contents of the changes array as per the following: - // 1. In case of InsertModeKey, just increment by 1. - // 2. In case of a character, jump by selLength (2 in the example). - while (i < changes.length) { - // This loop will convert 'ffoooo' to 'foo'. - text.push(changes[i]); - if (changes[i] instanceof InsertModeKey) { - i++; - } else { - i+= selLength; - } - } - lastChange.changes = text; - cm.off('change', onChange); - CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (!isPlaying && vim.insertModeRepeat > 1) { - // Perform insert mode repeat for commands like 3,a and 3,o. - repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, - true /** repeatForInsert */); - vim.lastEditInputState.repeatOverride = vim.insertModeRepeat; - } - delete vim.insertModeRepeat; - vim.insertMode = false; - cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1); - cm.setOption('keyMap', 'vim'); - cm.setOption('disableInput', true); - cm.toggleOverwrite(false); // exit replace mode if we were in it. - // update the ". register before exiting insert mode - insertModeChangeRegister.setText(lastChange.changes.join('')); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (macroModeState.isRecording) { - logInsertModeChange(macroModeState); - } - } - - function _mapCommand(command) { - defaultKeymap.unshift(command); - } - - function mapCommand(keys, type, name, args, extra) { - var command = {keys: keys, type: type}; - command[type] = name; - command[type + "Args"] = args; - for (var key in extra) - command[key] = extra[key]; - _mapCommand(command); - } - - // The timeout in milliseconds for the two-character ESC keymap should be - // adjusted according to your typing speed to prevent false positives. - defineOption('insertModeEscKeysTimeout', 200, 'number'); - - CodeMirror.keyMap['vim-insert'] = { - // TODO: override navigation keys so that Esc will cancel automatic - // indentation from o, O, i_ - 'Ctrl-N': 'autocomplete', - 'Ctrl-P': 'autocomplete', - 'Enter': function(cm) { - var fn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - fn(cm); - }, - fallthrough: ['default'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - CodeMirror.keyMap['vim-replace'] = { - 'Backspace': 'goCharLeft', - fallthrough: ['vim-insert'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function executeMacroRegister(cm, vim, macroModeState, registerName) { - var register = vimGlobalState.registerController.getRegister(registerName); - if (registerName == ':') { - // Read-only register containing last Ex command. - if (register.keyBuffer[0]) { - exCommandDispatcher.processCommand(cm, register.keyBuffer[0]); - } - macroModeState.isPlaying = false; - return; - } - var keyBuffer = register.keyBuffer; - var imc = 0; - macroModeState.isPlaying = true; - macroModeState.replaySearchQueries = register.searchQueries.slice(0); - for (var i = 0; i < keyBuffer.length; i++) { - var text = keyBuffer[i]; - var match, key; - while (text) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(text); - key = match[0]; - text = text.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'macro'); - if (vim.insertMode) { - var changes = register.insertModeChanges[imc++].changes; - vimGlobalState.macroModeState.lastInsertModeChanges.changes = - changes; - repeatInsertModeChanges(cm, changes, 1); - exitInsertMode(cm); - } - } - }; - macroModeState.isPlaying = false; - } - - function logKey(macroModeState, key) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushText(key); - } - } - - function logInsertModeChange(macroModeState) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register && register.pushInsertModeChanges) { - register.pushInsertModeChanges(macroModeState.lastInsertModeChanges); - } - } - - function logSearchQuery(macroModeState, query) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register && register.pushSearchQuery) { - register.pushSearchQuery(query); - } - } - - /** - * Listens for changes made in insert mode. - * Should only be active in insert mode. - */ - function onChange(_cm, changeObj) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - if (!macroModeState.isPlaying) { - while(changeObj) { - lastChange.expectCursorActivityForChange = true; - if (changeObj.origin == '+input' || changeObj.origin == 'paste' - || changeObj.origin === undefined /* only in testing */) { - var text = changeObj.text.join('\n'); - lastChange.changes.push(text); - } - // Change objects may be chained with next. - changeObj = changeObj.next; - } - } - } - - /** - * Listens for any kind of cursor activity on CodeMirror. - */ - function onCursorActivity(cm) { - var vim = cm.state.vim; - if (vim.insertMode) { - // Tracking cursor activity in insert mode (for macro support). - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - var lastChange = macroModeState.lastInsertModeChanges; - if (lastChange.expectCursorActivityForChange) { - lastChange.expectCursorActivityForChange = false; - } else { - // Cursor moved outside the context of an edit. Reset the change. - lastChange.changes = []; - } - } else if (!cm.curOp.isVimOp) { - handleExternalSelection(cm, vim); - } - if (vim.visualMode) { - updateFakeCursor(cm); - } - } - function updateFakeCursor(cm) { - var vim = cm.state.vim; - var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); - var to = offsetCursor(from, 0, 1); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'}); - } - function handleExternalSelection(cm, vim) { - var anchor = cm.getCursor('anchor'); - var head = cm.getCursor('head'); - // Enter or exit visual mode to match mouse selection. - if (vim.visualMode && !cm.somethingSelected()) { - exitVisualMode(cm, false); - } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { - vim.visualMode = true; - vim.visualLine = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"}); - } - if (vim.visualMode) { - // Bind CodeMirror selection model to vim selection model. - // Mouse selections are considered visual characterwise. - var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; - var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; - head = offsetCursor(head, 0, headOffset); - anchor = offsetCursor(anchor, 0, anchorOffset); - vim.sel = { - anchor: anchor, - head: head - }; - updateMark(cm, vim, '<', cursorMin(head, anchor)); - updateMark(cm, vim, '>', cursorMax(head, anchor)); - } else if (!vim.insertMode) { - // Reset lastHPos if selection was modified by something outside of vim mode e.g. by mouse. - vim.lastHPos = cm.getCursor().ch; - } - } - - /** Wrapper for special keys pressed in insert mode */ - function InsertModeKey(keyName) { - this.keyName = keyName; - } - - /** - * Handles raw key down events from the text area. - * - Should only be active in insert mode. - * - For recording deletes in insert mode. - */ - function onKeyEventTargetKeyDown(e) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - var keyName = CodeMirror.keyName(e); - if (!keyName) { return; } - function onKeyFound() { - lastChange.changes.push(new InsertModeKey(keyName)); - return true; - } - if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) { - CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound); - } - } - - /** - * Repeats the last edit, which includes exactly 1 command and at most 1 - * insert. Operator and motion commands are read from lastEditInputState, - * while action commands are read from lastEditActionCommand. - * - * If repeatForInsert is true, then the function was called by - * exitInsertMode to repeat the insert mode changes the user just made. The - * corresponding enterInsertMode call was made with a count. - */ - function repeatLastEdit(cm, vim, repeat, repeatForInsert) { - var macroModeState = vimGlobalState.macroModeState; - macroModeState.isPlaying = true; - var isAction = !!vim.lastEditActionCommand; - var cachedInputState = vim.inputState; - function repeatCommand() { - if (isAction) { - commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand); - } else { - commandDispatcher.evalInput(cm, vim); - } - } - function repeatInsert(repeat) { - if (macroModeState.lastInsertModeChanges.changes.length > 0) { - // For some reason, repeat cw in desktop VIM does not repeat - // insert mode changes. Will conform to that behavior. - repeat = !vim.lastEditActionCommand ? 1 : repeat; - var changeObject = macroModeState.lastInsertModeChanges; - repeatInsertModeChanges(cm, changeObject.changes, repeat); - } - } - vim.inputState = vim.lastEditInputState; - if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) { - // o and O repeat have to be interlaced with insert repeats so that the - // insertions appear on separate lines instead of the last line. - for (var i = 0; i < repeat; i++) { - repeatCommand(); - repeatInsert(1); - } - } else { - if (!repeatForInsert) { - // Hack to get the cursor to end up at the right place. If I is - // repeated in insert mode repeat, cursor will be 1 insert - // change set left of where it should be. - repeatCommand(); - } - repeatInsert(repeat); - } - vim.inputState = cachedInputState; - if (vim.insertMode && !repeatForInsert) { - // Don't exit insert mode twice. If repeatForInsert is set, then we - // were called by an exitInsertMode call lower on the stack. - exitInsertMode(cm); - } - macroModeState.isPlaying = false; - }; - - function repeatInsertModeChanges(cm, changes, repeat) { - function keyHandler(binding) { - if (typeof binding == 'string') { - CodeMirror.commands[binding](cm); - } else { - binding(cm); - } - return true; - } - var head = cm.getCursor('head'); - var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock; - if (inVisualBlock) { - // Set up block selection again for repeating the changes. - var vim = cm.state.vim; - var lastSel = vim.lastSelection; - var offset = getOffset(lastSel.anchor, lastSel.head); - selectForInsert(cm, head, offset.line + 1); - repeat = cm.listSelections().length; - cm.setCursor(head); - } - for (var i = 0; i < repeat; i++) { - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, i, 0)); - } - for (var j = 0; j < changes.length; j++) { - var change = changes[j]; - if (change instanceof InsertModeKey) { - CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler); - } else { - var cur = cm.getCursor(); - cm.replaceRange(change, cur, cur); - } - } - } - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, 0, 1)); - } - } - - resetVimGlobalState(); - return vimApi; - }; - // Initialize Vim and make it available as an API. - CodeMirror.Vim = Vim(); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/lib/codemirror.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/lib/codemirror.css deleted file mode 100644 index 318d25f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/lib/codemirror.css +++ /dev/null @@ -1,332 +0,0 @@ -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - font-family: monospace; - height: 300px; - color: black; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} -.CodeMirror pre { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; - white-space: nowrap; -} -.CodeMirror-linenumbers {} -.CodeMirror-linenumber { - padding: 0 3px 0 5px; - min-width: 20px; - text-align: right; - color: #999; - white-space: nowrap; -} - -.CodeMirror-guttermarker { color: black; } -.CodeMirror-guttermarker-subtle { color: #999; } - -/* CURSOR */ - -.CodeMirror div.CodeMirror-cursor { - border-left: 1px solid black; -} -/* Shown when moving in bi-directional text */ -.CodeMirror div.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} -.CodeMirror.cm-fat-cursor div.CodeMirror-cursor { - width: auto; - border: 0; - background: #7e7; -} -.CodeMirror.cm-fat-cursor div.CodeMirror-cursors { - z-index: 1; -} - -.cm-animate-fat-cursor { - width: auto; - border: 0; - -webkit-animation: blink 1.06s steps(1) infinite; - -moz-animation: blink 1.06s steps(1) infinite; - animation: blink 1.06s steps(1) infinite; - background-color: #7e7; -} -@-moz-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@-webkit-keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} -@keyframes blink { - 0% {} - 50% { background-color: transparent; } - 100% {} -} - -/* Can style cursor different in overwrite (non-insert) mode */ -div.CodeMirror-overwrite div.CodeMirror-cursor {} - -.cm-tab { display: inline-block; text-decoration: inherit; } - -.CodeMirror-ruler { - border-left: 1px solid #ccc; - position: absolute; -} - -/* DEFAULT THEME */ - -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3 {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -.CodeMirror-composing { border-bottom: 2px solid; } - -/* Default styles for common addons */ - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} -.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } -.CodeMirror-activeline-background {background: #e8f2ff;} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - position: relative; - overflow: hidden; - background: white; -} - -.CodeMirror-scroll { - overflow: scroll !important; /* Things will break if this is overridden */ - /* 30px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror */ - margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; -} -.CodeMirror-sizer { - position: relative; - border-right: 30px solid transparent; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actuall scrolling happens, thus preventing shaking and - flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - position: absolute; - z-index: 6; - display: none; -} -.CodeMirror-vscrollbar { - right: 0; top: 0; - overflow-x: hidden; - overflow-y: scroll; -} -.CodeMirror-hscrollbar { - bottom: 0; left: 0; - overflow-y: hidden; - overflow-x: scroll; -} -.CodeMirror-scrollbar-filler { - right: 0; bottom: 0; -} -.CodeMirror-gutter-filler { - left: 0; bottom: 0; -} - -.CodeMirror-gutters { - position: absolute; left: 0; top: 0; - z-index: 3; -} -.CodeMirror-gutter { - white-space: normal; - height: 100%; - display: inline-block; - margin-bottom: -30px; - /* Hack to make IE7 behave */ - *zoom:1; - *display:inline; -} -.CodeMirror-gutter-wrapper { - position: absolute; - z-index: 4; - background: none !important; - border: none !important; -} -.CodeMirror-gutter-background { - position: absolute; - top: 0; bottom: 0; - z-index: 4; -} -.CodeMirror-gutter-elt { - position: absolute; - cursor: default; - z-index: 4; -} -.CodeMirror-gutter-wrapper { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} - -.CodeMirror-lines { - cursor: text; - min-height: 1px; /* prevents collapsing before first draw */ -} -.CodeMirror pre { - /* Reset some styles that the rest of the page might have set */ - -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; - border-width: 0; - background: transparent; - font-family: inherit; - font-size: inherit; - margin: 0; - white-space: pre; - word-wrap: normal; - line-height: inherit; - color: inherit; - z-index: 2; - position: relative; - overflow: visible; - -webkit-tap-highlight-color: transparent; -} -.CodeMirror-wrap pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} - -.CodeMirror-linebackground { - position: absolute; - left: 0; right: 0; top: 0; bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - position: relative; - z-index: 2; - overflow: auto; -} - -.CodeMirror-widget {} - -.CodeMirror-code { - outline: none; -} - -/* Force content-box sizing for the elements where we expect it */ -.CodeMirror-scroll, -.CodeMirror-sizer, -.CodeMirror-gutter, -.CodeMirror-gutters, -.CodeMirror-linenumber { - -moz-box-sizing: content-box; - box-sizing: content-box; -} - -.CodeMirror-measure { - position: absolute; - width: 100%; - height: 0; - overflow: hidden; - visibility: hidden; -} -.CodeMirror-measure pre { position: static; } - -.CodeMirror div.CodeMirror-cursor { - position: absolute; - border-right: none; - width: 0; -} - -div.CodeMirror-cursors { - visibility: hidden; - position: relative; - z-index: 3; -} -.CodeMirror-focused div.CodeMirror-cursors { - visibility: visible; -} - -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } -.CodeMirror-crosshair { cursor: crosshair; } -.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } -.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } - -.cm-searching { - background: #ffa; - background: rgba(255, 255, 0, .4); -} - -/* IE7 hack to prevent it from returning funny offsetTops on the spans */ -.CodeMirror span { *vertical-align: text-bottom; } - -/* Used to force a border model for a node */ -.cm-force-border { padding-right: .1px; } - -@media print { - /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursors { - visibility: hidden; - } -} - -/* See issue #2901 */ -.cm-tab-wrap-hack:after { content: ''; } - -/* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/lib/codemirror.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/lib/codemirror.js deleted file mode 100644 index e9e2c1f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/lib/codemirror.js +++ /dev/null @@ -1,8788 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// This is CodeMirror (http://codemirror.net), a code editor -// implemented in JavaScript on top of the browser's DOM. -// -// You can find some technical background for some of the code below -// at http://marijnhaverbeke.nl/blog/#cm-internals . - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - module.exports = mod(); - else if (typeof define == "function" && define.amd) // AMD - return define([], mod); - else // Plain browser env - this.CodeMirror = mod(); -})(function() { - "use strict"; - - // BROWSER SNIFFING - - // Kludges for bugs and behavior differences that can't be feature - // detected are enabled based on userAgent etc sniffing. - - var gecko = /gecko\/\d/i.test(navigator.userAgent); - var ie_upto10 = /MSIE \d/.test(navigator.userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); - var ie = ie_upto10 || ie_11up; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); - var webkit = /WebKit\//.test(navigator.userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); - var chrome = /Chrome\//.test(navigator.userAgent); - var presto = /Opera\//.test(navigator.userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); - var phantom = /PhantomJS/.test(navigator.userAgent); - - var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); - // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent); - var mac = ios || /Mac/.test(navigator.platform); - var windows = /win/i.test(navigator.platform); - - var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) presto_version = Number(presto_version[1]); - if (presto_version && presto_version >= 15) { presto = false; webkit = true; } - // Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (ie && ie_version >= 9); - - // Optimize some code when these features are not used. - var sawReadOnlySpans = false, sawCollapsedSpans = false; - - // EDITOR CONSTRUCTOR - - // A CodeMirror instance represents an editor. This is the object - // that user code is usually dealing with. - - function CodeMirror(place, options) { - if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); - - this.options = options = options ? copyObj(options) : {}; - // Determine effective options based on given values and defaults. - copyObj(defaults, options, false); - setGuttersForLineNumbers(options); - - var doc = options.value; - if (typeof doc == "string") doc = new Doc(doc, options.mode, null, options.lineSeparator); - this.doc = doc; - - var input = new CodeMirror.inputStyles[options.inputStyle](this); - var display = this.display = new Display(place, doc, input); - display.wrapper.CodeMirror = this; - updateGutters(this); - themeChanged(this); - if (options.lineWrapping) - this.display.wrapper.className += " CodeMirror-wrap"; - if (options.autofocus && !mobile) display.input.focus(); - initScrollbars(this); - - this.state = { - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, - delayingBlurEvent: false, - focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll - draggingText: false, - highlight: new Delayed(), // stores highlight worker timeout - keySeq: null, // Unfinished key sequence - specialChars: null - }; - - var cm = this; - - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20); - - registerEventHandlers(this); - ensureGlobalHandlers(); - - startOperation(this); - this.curOp.forceUpdate = true; - attachDoc(this, doc); - - if ((options.autofocus && !mobile) || cm.hasFocus()) - setTimeout(bind(onFocus, this), 20); - else - onBlur(this); - - for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) - optionHandlers[opt](this, options[opt], Init); - maybeUpdateLineNumberWidth(this); - if (options.finishInit) options.finishInit(this); - for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); - endOperation(this); - // Suppress optimizelegibility in Webkit, since it breaks text - // measuring on line wrapping boundaries. - if (webkit && options.lineWrapping && - getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") - display.lineDiv.style.textRendering = "auto"; - } - - // DISPLAY CONSTRUCTOR - - // The display handles the DOM integration, both for input reading - // and content drawing. It holds references to DOM nodes and - // display-related state. - - function Display(place, doc, input) { - var d = this; - this.input = input; - - // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - d.scrollbarFiller.setAttribute("cm-not-content", "true"); - // Covers bottom of gutter when coverGutterNextToScrollbar is on - // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - d.gutterFiller.setAttribute("cm-not-content", "true"); - // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = elt("div", null, "CodeMirror-code"); - // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure"); - // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none"); - // Moved around its parent to cover visible view. - d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); - // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - d.sizerWidth = null; - // Behavior of elts with overflow: auto and padding is - // inconsistent across browsers. This is used to ensure the - // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); - // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - // The element in which the editor lives. - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - - // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - if (!webkit && !(gecko && mobile)) d.scroller.draggable = true; - - if (place) { - if (place.appendChild) place.appendChild(d.wrapper); - else place(d.wrapper); - } - - // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first; - d.reportedViewFrom = d.reportedViewTo = doc.first; - // Information about the rendered lines. - d.view = []; - d.renderedView = null; - // Holds info about a single rendered line when it was rendered - // for measurement, while not in view. - d.externalMeasured = null; - // Empty space (in pixels) above the view - d.viewOffset = 0; - d.lastWrapHeight = d.lastWrapWidth = 0; - d.updateLineNumbers = null; - - d.nativeBarWidth = d.barHeight = d.barWidth = 0; - d.scrollbarsClipped = false; - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - // Set to true when a non-horizontal-scrolling line widget is - // added. As an optimization, line widget aligning is skipped when - // this is false. - d.alignWidgets = false; - - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - - // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - - // True when shift is held down. - d.shift = false; - - // Used to track whether anything happened since the context menu - // was opened. - d.selForContextMenu = null; - - d.activeTouch = null; - - input.init(d); - } - - // STATE UPDATES - - // Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); - } - - function resetModeState(cm) { - cm.doc.iter(function(line) { - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - }); - cm.doc.frontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) regChange(cm); - } - - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - cm.display.sizerWidth = null; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function(){updateScrollbars(cm);}, 100); - } - - // Returns a function that estimates the height of a line, to use as - // first approximation until the line becomes visible (and is thus - // properly measurable). - function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function(line) { - if (lineIsHidden(cm.doc, line)) return 0; - - var widgetsHeight = 0; - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; - } - - if (wrapping) - return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; - else - return widgetsHeight + th; - }; - } - - function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm); - doc.iter(function(line) { - var estHeight = est(line); - if (estHeight != line.height) updateLineHeight(line, estHeight); - }); - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - - function guttersChanged(cm) { - updateGutters(cm); - regChange(cm); - setTimeout(function(){alignHorizontally(cm);}, 20); - } - - // Rebuild the gutter elements, ensure the margin to the left of the - // code matches their width. - function updateGutters(cm) { - var gutters = cm.display.gutters, specs = cm.options.gutters; - removeChildren(gutters); - for (var i = 0; i < specs.length; ++i) { - var gutterClass = specs[i]; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); - if (gutterClass == "CodeMirror-linenumbers") { - cm.display.lineGutter = gElt; - gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = i ? "" : "none"; - updateGutterSpace(cm); - } - - function updateGutterSpace(cm) { - var width = cm.display.gutters.offsetWidth; - cm.display.sizer.style.marginLeft = width + "px"; - } - - // Compute the character length of a line, taking into account - // collapsed ranges (see markText) that might hide parts, and join - // other lines onto it. - function lineLength(line) { - if (line.height == 0) return 0; - var len = line.text.length, merged, cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found = merged.find(0, true); - len -= cur.text.length - found.from.ch; - cur = found.to.line; - len += cur.text.length - found.to.ch; - } - return len; - } - - // Find the longest line in the document. - function findMaxLine(cm) { - var d = cm.display, doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function(line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); - } - - // Make sure the gutters options contains the element - // "CodeMirror-linenumbers" when the lineNumbers option is true. - function setGuttersForLineNumbers(options) { - var found = indexOf(options.gutters, "CodeMirror-linenumbers"); - if (found == -1 && options.lineNumbers) { - options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); - } else if (found > -1 && !options.lineNumbers) { - options.gutters = options.gutters.slice(0); - options.gutters.splice(found, 1); - } - } - - // SCROLLBARS - - // Prepare DOM reads needed to update the scrollbars. Done in one - // shot to minimize update/measure roundtrips. - function measureForScrollbars(cm) { - var d = cm.display, gutterW = d.gutters.offsetWidth; - var docH = Math.round(cm.doc.height + paddingVert(cm.display)); - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - }; - } - - function NativeScrollbars(place, scroll, cm) { - this.cm = cm; - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - place(vert); place(horiz); - - on(vert, "scroll", function() { - if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); - }); - on(horiz, "scroll", function() { - if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); - }); - - this.checkedOverlay = false; - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; - } - - NativeScrollbars.prototype = copyObj({ - update: function(measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - var sWidth = measure.nativeBarWidth; - - if (needsV) { - this.vert.style.display = "block"; - this.vert.style.bottom = needsH ? sWidth + "px" : "0"; - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); - // A bug in IE8 can cause this value to be negative, so guard it. - this.vert.firstChild.style.height = - Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; - } else { - this.vert.style.display = ""; - this.vert.firstChild.style.height = "0"; - } - - if (needsH) { - this.horiz.style.display = "block"; - this.horiz.style.right = needsV ? sWidth + "px" : "0"; - this.horiz.style.left = measure.barLeft + "px"; - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); - this.horiz.firstChild.style.width = - (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; - } else { - this.horiz.style.display = ""; - this.horiz.firstChild.style.width = "0"; - } - - if (!this.checkedOverlay && measure.clientHeight > 0) { - if (sWidth == 0) this.overlayHack(); - this.checkedOverlay = true; - } - - return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; - }, - setScrollLeft: function(pos) { - if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; - }, - setScrollTop: function(pos) { - if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; - }, - overlayHack: function() { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.minHeight = this.vert.style.minWidth = w; - var self = this; - var barMouseDown = function(e) { - if (e_target(e) != self.vert && e_target(e) != self.horiz) - operation(self.cm, onMouseDown)(e); - }; - on(this.vert, "mousedown", barMouseDown); - on(this.horiz, "mousedown", barMouseDown); - }, - clear: function() { - var parent = this.horiz.parentNode; - parent.removeChild(this.horiz); - parent.removeChild(this.vert); - } - }, NativeScrollbars.prototype); - - function NullScrollbars() {} - - NullScrollbars.prototype = copyObj({ - update: function() { return {bottom: 0, right: 0}; }, - setScrollLeft: function() {}, - setScrollTop: function() {}, - clear: function() {} - }, NullScrollbars.prototype); - - CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; - - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear(); - if (cm.display.scrollbars.addClass) - rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - - cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); - // Prevent clicks in the scrollbars from killing focus - on(node, "mousedown", function() { - if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0); - }); - node.setAttribute("cm-not-content", "true"); - }, function(pos, axis) { - if (axis == "horizontal") setScrollLeft(cm, pos); - else setScrollTop(cm, pos); - }, cm); - if (cm.display.scrollbars.addClass) - addClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - - function updateScrollbars(cm, measure) { - if (!measure) measure = measureForScrollbars(cm); - var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; - updateScrollbarsInner(cm, measure); - for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) - updateHeightsInViewport(cm); - updateScrollbarsInner(cm, measureForScrollbars(cm)); - startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; - } - } - - // Re-synchronize the fake scrollbars with the actual size of the - // content. - function updateScrollbarsInner(cm, measure) { - var d = cm.display; - var sizes = d.scrollbars.update(measure); - - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = sizes.bottom + "px"; - d.scrollbarFiller.style.width = sizes.right + "px"; - } else d.scrollbarFiller.style.display = ""; - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sizes.bottom + "px"; - d.gutterFiller.style.width = measure.gutterWidth + "px"; - } else d.gutterFiller.style.display = ""; - } - - // Compute the lines that are visible in a given viewport (defaults - // the the current scroll position). viewport may contain top, - // height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); - // Ensure is a {from: {line, ch}, to: {line, ch}} object, and - // forces those lines into the viewport (if possible). - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) { - from = ensureFrom; - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); - to = ensureTo; - } - } - return {from: from, to: Math.max(to, from + 1)}; - } - - // LINE NUMBERS - - // Re-align line numbers and gutter marks to compensate for - // horizontal scrolling. - function alignHorizontally(cm) { - var display = cm.display, view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, left = comp + "px"; - for (var i = 0; i < view.length; i++) if (!view[i].hidden) { - if (cm.options.fixedGutter && view[i].gutter) - view[i].gutter.style.left = left; - var align = view[i].alignable; - if (align) for (var j = 0; j < align.length; j++) - align[j].style.left = left; - } - if (cm.options.fixedGutter) - display.gutters.style.left = (comp + gutterW) + "px"; - } - - // Used to ensure that the line number gutter is still the right - // size for the current document size. Returns true when an update - // is needed. - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) return false; - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm); - return true; - } - return false; - } - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)); - } - - // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, - // but using getBoundingClientRect to get a sub-pixel-accurate - // result. - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; - } - - // DISPLAY DRAWING - - function DisplayUpdate(cm, viewport, force) { - var display = cm.display; - - this.viewport = viewport; - // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.wrapperWidth = display.wrapper.clientWidth; - this.oldDisplayWidth = displayWidth(cm); - this.force = force; - this.dims = getDimensions(cm); - this.events = []; - } - - DisplayUpdate.prototype.signal = function(emitter, type) { - if (hasHandler(emitter, type)) - this.events.push(arguments); - }; - DisplayUpdate.prototype.finish = function() { - for (var i = 0; i < this.events.length; i++) - signal.apply(null, this.events[i]); - }; - - function maybeClipScrollbars(cm) { - var display = cm.display; - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; - display.heightForcer.style.height = scrollGap(cm) + "px"; - display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; - display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; - display.scrollbarsClipped = true; - } - } - - // Does the actual updating of the line display. Bails out - // (returning false) when there is nothing to be done and forced is - // false. - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc; - - if (update.editorIsHidden) { - resetView(cm); - return false; - } - - // Bail out if the visible area is already rendered and nothing changed. - if (!update.force && - update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && - display.renderedView == display.view && countDirtyView(cm) == 0) - return false; - - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - - // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); - if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - - var different = from != display.viewFrom || to != display.viewTo || - display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - adjustView(cm, from, to); - - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px"; - - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) - return false; - - // For big changes, we hide the enclosing element during the - // update, since that speeds up the operations on most browsers. - var focused = activeElt(); - if (toUpdate > 4) display.lineDiv.style.display = "none"; - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) display.lineDiv.style.display = ""; - display.renderedView = display.view; - // There might have been a widget with a focused element that got - // hidden or updated, if so re-focus it. - if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); - - // Prevent selection and cursors from interfering with the scroll - // width and height. - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - display.gutters.style.height = display.sizer.style.minHeight = 0; - - if (different) { - display.lastWrapHeight = update.wrapperHeight; - display.lastWrapWidth = update.wrapperWidth; - startWorker(cm, 400); - } - - display.updateLineNumbers = null; - - return true; - } - - function postUpdateDisplay(cm, update) { - var viewport = update.viewport; - for (var first = true;; first = false) { - if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) - break; - } - if (!updateDisplayIfNeeded(cm, update)) break; - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - setDocumentHeight(cm, barMeasure); - updateScrollbars(cm, barMeasure); - } - - update.signal(cm, "update", cm); - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; - } - } - - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - setDocumentHeight(cm, barMeasure); - updateScrollbars(cm, barMeasure); - update.finish(); - } - } - - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px"; - var total = measure.docHeight + cm.display.barHeight; - cm.display.heightForcer.style.top = total + "px"; - cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px"; - } - - // Read the actual heights of the rendered lines, and update their - // stored heights to match. - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], height; - if (cur.hidden) continue; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - } - var diff = cur.line.height - height; - if (height < 2) height = textHeight(display); - if (diff > .001 || diff < -.001) { - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) for (var j = 0; j < cur.rest.length; j++) - updateWidgetHeight(cur.rest[j]); - } - } - } - - // Read and store the height of line widgets associated with the - // given line. - function updateWidgetHeight(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) - line.widgets[i].height = line.widgets[i].node.offsetHeight; - } - - // Do a bulk-read of the DOM positions and sizes needed to draw the - // view, so that we don't interleave reading and writing to the DOM. - function getDimensions(cm) { - var d = cm.display, left = {}, width = {}; - var gutterLeft = d.gutters.clientLeft; - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; - width[cm.options.gutters[i]] = n.clientWidth; - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth}; - } - - // Sync the actual display DOM structure with display.view, removing - // nodes for lines that are no longer in view, and creating the ones - // that are not there yet, and updating the ones that are out of - // date. - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, cur = container.firstChild; - - function rm(node) { - var next = node.nextSibling; - // Works around a throw-scroll bug in OS X Webkit - if (webkit && mac && cm.display.currentWheelTarget == node) - node.style.display = "none"; - else - node.parentNode.removeChild(node); - return next; - } - - var view = display.view, lineN = display.viewFrom; - // Loop over the elements in the view, syncing cur (the DOM nodes - // in display.lineDiv) with the view as we go. - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (lineView.hidden) { - } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { // Already drawn - while (cur != lineView.node) cur = rm(cur); - var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) cur = rm(cur); - } - - // When an aspect of a line changes, a string is added to - // lineView.changes. This updates the relevant part of the line's - // DOM structure. - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") updateLineText(cm, lineView); - else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); - else if (type == "class") updateLineClasses(lineView); - else if (type == "widget") updateLineWidgets(cm, lineView, dims); - } - lineView.changes = null; - } - - // Lines with gutter elements, widgets or a background class need to - // be wrapped, and have the extra elements added to the wrapper div - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) - lineView.text.parentNode.replaceChild(lineView.node, lineView.text); - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) lineView.node.style.zIndex = 2; - } - return lineView.node; - } - - function updateLineBackground(lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) cls += " CodeMirror-linebackground"; - if (lineView.background) { - if (cls) lineView.background.className = cls; - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - } - } - - // Wrapper around buildLineContent which will reuse the structure - // in display.externalMeasured when possible. - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built; - } - return buildLineContent(cm, lineView); - } - - // Redraw the line's text. Interacts with the background and text - // classes because the mode may output tokens that influence these - // classes. - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) lineView.node = built.pre; - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - - function updateLineClasses(lineView) { - updateLineBackground(lineView); - if (lineView.line.wrapClass) - ensureLineWrapped(lineView).className = lineView.line.wrapClass; - else if (lineView.node != lineView.text) - lineView.node.className = ""; - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground); - lineView.gutterBackground = null; - } - if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView); - lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, - "left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + - "px; width: " + dims.gutterTotalWidth + "px"); - wrap.insertBefore(lineView.gutterBackground, lineView.text); - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + - (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"); - cm.display.input.setUneditable(gutterWrap); - wrap.insertBefore(gutterWrap, lineView.text); - if (lineView.line.gutterClass) - gutterWrap.className += " " + lineView.line.gutterClass; - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - lineView.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineN), - "CodeMirror-linenumber CodeMirror-gutter-elt", - "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " - + cm.display.lineNumInnerWidth + "px")); - if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; - if (found) - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + - dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } - } - } - - function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) lineView.alignable = null; - for (var node = lineView.node.firstChild, next; node; node = next) { - var next = node.nextSibling; - if (node.className == "CodeMirror-linewidget") - lineView.node.removeChild(node); - } - insertLineWidgets(cm, lineView, dims); - } - - // Build a line's DOM representation from scratch - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) lineView.bgClass = built.bgClass; - if (built.textClass) lineView.textClass = built.textClass; - - updateLineClasses(lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(cm, lineView, dims); - return lineView.node; - } - - // A lineView may contain multiple logical lines (when merged by - // collapsed spans). The widgets for all of them need to be drawn. - function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); - } - - function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { - if (!line.widgets) return; - var wrap = ensureLineWrapped(lineView); - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); - if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true"); - positionLineWidget(widget, node, lineView, dims); - cm.display.input.setUneditable(node); - if (allowAbove && widget.above) - wrap.insertBefore(node, lineView.gutter || lineView.text); - else - wrap.appendChild(node); - signalLater(widget, "redraw"); - } - } - - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; - } - } - - // POSITION OBJECT - - // A Pos instance represents a position within the text. - var Pos = CodeMirror.Pos = function(line, ch) { - if (!(this instanceof Pos)) return new Pos(line, ch); - this.line = line; this.ch = ch; - }; - - // Compare two positions, return 0 if they are the same, a negative - // number when a is less, and a positive number otherwise. - var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; - - function copyPos(x) {return Pos(x.line, x.ch);} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } - - // INPUT HANDLING - - function ensureFocus(cm) { - if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } - } - - function isReadOnly(cm) { - return cm.options.readOnly || cm.doc.cantEdit; - } - - // This will be set to an array of strings when copying, so that, - // when pasting, we know what kind of selections the copied text - // was made out of. - var lastCopied = null; - - function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc; - cm.display.shift = false; - if (!sel) sel = doc.sel; - - var paste = cm.state.pasteIncoming || origin == "paste"; - var textLines = doc.splitLines(inserted), multiPaste = null; - // When pasing N lines into N selections, insert one line per selection - if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.length == 0) { - multiPaste = []; - for (var i = 0; i < lastCopied.length; i++) - multiPaste.push(doc.splitLines(lastCopied[i])); - } - } else if (textLines.length == sel.ranges.length) { - multiPaste = map(textLines, function(l) { return [l]; }); - } - } - - // Normal behavior is to insert the new text into every selection - for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i]; - var from = range.from(), to = range.to(); - if (range.empty()) { - if (deleted && deleted > 0) // Handle deletion - from = Pos(from.line, from.ch - deleted); - else if (cm.state.overwrite && !paste) // Handle overwrite - to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); - } - var updateInput = cm.curOp.updateInput; - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - } - if (inserted && !paste) - triggerElectric(cm, inserted); - - ensureCursorVisible(cm); - cm.curOp.updateInput = updateInput; - cm.curOp.typing = true; - cm.state.pasteIncoming = cm.state.cutIncoming = false; - } - - function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("text/plain"); - if (pasted) { - e.preventDefault(); - runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); }); - return true; - } - } - - function triggerElectric(cm, inserted) { - // When an 'electric' character is inserted, immediately trigger a reindent - if (!cm.options.electricChars || !cm.options.smartIndent) return; - var sel = cm.doc.sel; - - for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i]; - if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue; - var mode = cm.getModeAt(range.head); - var indented = false; - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) - if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range.head.line, "smart"); - break; - } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) - indented = indentLine(cm, range.head.line, "smart"); - } - if (indented) signalLater(cm, "electricInput", cm, range.head.line); - } - } - - function copyableRanges(cm) { - var text = [], ranges = []; - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line; - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - return {text: text, ranges: ranges}; - } - - function disableBrowserMagic(field) { - field.setAttribute("autocorrect", "off"); - field.setAttribute("autocapitalize", "off"); - field.setAttribute("spellcheck", "false"); - } - - // TEXTAREA INPUT STYLE - - function TextareaInput(cm) { - this.cm = cm; - // See input.poll and input.reset - this.prevInput = ""; - - // Flag that indicates whether we expect input to appear real soon - // now (after some event like 'keypress' or 'input') and are - // polling intensively. - this.pollingFast = false; - // Self-resetting timeout for the poller - this.polling = new Delayed(); - // Tracks when input.reset has punted to just putting a short - // string into the textarea instead of the full selection. - this.inaccurateSelection = false; - // Used to work around IE issue with selection being forgotten when focus moves away from textarea - this.hasSelection = false; - this.composing = null; - }; - - function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // The textarea is kept positioned near the cursor to prevent the - // fact that it'll be scrolled into view on input from scrolling - // our fake cursor out of view. On webkit, when wrap=off, paste is - // very slow. So make the area wide instead. - if (webkit) te.style.width = "1000px"; - else te.setAttribute("wrap", "off"); - // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) te.style.border = "1px solid black"; - disableBrowserMagic(te); - return div; - } - - TextareaInput.prototype = copyObj({ - init: function(display) { - var input = this, cm = this.cm; - - // Wraps and hides input textarea - var div = this.wrapper = hiddenTextarea(); - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - var te = this.textarea = div.firstChild; - display.wrapper.insertBefore(div, display.wrapper.firstChild); - - // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) - if (ios) te.style.width = "0px"; - - on(te, "input", function() { - if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null; - input.poll(); - }); - - on(te, "paste", function(e) { - if (handlePaste(e, cm)) return true; - - cm.state.pasteIncoming = true; - input.fastPoll(); - }); - - function prepareCopyCut(e) { - if (cm.somethingSelected()) { - lastCopied = cm.getSelections(); - if (input.inaccurateSelection) { - input.prevInput = ""; - input.inaccurateSelection = false; - te.value = lastCopied.join("\n"); - selectInput(te); - } - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - lastCopied = ranges.text; - if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll); - } else { - input.prevInput = ""; - te.value = ranges.text.join("\n"); - selectInput(te); - } - } - if (e.type == "cut") cm.state.cutIncoming = true; - } - on(te, "cut", prepareCopyCut); - on(te, "copy", prepareCopyCut); - - on(display.scroller, "paste", function(e) { - if (eventInWidget(display, e)) return; - cm.state.pasteIncoming = true; - input.focus(); - }); - - // Prevent normal selection in the editor (we handle our own) - on(display.lineSpace, "selectstart", function(e) { - if (!eventInWidget(display, e)) e_preventDefault(e); - }); - - on(te, "compositionstart", function() { - var start = cm.getCursor("from"); - input.composing = { - start: start, - range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) - }; - }); - on(te, "compositionend", function() { - if (input.composing) { - input.poll(); - input.composing.range.clear(); - input.composing = null; - } - }); - }, - - prepareSelection: function() { - // Redraw the selection and/or cursor - var cm = this.cm, display = cm.display, doc = cm.doc; - var result = prepareSelection(cm); - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)); - } - - return result; - }, - - showSelection: function(drawn) { - var cm = this.cm, display = cm.display; - removeChildrenAndAdd(display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px"; - this.wrapper.style.left = drawn.teLeft + "px"; - } - }, - - // Reset the input to correspond to the selection (or to be empty, - // when not typing and nothing is selected) - reset: function(typing) { - if (this.contextMenuPending) return; - var minimal, selected, cm = this.cm, doc = cm.doc; - if (cm.somethingSelected()) { - this.prevInput = ""; - var range = doc.sel.primary(); - minimal = hasCopyEvent && - (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); - var content = minimal ? "-" : selected || cm.getSelection(); - this.textarea.value = content; - if (cm.state.focused) selectInput(this.textarea); - if (ie && ie_version >= 9) this.hasSelection = content; - } else if (!typing) { - this.prevInput = this.textarea.value = ""; - if (ie && ie_version >= 9) this.hasSelection = null; - } - this.inaccurateSelection = minimal; - }, - - getField: function() { return this.textarea; }, - - supportsTouch: function() { return false; }, - - focus: function() { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { - try { this.textarea.focus(); } - catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM - } - }, - - blur: function() { this.textarea.blur(); }, - - resetPosition: function() { - this.wrapper.style.top = this.wrapper.style.left = 0; - }, - - receivedFocus: function() { this.slowPoll(); }, - - // Poll for input changes, using the normal rate of polling. This - // runs as long as the editor is focused. - slowPoll: function() { - var input = this; - if (input.pollingFast) return; - input.polling.set(this.cm.options.pollInterval, function() { - input.poll(); - if (input.cm.state.focused) input.slowPoll(); - }); - }, - - // When an event has just come in that is likely to add or change - // something in the input textarea, we poll faster, to ensure that - // the change appears on the screen quickly. - fastPoll: function() { - var missed = false, input = this; - input.pollingFast = true; - function p() { - var changed = input.poll(); - if (!changed && !missed) {missed = true; input.polling.set(60, p);} - else {input.pollingFast = false; input.slowPoll();} - } - input.polling.set(20, p); - }, - - // Read input from the textarea, and update the document to match. - // When something is selected, it is present in the textarea, and - // selected (unless it is huge, in which case a placeholder is - // used). When nothing is selected, the cursor sits after previously - // seen text (can be empty), which is stored in prevInput (we must - // not reset the textarea when typing, because that breaks IME). - poll: function() { - var cm = this.cm, input = this.textarea, prevInput = this.prevInput; - // Since this is called a *lot*, try to bail out as cheaply as - // possible when it is clear that nothing happened. hasSelection - // will be the case when there is a lot of text in the textarea, - // in which case reading its value would be expensive. - if (this.contextMenuPending || !cm.state.focused || - (hasSelection(input) && !prevInput && !this.composing) || - isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq) - return false; - - var text = input.value; - // If nothing changed, bail. - if (text == prevInput && !cm.somethingSelected()) return false; - // Work around nonsensical selection resetting in IE9/10, and - // inexplicable appearance of private area unicode characters on - // some key combos in Mac (#2689). - if (ie && ie_version >= 9 && this.hasSelection === text || - mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset(); - return false; - } - - if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0); - if (first == 0x200b && !prevInput) prevInput = "\u200b"; - if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); } - } - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; - - var self = this; - runInOp(cm, function() { - applyTextInput(cm, text.slice(same), prevInput.length - same, - null, self.composing ? "*compose" : null); - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; - else self.prevInput = text; - - if (self.composing) { - self.composing.range.clear(); - self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"), - {className: "CodeMirror-composing"}); - } - }); - return true; - }, - - ensurePolled: function() { - if (this.pollingFast && this.poll()) this.pollingFast = false; - }, - - onKeyPress: function() { - if (ie && ie_version >= 9) this.hasSelection = null; - this.fastPoll(); - }, - - onContextMenu: function(e) { - var input = this, cm = input.cm, display = cm.display, te = input.textarea; - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || presto) return; // Opera is difficult. - - // Reset the current text selection only if the click is done outside of the selection - // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) - operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - - var oldCSS = te.style.cssText; - input.wrapper.style.position = "absolute"; - te.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + - (ie ? "rgba(255, 255, 255, .05)" : "transparent") + - "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) - display.input.focus(); - if (webkit) window.scrollTo(null, oldScrollY); - display.input.reset(); - // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) te.value = input.prevInput = " "; - input.contextMenuPending = true; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - - // Select-all will be greyed out if there's nothing to select, so - // this adds a zero-width space so that we can later check whether - // it got selected. - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = "\u200b" + (selected ? te.value : ""); - te.value = "\u21da"; // Used to catch context-menu undo - te.value = extval; - input.prevInput = selected ? "" : "\u200b"; - te.selectionStart = 1; te.selectionEnd = extval.length; - // Re-set this, in case some other handler touched the - // selection in the meantime. - display.selForContextMenu = cm.doc.sel; - } - } - function rehide() { - input.contextMenuPending = false; - input.wrapper.style.position = "relative"; - te.style.cssText = oldCSS; - if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); - - // Try to detect the user choosing select-all - if (te.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); - var i = 0, poll = function() { - if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && - te.selectionEnd > 0 && input.prevInput == "\u200b") - operation(cm, commands.selectAll)(cm); - else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); - else display.input.reset(); - }; - display.detectingSelectAll = setTimeout(poll, 200); - } - } - - if (ie && ie_version >= 9) prepareSelectAllHack(); - if (captureRightClick) { - e_stop(e); - var mouseup = function() { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }; - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - }, - - setUneditable: nothing, - - needsContentAttribute: false - }, TextareaInput.prototype); - - // CONTENTEDITABLE INPUT STYLE - - function ContentEditableInput(cm) { - this.cm = cm; - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; - this.polling = new Delayed(); - this.gracePeriod = false; - } - - ContentEditableInput.prototype = copyObj({ - init: function(display) { - var input = this, cm = input.cm; - var div = input.div = display.lineDiv; - div.contentEditable = "true"; - disableBrowserMagic(div); - - on(div, "paste", function(e) { handlePaste(e, cm); }) - - on(div, "compositionstart", function(e) { - var data = e.data; - input.composing = {sel: cm.doc.sel, data: data, startData: data}; - if (!data) return; - var prim = cm.doc.sel.primary(); - var line = cm.getLine(prim.head.line); - var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length)); - if (found > -1 && found <= prim.head.ch) - input.composing.sel = simpleSelection(Pos(prim.head.line, found), - Pos(prim.head.line, found + data.length)); - }); - on(div, "compositionupdate", function(e) { - input.composing.data = e.data; - }); - on(div, "compositionend", function(e) { - var ours = input.composing; - if (!ours) return; - if (e.data != ours.startData && !/\u200b/.test(e.data)) - ours.data = e.data; - // Need a small delay to prevent other code (input event, - // selection polling) from doing damage when fired right after - // compositionend. - setTimeout(function() { - if (!ours.handled) - input.applyComposition(ours); - if (input.composing == ours) - input.composing = null; - }, 50); - }); - - on(div, "touchstart", function() { - input.forceCompositionEnd(); - }); - - on(div, "input", function() { - if (input.composing) return; - if (!input.pollContent()) - runInOp(input.cm, function() {regChange(cm);}); - }); - - function onCopyCut(e) { - if (cm.somethingSelected()) { - lastCopied = cm.getSelections(); - if (e.type == "cut") cm.replaceSelection("", null, "cut"); - } else if (!cm.options.lineWiseCopyCut) { - return; - } else { - var ranges = copyableRanges(cm); - lastCopied = ranges.text; - if (e.type == "cut") { - cm.operation(function() { - cm.setSelections(ranges.ranges, 0, sel_dontScroll); - cm.replaceSelection("", null, "cut"); - }); - } - } - // iOS exposes the clipboard API, but seems to discard content inserted into it - if (e.clipboardData && !ios) { - e.preventDefault(); - e.clipboardData.clearData(); - e.clipboardData.setData("text/plain", lastCopied.join("\n")); - } else { - // Old-fashioned briefly-focus-a-textarea hack - var kludge = hiddenTextarea(), te = kludge.firstChild; - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.join("\n"); - var hadFocus = document.activeElement; - selectInput(te); - setTimeout(function() { - cm.display.lineSpace.removeChild(kludge); - hadFocus.focus(); - }, 50); - } - } - on(div, "copy", onCopyCut); - on(div, "cut", onCopyCut); - }, - - prepareSelection: function() { - var result = prepareSelection(this.cm, false); - result.focus = this.cm.state.focused; - return result; - }, - - showSelection: function(info) { - if (!info || !this.cm.display.view.length) return; - if (info.focus) this.showPrimarySelection(); - this.showMultipleSelections(info); - }, - - showPrimarySelection: function() { - var sel = window.getSelection(), prim = this.cm.doc.sel.primary(); - var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset); - var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset); - if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && - cmp(minPos(curAnchor, curFocus), prim.from()) == 0 && - cmp(maxPos(curAnchor, curFocus), prim.to()) == 0) - return; - - var start = posToDOM(this.cm, prim.from()); - var end = posToDOM(this.cm, prim.to()); - if (!start && !end) return; - - var view = this.cm.display.view; - var old = sel.rangeCount && sel.getRangeAt(0); - if (!start) { - start = {node: view[0].measure.map[2], offset: 0}; - } else if (!end) { // FIXME dangerously hacky - var measure = view[view.length - 1].measure; - var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; - end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; - } - - try { var rng = range(start.node, start.offset, end.offset, end.node); } - catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible - if (rng) { - sel.removeAllRanges(); - sel.addRange(rng); - if (old && sel.anchorNode == null) sel.addRange(old); - else if (gecko) this.startGracePeriod(); - } - this.rememberSelection(); - }, - - startGracePeriod: function() { - var input = this; - clearTimeout(this.gracePeriod); - this.gracePeriod = setTimeout(function() { - input.gracePeriod = false; - if (input.selectionChanged()) - input.cm.operation(function() { input.cm.curOp.selectionChanged = true; }); - }, 20); - }, - - showMultipleSelections: function(info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); - }, - - rememberSelection: function() { - var sel = window.getSelection(); - this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; - this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; - }, - - selectionInEditor: function() { - var sel = window.getSelection(); - if (!sel.rangeCount) return false; - var node = sel.getRangeAt(0).commonAncestorContainer; - return contains(this.div, node); - }, - - focus: function() { - if (this.cm.options.readOnly != "nocursor") this.div.focus(); - }, - blur: function() { this.div.blur(); }, - getField: function() { return this.div; }, - - supportsTouch: function() { return true; }, - - receivedFocus: function() { - var input = this; - if (this.selectionInEditor()) - this.pollSelection(); - else - runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; }); - - function poll() { - if (input.cm.state.focused) { - input.pollSelection(); - input.polling.set(input.cm.options.pollInterval, poll); - } - } - this.polling.set(this.cm.options.pollInterval, poll); - }, - - selectionChanged: function() { - var sel = window.getSelection(); - return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || - sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; - }, - - pollSelection: function() { - if (!this.composing && !this.gracePeriod && this.selectionChanged()) { - var sel = window.getSelection(), cm = this.cm; - this.rememberSelection(); - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var head = domToPos(cm, sel.focusNode, sel.focusOffset); - if (anchor && head) runInOp(cm, function() { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); - if (anchor.bad || head.bad) cm.curOp.selectionChanged = true; - }); - } - }, - - pollContent: function() { - var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); - var from = sel.from(), to = sel.to(); - if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false; - - var fromIndex; - if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - var fromLine = lineNo(display.view[0].line); - var fromNode = display.view[0].node; - } else { - var fromLine = lineNo(display.view[fromIndex].line); - var fromNode = display.view[fromIndex - 1].node.nextSibling; - } - var toIndex = findViewIndex(cm, to.line); - if (toIndex == display.view.length - 1) { - var toLine = display.viewTo - 1; - var toNode = display.lineDiv.lastChild; - } else { - var toLine = lineNo(display.view[toIndex + 1].line) - 1; - var toNode = display.view[toIndex + 1].node.previousSibling; - } - - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); - while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } - else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } - else break; - } - - var cutFront = 0, cutEnd = 0; - var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); - while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) - ++cutFront; - var newBot = lst(newText), oldBot = lst(oldText); - var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), - oldBot.length - (oldText.length == 1 ? cutFront : 0)); - while (cutEnd < maxCutEnd && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) - ++cutEnd; - - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd); - newText[0] = newText[0].slice(cutFront); - - var chFrom = Pos(fromLine, cutFront); - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); - if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input"); - return true; - } - }, - - ensurePolled: function() { - this.forceCompositionEnd(); - }, - reset: function() { - this.forceCompositionEnd(); - }, - forceCompositionEnd: function() { - if (!this.composing || this.composing.handled) return; - this.applyComposition(this.composing); - this.composing.handled = true; - this.div.blur(); - this.div.focus(); - }, - applyComposition: function(composing) { - if (composing.data && composing.data != composing.startData) - operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel); - }, - - setUneditable: function(node) { - node.setAttribute("contenteditable", "false"); - }, - - onKeyPress: function(e) { - e.preventDefault(); - operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); - }, - - onContextMenu: nothing, - resetPosition: nothing, - - needsContentAttribute: true - }, ContentEditableInput.prototype); - - function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line); - if (!view || view.hidden) return null; - var line = getLine(cm.doc, pos.line); - var info = mapFromLineView(view, line, pos.line); - - var order = getOrder(line), side = "left"; - if (order) { - var partPos = getBidiPartAt(order, pos.ch); - side = partPos % 2 ? "right" : "left"; - } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); - result.offset = result.collapse == "right" ? result.end : result.start; - return result; - } - - function badPos(pos, bad) { if (bad) pos.bad = true; return pos; } - - function domToPos(cm, node, offset) { - var lineNode; - if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset]; - if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); - node = null; offset = 0; - } else { - for (lineNode = node;; lineNode = lineNode.parentNode) { - if (!lineNode || lineNode == cm.display.lineDiv) return null; - if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break; - } - } - for (var i = 0; i < cm.display.view.length; i++) { - var lineView = cm.display.view[i]; - if (lineView.node == lineNode) - return locateNodeInLineView(lineView, node, offset); - } - } - - function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, bad = false; - if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true); - if (node == wrapper) { - bad = true; - node = wrapper.childNodes[offset]; - offset = 0; - if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line; - return badPos(Pos(lineNo(line), line.text.length), bad); - } - } - - var textNode = node.nodeType == 3 ? node : null, topNode = node; - if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild; - if (offset) offset = textNode.nodeValue.length; - } - while (topNode.parentNode != wrapper) topNode = topNode.parentNode; - var measure = lineView.measure, maps = measure.maps; - - function find(textNode, topNode, offset) { - for (var i = -1; i < (maps ? maps.length : 0); i++) { - var map = i < 0 ? measure.map : maps[i]; - for (var j = 0; j < map.length; j += 3) { - var curNode = map[j + 2]; - if (curNode == textNode || curNode == topNode) { - var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); - var ch = map[j] + offset; - if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)]; - return Pos(line, ch); - } - } - } - } - var found = find(textNode, topNode, offset); - if (found) return badPos(found, bad); - - // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems - for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0); - if (found) - return badPos(Pos(found.line, found.ch - dist), bad); - else - dist += after.textContent.length; - } - for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1); - if (found) - return badPos(Pos(found.line, found.ch + dist), bad); - else - dist += after.textContent.length; - } - } - - function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", closing = false, lineSep = cm.doc.lineSeparator(); - function recognizeMarker(id) { return function(marker) { return marker.id == id; }; } - function walk(node) { - if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text"); - if (cmText != null) { - if (cmText == "") cmText = node.textContent.replace(/\u200b/g, ""); - text += cmText; - return; - } - var markerID = node.getAttribute("cm-marker"), range; - if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); - if (found.length && (range = found[0].find())) - text += getBetween(cm.doc, range.from, range.to).join(lineSep); - return; - } - if (node.getAttribute("contenteditable") == "false") return; - for (var i = 0; i < node.childNodes.length; i++) - walk(node.childNodes[i]); - if (/^(pre|div|p)$/i.test(node.nodeName)) - closing = true; - } else if (node.nodeType == 3) { - var val = node.nodeValue; - if (!val) return; - if (closing) { - text += lineSep; - closing = false; - } - text += val; - } - } - for (;;) { - walk(from); - if (from == to) break; - from = from.nextSibling; - } - return text; - } - - CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; - - // SELECTION / CURSOR - - // Selection objects are immutable. A new one is created every time - // the selection changes. A selection is one or more non-overlapping - // (and non-touching) ranges, sorted, and an integer that indicates - // which one is the primary selection (the one that's scrolled into - // view, that getCursor returns, etc). - function Selection(ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - } - - Selection.prototype = { - primary: function() { return this.ranges[this.primIndex]; }, - equals: function(other) { - if (other == this) return true; - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; - for (var i = 0; i < this.ranges.length; i++) { - var here = this.ranges[i], there = other.ranges[i]; - if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; - } - return true; - }, - deepCopy: function() { - for (var out = [], i = 0; i < this.ranges.length; i++) - out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); - return new Selection(out, this.primIndex); - }, - somethingSelected: function() { - for (var i = 0; i < this.ranges.length; i++) - if (!this.ranges[i].empty()) return true; - return false; - }, - contains: function(pos, end) { - if (!end) end = pos; - for (var i = 0; i < this.ranges.length; i++) { - var range = this.ranges[i]; - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - return i; - } - return -1; - } - }; - - function Range(anchor, head) { - this.anchor = anchor; this.head = head; - } - - Range.prototype = { - from: function() { return minPos(this.anchor, this.head); }, - to: function() { return maxPos(this.anchor, this.head); }, - empty: function() { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; - } - }; - - // Take an unsorted, potentially overlapping set of ranges, and - // build a selection out of it. 'Consumes' ranges array (modifying - // it). - function normalizeSelection(ranges, primIndex) { - var prim = ranges[primIndex]; - ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); - primIndex = indexOf(ranges, prim); - for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1]; - if (cmp(prev.to(), cur.from()) >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i <= primIndex) --primIndex; - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); - } - } - return new Selection(ranges, primIndex); - } - - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0); - } - - // Most of the external API clips given positions to make sure they - // actually exist within the document. - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} - function clipPos(doc, pos) { - if (pos.line < doc.first) return Pos(doc.first, 0); - var last = doc.first + doc.size - 1; - if (pos.line > last) return Pos(last, getLine(doc, last).text.length); - return clipToLen(pos, getLine(doc, pos.line).text.length); - } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) return Pos(pos.line, linelen); - else if (ch < 0) return Pos(pos.line, 0); - else return pos; - } - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} - function clipPosArray(doc, array) { - for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); - return out; - } - - // SELECTION UPDATES - - // The 'scroll' parameter given to many of these indicated whether - // the new cursor position should be scrolled into view after - // modifying the selection. - - // If shift is held or the extend flag is set, extends a range to - // include a given position (and optionally a second position). - // Otherwise, simply returns the range between the given positions. - // Used for cursor motion and such. - function extendRange(doc, range, head, other) { - if (doc.cm && doc.cm.display.shift || doc.extend) { - var anchor = range.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head; - head = other; - } else if (posBefore != (cmp(head, other) < 0)) { - head = other; - } - } - return new Range(anchor, head); - } else { - return new Range(other || head, head); - } - } - - // Extend the primary selection range, discard the rest. - function extendSelection(doc, head, other, options) { - setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); - } - - // Extend all selections (pos is an array of selections with length - // equal the number of selections) - function extendSelections(doc, heads, options) { - for (var out = [], i = 0; i < doc.sel.ranges.length; i++) - out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); - var newSel = normalizeSelection(out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - - // Updates a single range in the selection. - function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i] = range; - setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); - } - - // Reset the selection to a single range. - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - - // Give beforeSelectionChange handlers a change to influence a - // selection update. - function filterSelectionChange(doc, sel) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - this.ranges = []; - for (var i = 0; i < ranges.length; i++) - this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)); - } - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); - else return sel; - } - - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); - } - } - - // Set a new selection. - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - sel = filterSelectionChange(doc, sel); - - var bias = options && options.bias || - (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - - if (!(options && options.scroll === false) && doc.cm) - ensureCursorVisible(doc.cm); - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) return; - - doc.sel = sel; - - if (doc.cm) { - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - - // Verify that the selection does not partially select any atomic - // marked ranges. - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); - } - - // Return a selection that does not partially select any atomic - // ranges. - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range.head, bias, mayClear); - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) out = sel.ranges.slice(0, i); - out[i] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(out, sel.primIndex) : sel; - } - - // Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, bias, mayClear) { - var flipped = false, curPos = pos; - var dir = bias || 1; - doc.cantEdit = false; - search: for (;;) { - var line = getLine(doc, curPos.line); - if (line.markedSpans) { - for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) break; - else {--i; continue;} - } - } - if (!m.atomic) continue; - var newPos = m.find(dir < 0 ? -1 : 1); - if (cmp(newPos, curPos) == 0) { - newPos.ch += dir; - if (newPos.ch < 0) { - if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); - else newPos = null; - } else if (newPos.ch > line.text.length) { - if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); - else newPos = null; - } - if (!newPos) { - if (flipped) { - // Driven in a corner -- no valid cursor position found at all - // -- try again *with* clearing, if we didn't already - if (!mayClear) return skipAtomic(doc, pos, bias, true); - // Otherwise, turn off editing until further notice, and return the start of the doc - doc.cantEdit = true; - return Pos(doc.first, 0); - } - flipped = true; newPos = pos; dir = -dir; - } - } - curPos = newPos; - continue search; - } - } - } - return curPos; - } - } - - // SELECTION DRAWING - - function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()); - } - - function prepareSelection(cm, primary) { - var doc = cm.doc, result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - - for (var i = 0; i < doc.sel.ranges.length; i++) { - if (primary === false && i == doc.sel.primIndex) continue; - var range = doc.sel.ranges[i]; - var collapsed = range.empty(); - if (collapsed || cm.options.showCursorWhenSelecting) - drawSelectionCursor(cm, range, curFragment); - if (!collapsed) - drawSelectionRange(cm, range, selFragment); - } - return result; - } - - // Draws a cursor for the given range - function drawSelectionCursor(cm, range, output) { - var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine); - - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - - if (pos.other) { - // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } - } - - // Draws the given range as a highlighted selection - function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), leftSide = padding.left; - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - - function add(left, top, width, bottom) { - if (top < 0) top = 0; - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + - "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + - "px; height: " + (bottom - top) + "px")); - } - - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias); - } - - iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { - var leftPos = coords(from, "left"), rightPos, left, right; - if (from == to) { - rightPos = leftPos; - left = right = leftPos.left; - } else { - rightPos = coords(to - 1, "right"); - if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } - left = leftPos.left; - right = rightPos.right; - } - if (fromArg == null && from == 0) left = leftSide; - if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part - add(left, leftPos.top, null, leftPos.bottom); - left = leftSide; - if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); - } - if (toArg == null && to == lineLen) right = rightSide; - if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) - start = leftPos; - if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) - end = rightPos; - if (left < leftSide + 1) left = leftSide; - add(left, rightPos.top, right - left, rightPos.bottom); - }); - return {start: start, end: end}; - } - - var sFrom = range.from(), sTo = range.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) - add(leftSide, leftEnd.bottom, null, rightStart.top); - } - - output.appendChild(fragment); - } - - // Cursor-blinking - function restartBlink(cm) { - if (!cm.state.focused) return; - var display = cm.display; - clearInterval(display.blinker); - var on = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) - display.blinker = setInterval(function() { - display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); - else if (cm.options.cursorBlinkRate < 0) - display.cursorDiv.style.visibility = "hidden"; - } - - // HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) - cm.state.highlight.set(time, bind(highlightWorker, cm)); - } - - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.frontier < doc.first) doc.frontier = doc.first; - if (doc.frontier >= cm.display.viewTo) return; - var end = +new Date + cm.options.workTime; - var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); - var changedLines = []; - - doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { - if (doc.frontier >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles; - var highlighted = highlightLine(cm, line, state, true); - line.styles = highlighted.styles; - var oldCls = line.styleClasses, newCls = highlighted.classes; - if (newCls) line.styleClasses = newCls; - else if (oldCls) line.styleClasses = null; - var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; - if (ischange) changedLines.push(doc.frontier); - line.stateAfter = copyState(doc.mode, state); - } else { - processLine(cm, line.text, state); - line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; - } - ++doc.frontier; - if (+new Date > end) { - startWorker(cm, cm.options.workDelay); - return true; - } - }); - if (changedLines.length) runInOp(cm, function() { - for (var i = 0; i < changedLines.length; i++) - regLineChange(cm, changedLines[i], "text"); - }); - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) return doc.first; - var line = getLine(doc, search - 1); - if (line.stateAfter && (!precise || search <= doc.frontier)) return search; - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - - function getStateBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display; - if (!doc.mode.startState) return true; - var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; - if (!state) state = startState(doc.mode); - else state = copyState(doc.mode, state); - doc.iter(pos, n, function(line) { - processLine(cm, line.text, state); - var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; - line.stateAfter = save ? copyState(doc.mode, state) : null; - ++pos; - }); - if (precise) doc.frontier = pos; - return state; - } - - // POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop;} - function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} - function paddingH(display) { - if (display.cachedPaddingH) return display.cachedPaddingH; - var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; - if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; - return data; - } - - function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; } - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; - } - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; - } - - // Ensure the lineView.wrapping.heights array is populated. This is - // an array of bottom offsets for the lines that make up a drawn - // line. When lineWrapping is on, there might be more than one - // height. - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && displayWidth(cm); - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) - heights.push((cur.bottom + next.top) / 2 - rect.top); - } - } - heights.push(rect.bottom - rect.top); - } - } - - // Find a line map (mapping character offsets to text nodes) and a - // measurement cache for the given line number. (A line view might - // contain multiple lines when collapsed ranges are present.) - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) - return {map: lineView.measure.map, cache: lineView.measure.cache}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineView.rest[i] == line) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineNo(lineView.rest[i]) > lineN) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; - } - - // Render a line into the hidden node display.externalMeasured. Used - // when measurement is needed for a line that's not in the viewport. - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view; - } - - // Get a {top, bottom, left, right} box (in line-local coordinates) - // for a given character. - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); - } - - // Find a line view that corresponds to the given line number. - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) - return cm.display.view[findViewIndex(cm, lineN)]; - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) - return ext; - } - - // Measurement can be split in two steps, the set-up work that - // applies to the whole line, and the measurement of the actual - // character. Functions like coordsChar, that need to do a lot of - // measurements in a row, can thus ensure that the set-up work is - // only done once. - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) { - view = null; - } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - cm.curOp.forceUpdate = true; - } - if (!view) - view = updateExternalMeasurement(cm, line); - - var info = mapFromLineView(view, line, lineN); - return { - line: line, view: view, rect: null, - map: info.map, cache: info.cache, before: info.before, - hasHeights: false - }; - } - - // Given a prepared measurement object, measures the position of an - // actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) ch = -1; - var key = ch + (bias || ""), found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; - } else { - if (!prepared.rect) - prepared.rect = prepared.view.text.getBoundingClientRect(); - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) prepared.cache[key] = found; - } - return {left: found.left, right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom}; - } - - var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; - - function nodeAndOffsetInLineMap(map, ch, bias) { - var node, start, end, collapse; - // First, search the line map for the text node corresponding to, - // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - var mStart = map[i], mEnd = map[i + 1]; - if (ch < mStart) { - start = 0; end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) collapse = "right"; - } - if (start != null) { - node = map[i + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - collapse = bias; - if (bias == "left" && start == 0) - while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2]; - collapse = "left"; - } - if (bias == "right" && start == mEnd - mStart) - while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2]; - collapse = "right"; - } - break; - } - } - return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}; - } - - function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); - var node = place.node, start = place.start, end = place.end, collapse = place.collapse; - - var rect; - if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start; - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end; - if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { - rect = node.parentNode.getBoundingClientRect(); - } else if (ie && cm.options.lineWrapping) { - var rects = range(node, start, end).getClientRects(); - if (rects.length) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = nullRect; - } else { - rect = range(node, start, end).getBoundingClientRect() || nullRect; - } - if (rect.left || rect.right || start == 0) break; - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); - } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) collapse = bias = "right"; - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = node.getBoundingClientRect(); - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) - rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; - else - rect = nullRect; - } - - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - for (var i = 0; i < heights.length - 1; i++) - if (mid < heights[i]) break; - var top = i ? heights[i - 1] : 0, bot = heights[i]; - var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot}; - if (!rect.left && !rect.right) result.bogus = true; - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } - - return result; - } - - // Work around problem with bounding client rects on ranges being - // returned incorrectly when zoomed on IE10 and below. - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || - screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) - return rect; - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return {left: rect.left * scaleX, right: rect.right * scaleX, - top: rect.top * scaleY, bottom: rect.bottom * scaleY}; - } - - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - lineView.measure.caches[i] = {}; - } - } - - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i = 0; i < cm.display.view.length; i++) - clearLineMeasurementCacheFor(cm.display.view[i]); - } - - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; - cm.display.lineNumChars = null; - } - - function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } - function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } - - // Converts a {top, bottom, left, right} box from line-local - // coordinates into another coordinate system. Context may be one of - // "line", "div" (display.lineDiv), "local"/null (editor), "window", - // or "page". - function intoCoordSystem(cm, lineObj, rect, context) { - if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { - var size = widgetHeight(lineObj.widgets[i]); - rect.top += size; rect.bottom += size; - } - if (context == "line") return rect; - if (!context) context = "local"; - var yOff = heightAtLine(lineObj); - if (context == "local") yOff += paddingTop(cm.display); - else yOff -= cm.display.viewOffset; - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); - rect.left += xOff; rect.right += xOff; - } - rect.top += yOff; rect.bottom += yOff; - return rect; - } - - // Coverts a box from "div" coords to another coordinate system. - // Context may be "window", "page", "div", or "local"/null. - function fromCoordSystem(cm, coords, context) { - if (context == "div") return coords; - var left = coords.left, top = coords.top; - // First move into "page" coordinate system - if (context == "page") { - left -= pageScrollX(); - top -= pageScrollY(); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; - } - - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) lineObj = getLine(cm.doc, pos.line); - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); - } - - // Returns a box for a given cursor position, which may have an - // 'other' property containing the position of the secondary cursor - // on a bidi boundary. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); - function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); - if (right) m.left = m.right; else m.right = m.left; - return intoCoordSystem(cm, lineObj, m, context); - } - function getBidi(ch, partPos) { - var part = order[partPos], right = part.level % 2; - if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { - part = order[--partPos]; - ch = bidiRight(part) - (part.level % 2 ? 0 : 1); - right = true; - } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { - part = order[++partPos]; - ch = bidiLeft(part) - part.level % 2; - right = false; - } - if (right && ch == part.to && ch > part.from) return get(ch - 1); - return get(ch, right); - } - var order = getOrder(lineObj), ch = pos.ch; - if (!order) return get(ch); - var partPos = getBidiPartAt(order, ch); - var val = getBidi(ch, partPos); - if (bidiOther != null) val.other = getBidi(ch, bidiOther); - return val; - } - - // Used to cheaply estimate the coordinates for a position. Used for - // intermediate scroll updates. - function estimateCoords(cm, pos) { - var left = 0, pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return {left: left, right: left, top: top, bottom: top + lineObj.height}; - } - - // Positions returned by coordsChar contain some extra information. - // xRel is the relative x position of the input coordinates compared - // to the found position (so xRel > 0 means the coordinates are to - // the right of the character position, for example). When outside - // is true, that means the coordinates lie outside the line's - // vertical range. - function PosWithInfo(line, ch, outside, xRel) { - var pos = Pos(line, ch); - pos.xRel = xRel; - if (outside) pos.outside = true; - return pos; - } - - // Compute the character position closest to the given coordinates. - // Input must be lineSpace-local ("div" coordinate system). - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) return PosWithInfo(doc.first, 0, true, -1); - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; - if (lineN > last) - return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); - if (x < 0) x = 0; - - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var merged = collapsedSpanAtEnd(lineObj); - var mergedPos = merged && merged.find(0, true); - if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) - lineN = lineNo(lineObj = mergedPos.to.line); - else - return found; - } - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - var innerOff = y - heightAtLine(lineObj); - var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - - function getX(ch) { - var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); - wrongLine = true; - if (innerOff > sp.bottom) return sp.left - adjust; - else if (innerOff < sp.top) return sp.left + adjust; - else wrongLine = false; - return sp.left; - } - - var bidi = getOrder(lineObj), dist = lineObj.text.length; - var from = lineLeft(lineObj), to = lineRight(lineObj); - var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; - - if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); - // Do a binary search between these bounds. - for (;;) { - if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { - var ch = x < fromX || x - fromX <= toX - x ? from : to; - var xDiff = x - (ch == from ? fromX : toX); - while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; - var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, - xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); - return pos; - } - var step = Math.ceil(dist / 2), middle = from + step; - if (bidi) { - middle = from; - for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); - } - var middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} - else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} - } - } - - var measureText; - // Compute the default text height. - function textHeight(display) { - if (display.cachedTextHeight != null) return display.cachedTextHeight; - if (measureText == null) { - measureText = elt("pre"); - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) display.cachedTextHeight = height; - removeChildren(display.measure); - return height || 1; - } - - // Compute the default character width. - function charWidth(display) { - if (display.cachedCharWidth != null) return display.cachedCharWidth; - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor]); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; - if (width > 2) display.cachedCharWidth = width; - return width || 10; - } - - // OPERATIONS - - // Operations are used to wrap a series of changes to the editor - // state in such a way that each change won't have to update the - // cursor and display (which would be awkward, slow, and - // error-prone). Instead, display updates are batched and then all - // combined and executed at once. - - var operationGroup = null; - - var nextOpId = 0; - // Start a new operation. - function startOperation(cm) { - cm.curOp = { - cm: cm, - viewChanged: false, // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, // Used to detect need to update scrollbar - forceUpdate: false, // Used to force a redraw - updateInput: null, // Whether to reset the input textarea - typing: false, // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, // Accumulated changes, for firing change events - cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already - selectionChanged: false, // Whether the selection needs to be redrawn - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position - focus: false, - id: ++nextOpId // Unique ID - }; - if (operationGroup) { - operationGroup.ops.push(cm.curOp); - } else { - cm.curOp.ownsGroup = operationGroup = { - ops: [cm.curOp], - delayedCallbacks: [] - }; - } - } - - function fireCallbacksForOps(group) { - // Calls delayed callbacks and cursorActivity handlers until no - // new ones appear - var callbacks = group.delayedCallbacks, i = 0; - do { - for (; i < callbacks.length; i++) - callbacks[i](); - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) - while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); - } - } while (i < callbacks.length); - } - - // Finish an operation, updating the display and signalling delayed events - function endOperation(cm) { - var op = cm.curOp, group = op.ownsGroup; - if (!group) return; - - try { fireCallbacksForOps(group); } - finally { - operationGroup = null; - for (var i = 0; i < group.ops.length; i++) - group.ops[i].cm.curOp = null; - endOperations(group); - } - } - - // The DOM updates done when an operation finishes are batched so - // that the minimum number of relayouts are required. - function endOperations(group) { - var ops = group.ops; - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R1(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W1(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R2(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W2(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_finish(ops[i]); - } - - function endOperation_R1(op) { - var cm = op.cm, display = cm.display; - maybeClipScrollbars(cm); - if (op.updateMaxLine) findMaxLine(cm); - - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); - } - - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); - } - - function endOperation_R2(op) { - var cm = op.cm, display = cm.display; - if (op.updatedDisplay) updateHeightsInViewport(cm); - - op.barMeasure = measureForScrollbars(cm); - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - // updateDisplay_W2 will use these properties to do the actual resizing - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - cm.display.sizerWidth = op.adjustWidthTo; - op.barMeasure.scrollWidth = - Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); - } - - if (op.updatedDisplay || op.selectionChanged) - op.preparedSelection = display.input.prepareSelection(); - } - - function endOperation_W2(op) { - var cm = op.cm; - - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) - setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); - cm.display.maxLineChanged = false; - } - - if (op.preparedSelection) - cm.display.input.showSelection(op.preparedSelection); - if (op.updatedDisplay) - setDocumentHeight(cm, op.barMeasure); - if (op.updatedDisplay || op.startHeight != cm.doc.height) - updateScrollbars(cm, op.barMeasure); - - if (op.selectionChanged) restartBlink(cm); - - if (cm.state.focused && op.updateInput) - cm.display.input.reset(op.typing); - if (op.focus && op.focus == activeElt()) ensureFocus(op.cm); - } - - function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc; - - if (op.updatedDisplay) postUpdateDisplay(cm, op.update); - - // Abort mouse wheel delta measurement, when scrolling explicitly - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - display.wheelStartX = display.wheelStartY = null; - - // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { - doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); - display.scrollbars.setScrollTop(doc.scrollTop); - display.scroller.scrollTop = doc.scrollTop; - } - if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { - doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - displayWidth(cm), op.scrollLeft)); - display.scrollbars.setScrollLeft(doc.scrollLeft); - display.scroller.scrollLeft = doc.scrollLeft; - alignHorizontally(cm); - } - // If we need to scroll a specific position into view, do so. - if (op.scrollToPos) { - var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); - } - - // Fire events for markers that are hidden/unidden by editing or - // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; - if (hidden) for (var i = 0; i < hidden.length; ++i) - if (!hidden[i].lines.length) signal(hidden[i], "hide"); - if (unhidden) for (var i = 0; i < unhidden.length; ++i) - if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); - - if (display.wrapper.offsetHeight) - doc.scrollTop = cm.display.scroller.scrollTop; - - // Fire change events, and delayed event handlers - if (op.changeObjs) - signal(cm, "changes", cm, op.changeObjs); - if (op.update) - op.update.finish(); - } - - // Run the given function in an operation - function runInOp(cm, f) { - if (cm.curOp) return f(); - startOperation(cm); - try { return f(); } - finally { endOperation(cm); } - } - // Wraps a function in an operation. Returns the wrapped function. - function operation(cm, f) { - return function() { - if (cm.curOp) return f.apply(cm, arguments); - startOperation(cm); - try { return f.apply(cm, arguments); } - finally { endOperation(cm); } - }; - } - // Used to add methods to editor and doc instances, wrapping them in - // operations. - function methodOp(f) { - return function() { - if (this.curOp) return f.apply(this, arguments); - startOperation(this); - try { return f.apply(this, arguments); } - finally { endOperation(this); } - }; - } - function docMethodOp(f) { - return function() { - var cm = this.cm; - if (!cm || cm.curOp) return f.apply(this, arguments); - startOperation(cm); - try { return f.apply(this, arguments); } - finally { endOperation(cm); } - }; - } - - // VIEW TRACKING - - // These objects are used to represent the visible (currently drawn) - // part of the document. A LineView may correspond to multiple - // logical lines, if those are connected by collapsed ranges. - function LineView(doc, line, lineN) { - // The starting line - this.line = line; - // Continuing lines, if any - this.rest = visualLineContinued(line); - // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - - // Create a range of LineView objects for the given lines. - function buildViewArray(cm, from, to) { - var array = [], nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array; - } - - // Updates the display.view data structure for a given change to the - // document. From and to are in pre-change coordinates. Lendiff is - // the amount of lines added or subtracted by the change. This is - // used for changes that span multiple lines, or change the way - // lines are divided into visual lines. regLineChange (below) - // registers single-line changes. - function regChange(cm, from, to, lendiff) { - if (from == null) from = cm.doc.first; - if (to == null) to = cm.doc.first + cm.doc.size; - if (!lendiff) lendiff = 0; - - var display = cm.display; - if (lendiff && to < display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers > from)) - display.updateLineNumbers = from; - - cm.curOp.viewChanged = true; - - if (from >= display.viewTo) { // Change after - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - resetView(cm); - } else if (to <= display.viewFrom) { // Change before - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm); - } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { // Bottom overlap - var cut = viewCuttingPoint(cm, from, from, -1); - if (cut) { - display.view = display.view.slice(0, cut.index); - display.viewTo = cut.lineN; - } else { - resetView(cm); - } - } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index) - .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) - ext.lineN += lendiff; - else if (from < ext.lineN + ext.size) - display.externalMeasured = null; - } - } - - // Register a change to a single line. Type must be one of "text", - // "gutter", "class", "widget" - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - display.externalMeasured = null; - - if (line < display.viewFrom || line >= display.viewTo) return; - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) return; - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) arr.push(type); - } - - // Clear the view. - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; - } - - // Find the view element corresponding to a given line. Return null - // when the line isn't visible. - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) return null; - n -= cm.display.viewFrom; - if (n < 0) return null; - var view = cm.display.view; - for (var i = 0; i < view.length; i++) { - n -= view[i].size; - if (n < 0) return i; - } - } - - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) - return {index: index, lineN: newN}; - for (var i = 0, n = cm.display.viewFrom; i < index; i++) - n += view[i].size; - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) return null; - diff = (n + view[index].size) - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) return null; - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; - } - return {index: index, lineN: newN}; - } - - // Force the view to cover a given range, adding empty view element - // or clipping off existing ones as needed. - function adjustView(cm, from, to) { - var display = cm.display, view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) - display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); - else if (display.viewFrom < from) - display.view = display.view.slice(findViewIndex(cm, from)); - display.viewFrom = from; - if (display.viewTo < to) - display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); - else if (display.viewTo > to) - display.view = display.view.slice(0, findViewIndex(cm, to)); - } - display.viewTo = to; - } - - // Count the number of lines in the view whose DOM representation is - // out of date (or nonexistent). - function countDirtyView(cm) { - var view = cm.display.view, dirty = 0; - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; - } - return dirty; - } - - // EVENT HANDLERS - - // Attach the necessary event handlers when initializing the editor - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - // Older IE's will not fire a second mousedown for a double click - if (ie && ie_version < 11) - on(d.scroller, "dblclick", operation(cm, function(e) { - if (signalDOMEvent(cm, e)) return; - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); - else - on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); - // Some browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for these browsers. - if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); - - // Used to suppress mouse event handling when a touch happens - var touchFinished, prevTouch = {end: 0}; - function finishTouch() { - if (d.activeTouch) { - touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000); - prevTouch = d.activeTouch; - prevTouch.end = +new Date; - } - }; - function isMouseLikeTouchEvent(e) { - if (e.touches.length != 1) return false; - var touch = e.touches[0]; - return touch.radiusX <= 1 && touch.radiusY <= 1; - } - function farAway(touch, other) { - if (other.left == null) return true; - var dx = other.left - touch.left, dy = other.top - touch.top; - return dx * dx + dy * dy > 20 * 20; - } - on(d.scroller, "touchstart", function(e) { - if (!isMouseLikeTouchEvent(e)) { - clearTimeout(touchFinished); - var now = +new Date; - d.activeTouch = {start: now, moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null}; - if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX; - d.activeTouch.top = e.touches[0].pageY; - } - } - }); - on(d.scroller, "touchmove", function() { - if (d.activeTouch) d.activeTouch.moved = true; - }); - on(d.scroller, "touchend", function(e) { - var touch = d.activeTouch; - if (touch && !eventInWidget(d, e) && touch.left != null && - !touch.moved && new Date - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), range; - if (!touch.prev || farAway(touch, touch.prev)) // Single tap - range = new Range(pos, pos); - else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap - range = cm.findWordAt(pos); - else // Triple tap - range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); - cm.setSelection(range.anchor, range.head); - cm.focus(); - e_preventDefault(e); - } - finishTouch(); - }); - on(d.scroller, "touchcancel", finishTouch); - - // Sync scrolling between fake scrollbars and real scrollable - // area, ensure viewport is updated when scrolling. - on(d.scroller, "scroll", function() { - if (d.scroller.clientHeight) { - setScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - - // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); - on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); - - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - - d.dragFunctions = { - simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);}, - start: function(e){onDragStart(cm, e);}, - drop: operation(cm, onDrop) - }; - - var inp = d.input.getField(); - on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); - on(inp, "keydown", operation(cm, onKeyDown)); - on(inp, "keypress", operation(cm, onKeyPress)); - on(inp, "focus", bind(onFocus, cm)); - on(inp, "blur", bind(onBlur, cm)); - } - - function dragDropChanged(cm, value, old) { - var wasOn = old && old != CodeMirror.Init; - if (!value != !wasOn) { - var funcs = cm.display.dragFunctions; - var toggle = value ? on : off; - toggle(cm.display.scroller, "dragstart", funcs.start); - toggle(cm.display.scroller, "dragenter", funcs.simple); - toggle(cm.display.scroller, "dragover", funcs.simple); - toggle(cm.display.scroller, "drop", funcs.drop); - } - } - - // Called when the window resizes - function onResize(cm) { - var d = cm.display; - if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) - return; - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.scrollbarsClipped = false; - cm.setSize(); - } - - // MOUSE EVENTS - - // Return true when the given mouse event happened in a widget - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || - (n.parentNode == display.sizer && n != display.mover)) - return true; - } - } - - // Given a mouse event, find the corresponding position. If liberal - // is false, it checks whether a gutter or scrollbar was clicked, - // and returns null if it was. forRect is used by rectangular - // selections, and tries to estimate a character position even for - // coordinates beyond the right of the text. - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") return null; - - var x, y, space = display.lineSpace.getBoundingClientRect(); - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top; } - catch (e) { return null; } - var coords = coordsChar(cm, x, y), line; - if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords; - } - - // A mouse down can be a single click, double click, triple click, - // start of selection drag, start of text drag, new cursor - // (ctrl-click), rectangle drag (alt-drag), or xwin - // middle-click-paste. Or it might be a click on something we should - // not interfere with, such as a scrollbar or widget. - function onMouseDown(e) { - var cm = this, display = cm.display; - if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return; - display.shift = e.shiftKey; - - if (eventInWidget(display, e)) { - if (!webkit) { - // Briefly turn off draggability, to allow widgets to do - // normal dragging things. - display.scroller.draggable = false; - setTimeout(function(){display.scroller.draggable = true;}, 100); - } - return; - } - if (clickInGutter(cm, e)) return; - var start = posFromMouse(cm, e); - window.focus(); - - switch (e_button(e)) { - case 1: - if (start) - leftButtonDown(cm, e, start); - else if (e_target(e) == display.scroller) - e_preventDefault(e); - break; - case 2: - if (webkit) cm.state.lastMiddleDown = +new Date; - if (start) extendSelection(cm.doc, start); - setTimeout(function() {display.input.focus();}, 20); - e_preventDefault(e); - break; - case 3: - if (captureRightClick) onContextMenu(cm, e); - else delayBlurEvent(cm); - break; - } - } - - var lastClick, lastDoubleClick; - function leftButtonDown(cm, e, start) { - if (ie) setTimeout(bind(ensureFocus, cm), 0); - else cm.curOp.focus = activeElt(); - - var now = +new Date, type; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { - type = "triple"; - } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { - type = "double"; - lastDoubleClick = {time: now, pos: start}; - } else { - type = "single"; - lastClick = {time: now, pos: start}; - } - - var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; - if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && - type == "single" && (contained = sel.contains(start)) > -1 && - (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) && - (cmp(contained.to(), start) > 0 || start.xRel < 0)) - leftButtonStartDrag(cm, e, start, modifier); - else - leftButtonSelect(cm, e, start, type, modifier); - } - - // Start a text drag. When it ends, see if any dragging actually - // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, e, start, modifier) { - var display = cm.display, startTime = +new Date; - var dragEnd = operation(cm, function(e2) { - if (webkit) display.scroller.draggable = false; - cm.state.draggingText = false; - off(document, "mouseup", dragEnd); - off(display.scroller, "drop", dragEnd); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); - if (!modifier && +new Date - 200 < startTime) - extendSelection(cm.doc, start); - // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) - if (webkit || ie && ie_version == 9) - setTimeout(function() {document.body.focus(); display.input.focus();}, 20); - else - display.input.focus(); - } - }); - // Let the drag handler handle this. - if (webkit) display.scroller.draggable = true; - cm.state.draggingText = dragEnd; - // IE's approach to draggable - if (display.scroller.dragDrop) display.scroller.dragDrop(); - on(document, "mouseup", dragEnd); - on(display.scroller, "drop", dragEnd); - } - - // Normal selection, as opposed to text dragging. - function leftButtonSelect(cm, e, start, type, addNew) { - var display = cm.display, doc = cm.doc; - e_preventDefault(e); - - var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; - if (addNew && !e.shiftKey) { - ourIndex = doc.sel.contains(start); - if (ourIndex > -1) - ourRange = ranges[ourIndex]; - else - ourRange = new Range(start, start); - } else { - ourRange = doc.sel.primary(); - ourIndex = doc.sel.primIndex; - } - - if (e.altKey) { - type = "rect"; - if (!addNew) ourRange = new Range(start, start); - start = posFromMouse(cm, e, true, true); - ourIndex = -1; - } else if (type == "double") { - var word = cm.findWordAt(start); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, word.anchor, word.head); - else - ourRange = word; - } else if (type == "triple") { - var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, line.anchor, line.head); - else - ourRange = line; - } else { - ourRange = extendRange(doc, ourRange, start); - } - - if (!addNew) { - ourIndex = 0; - setSelection(doc, new Selection([ourRange], 0), sel_mouse); - startSel = doc.sel; - } else if (ourIndex == -1) { - ourIndex = ranges.length; - setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}); - } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { - setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); - startSel = doc.sel; - } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); - } - - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) return; - lastPos = pos; - - if (type == "rect") { - var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); - line <= end; line++) { - var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); - if (left == right) - ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); - else if (text.length > leftPos) - ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); - } - if (!ranges.length) ranges.push(new Range(start, start)); - setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var anchor = oldRange.anchor, head = pos; - if (type != "single") { - if (type == "double") - var range = cm.findWordAt(pos); - else - var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); - if (cmp(range.anchor, anchor) > 0) { - head = range.head; - anchor = minPos(oldRange.from(), range.anchor); - } else { - head = range.anchor; - anchor = maxPos(oldRange.to(), range.head); - } - } - var ranges = startSel.ranges.slice(0); - ranges[ourIndex] = new Range(clipPos(doc, anchor), head); - setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); - } - } - - var editorSize = display.wrapper.getBoundingClientRect(); - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0; - - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, type == "rect"); - if (!cur) return; - if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) - setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) setTimeout(operation(cm, function() { - if (counter != curCount) return; - display.scroller.scrollTop += outside; - extend(e); - }), 50); - } - } - - function done(e) { - counter = Infinity; - e_preventDefault(e); - display.input.focus(); - off(document, "mousemove", move); - off(document, "mouseup", up); - doc.history.lastSelOrigin = null; - } - - var move = operation(cm, function(e) { - if (!e_button(e)) done(e); - else extend(e); - }); - var up = operation(cm, done); - on(document, "mousemove", move); - on(document, "mouseup", up); - } - - // Determines whether an event happened in the gutter, and fires the - // handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent, signalfn) { - try { var mX = e.clientX, mY = e.clientY; } - catch(e) { return false; } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; - if (prevent) e_preventDefault(e); - - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - - if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); - mY -= lineBox.top - display.viewOffset; - - for (var i = 0; i < cm.options.gutters.length; ++i) { - var g = display.gutters.childNodes[i]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.options.gutters[i]; - signalfn(cm, type, cm, line, gutter, e); - return e_defaultPrevented(e); - } - } - } - - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true, signalLater); - } - - // Kludge to work around strange IE behavior where it'll sometimes - // re-fire a series of drag-related events right after the drop (#1551) - var lastDrop = 0; - - function onDrop(e) { - var cm = this; - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) - return; - e_preventDefault(e); - if (ie) lastDrop = +new Date; - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || isReadOnly(cm)) return; - // Might be a file drop, in which case we simply extract the text - // and insert it. - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0; - var loadFile = function(file, i) { - var reader = new FileReader; - reader.onload = operation(cm, function() { - text[i] = reader.result; - if (++read == n) { - pos = clipPos(cm.doc, pos); - var change = {from: pos, to: pos, - text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), - origin: "paste"}; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); - } - }); - reader.readAsText(file); - }; - for (var i = 0; i < n; ++i) loadFile(files[i], i); - } else { // Normal drop - // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - // Ensure the editor is re-focused - setTimeout(function() {cm.display.input.focus();}, 20); - return; - } - try { - var text = e.dataTransfer.getData("Text"); - if (text) { - if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey)) - var selected = cm.listSelections(); - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) for (var i = 0; i < selected.length; ++i) - replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); - cm.replaceSelection(text, "around", "paste"); - cm.display.input.focus(); - } - } - catch(e){} - } - } - - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; - - e.dataTransfer.setData("Text", cm.getSelection()); - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) img.parentNode.removeChild(img); - } - } - - // SCROLL EVENTS - - // Sync the scrollable area and scrollbars, ensure the viewport - // covers the visible area. - function setScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) return; - cm.doc.scrollTop = val; - if (!gecko) updateDisplaySimple(cm, {top: val}); - if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; - cm.display.scrollbars.setScrollTop(val); - if (gecko) updateDisplaySimple(cm); - startWorker(cm, 100); - } - // Sync scroller and scrollbar, ensure the gutter elements are - // aligned. - function setScrollLeft(cm, val, isScroller) { - if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; - val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; - cm.display.scrollbars.setScrollLeft(val); - } - - // Since the delta values reported on mouse wheel events are - // unstandardized between browsers and even browser versions, and - // generally horribly unpredictable, this code starts by measuring - // the scroll effect that the first few mouse wheel events have, - // and, from that, detects the way it can convert deltas to pixel - // offsets afterwards. - // - // The reason we want to know the amount a wheel event will scroll - // is that it gives us a chance to update the display before the - // actual scrolling happens, reducing flickering. - - var wheelSamples = 0, wheelPixelsPerUnit = null; - // Fill in a browser-detected starting value on browsers where we - // know one. These don't have to be accurate -- the result of them - // being wrong would just be a slight flicker on the first wheel - // scroll (if it is large enough). - if (ie) wheelPixelsPerUnit = -.53; - else if (gecko) wheelPixelsPerUnit = 15; - else if (chrome) wheelPixelsPerUnit = -.7; - else if (safari) wheelPixelsPerUnit = -1/3; - - var wheelEventDelta = function(e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; - else if (dy == null) dy = e.wheelDelta; - return {x: dx, y: dy}; - }; - CodeMirror.wheelEventPixels = function(e) { - var delta = wheelEventDelta(e); - delta.x *= wheelPixelsPerUnit; - delta.y *= wheelPixelsPerUnit; - return delta; - }; - - function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; - - var display = cm.display, scroll = display.scroller; - // Quit if there's nothing to scroll here - if (!(dx && scroll.scrollWidth > scroll.clientWidth || - dy && scroll.scrollHeight > scroll.clientHeight)) return; - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur; - break outer; - } - } - } - } - - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { - if (dy) - setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); - setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); - e_preventDefault(e); - display.wheelStartX = null; // Abort measurement, if in progress - return; - } - - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && wheelPixelsPerUnit != null) { - var pixels = dy * wheelPixelsPerUnit; - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; - if (pixels < 0) top = Math.max(0, top + pixels - 50); - else bot = Math.min(cm.doc.height, bot + pixels + 50); - updateDisplaySimple(cm, {top: top, bottom: bot}); - } - - if (wheelSamples < 20) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; display.wheelDY = dy; - setTimeout(function() { - if (display.wheelStartX == null) return; - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX); - display.wheelStartX = display.wheelStartY = null; - if (!sample) return; - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; display.wheelDY += dy; - } - } - } - - // KEY EVENTS - - // Run a handler that was bound to a key. - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) return false; - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - cm.display.input.ensurePolled(); - var prevShift = cm.display.shift, done = false; - try { - if (isReadOnly(cm)) cm.state.suppressEdits = true; - if (dropShift) cm.display.shift = false; - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done; - } - - function lookupKeyForEditor(cm, name, handle) { - for (var i = 0; i < cm.state.keyMaps.length; i++) { - var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); - if (result) return result; - } - return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) - || lookupKey(name, cm.options.keyMap, handle, cm); - } - - var stopSeq = new Delayed; - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq; - if (seq) { - if (isModifierKey(name)) return "handled"; - stopSeq.set(50, function() { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null; - cm.display.input.reset(); - } - }); - name = seq + " " + name; - } - var result = lookupKeyForEditor(cm, name, handle); - - if (result == "multi") - cm.state.keySeq = name; - if (result == "handled") - signalLater(cm, "keyHandled", cm, name, e); - - if (result == "handled" || result == "multi") { - e_preventDefault(e); - restartBlink(cm); - } - - if (seq && !result && /\'$/.test(name)) { - e_preventDefault(e); - return true; - } - return !!result; - } - - // Handle a key from the keydown event. - function handleKeyBinding(cm, e) { - var name = keyName(e, true); - if (!name) return false; - - if (e.shiftKey && !cm.state.keySeq) { - // First try to resolve full name (including 'Shift-'). Failing - // that, see if there is a cursor-motion command (starting with - // 'go') bound to the keyname without 'Shift-'. - return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) - || dispatchKey(cm, name, e, function(b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) - return doHandleBinding(cm, b); - }); - } else { - return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); - } - } - - // Handle a key from the keypress event - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, - function(b) { return doHandleBinding(cm, b, true); }); - } - - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - cm.curOp.focus = activeElt(); - if (signalDOMEvent(cm, e)) return; - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - cm.replaceSelection("", null, "cut"); - } - - // Turn mouse into crosshair when Alt is held on Mac. - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - showCrossHair(cm); - } - - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - on(document, "keyup", up); - on(document, "mouseover", up); - } - - function onKeyUp(e) { - if (e.keyCode == 16) this.doc.sel.shift = false; - signalDOMEvent(this, e); - } - - function onKeyPress(e) { - var cm = this; - if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; - var keyCode = e.keyCode, charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} - if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return; - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (handleCharBinding(cm, e, ch)) return; - cm.display.input.onKeyPress(e); - } - - // FOCUS/BLUR EVENTS - - function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true; - setTimeout(function() { - if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false; - onBlur(cm); - } - }, 100); - } - - function onFocus(cm) { - if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; - - if (cm.options.readOnly == "nocursor") return; - if (!cm.state.focused) { - signal(cm, "focus", cm); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - // This test prevents this from firing when a context - // menu is closed (since the input reset would kill the - // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset(); - if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730 - } - cm.display.input.receivedFocus(); - } - restartBlink(cm); - } - function onBlur(cm) { - if (cm.state.delayingBlurEvent) return; - - if (cm.state.focused) { - signal(cm, "blur", cm); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); - } - - // CONTEXT MENU HANDLING - - // To make the context menu work, we need to briefly unhide the - // textarea (making it as unobtrusive as possible) to let the - // right-click take effect on it. - function onContextMenu(cm, e) { - if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return; - cm.display.input.onContextMenu(e); - } - - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) return false; - return gutterEvent(cm, e, "gutterContextMenu", false, signal); - } - - // UPDATING - - // Compute the position of the end of a change (its 'to' property - // refers to the pre-change end). - var changeEnd = CodeMirror.changeEnd = function(change) { - if (!change.text) return change.to; - return Pos(change.from.line + change.text.length - 1, - lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); - }; - - // Adjust a position to refer to the post-change position of the - // same text, or the end of the change if the change covers it. - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) return pos; - if (cmp(pos, change.to) <= 0) return changeEnd(change); - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; - if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; - return Pos(line, ch); - } - - function computeSelAfterChange(doc, change) { - var out = []; - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))); - } - return normalizeSelection(out, doc.sel.primIndex); - } - - function offsetPos(pos, old, nw) { - if (pos.line == old.line) - return Pos(nw.line, pos.ch - old.ch + nw.ch); - else - return Pos(nw.line + (pos.line - old.line), pos.ch); - } - - // Used by replaceSelections to allow moving the selection to the - // start or around the replaced test. Hint may be "start" or "around". - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; - out[i] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i] = new Range(from, from); - } - } - return new Selection(out, doc.sel.primIndex); - } - - // Allow "beforeChange" event handlers to influence a change - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function() { this.canceled = true; } - }; - if (update) obj.update = function(from, to, text, origin) { - if (from) this.from = clipPos(doc, from); - if (to) this.to = clipPos(doc, to); - if (text) this.text = text; - if (origin !== undefined) this.origin = origin; - }; - signal(doc, "beforeChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); - - if (obj.canceled) return null; - return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; - } - - // Apply a change to a document, and add it to the document's - // history, and propagating it to all linked documents. - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); - if (doc.cm.state.suppressEdits) return; - } - - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) return; - } - - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i = split.length - 1; i >= 0; --i) - makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); - } else { - makeChangeInner(doc, change); - } - } - - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); - }); - } - - // Revert a change stored in a document's history. - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - if (doc.cm && doc.cm.state.suppressEdits) return; - - var hist = doc.history, event, selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; - - // Verify that there is a useable event (so that ctrl-z won't - // needlessly clear selection events) - for (var i = 0; i < source.length; i++) { - event = source[i]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) - break; - } - if (i == source.length) return; - hist.lastOrigin = hist.lastSelOrigin = null; - - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}); - return; - } - selAfter = event; - } - else break; - } - - // Build up a reverse change object to add to the opposite history - // stack (redo when undoing, and vice versa). - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({changes: antiChanges, generation: hist.generation}); - hist.generation = event.generation || ++hist.maxGeneration; - - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - - for (var i = event.changes.length - 1; i >= 0; --i) { - var change = event.changes[i]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return; - } - - antiChanges.push(historyChangeFromChange(doc, change)); - - var after = i ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); - var rebased = []; - - // Propagate to the linked documents - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); - }); - } - } - - // Sub-views need their line numbers shifted when text is added - // above or below them in the parent document. - function shiftDoc(doc, distance) { - if (distance == 0) return; - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function(range) { - return new Range(Pos(range.anchor.line + distance, range.anchor.ch), - Pos(range.head.line + distance, range.head.ch)); - }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - regLineChange(doc.cm, l, "gutter"); - } - } - - // More lower-level change function, handling only a single document - // (not linked ones). - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) - return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); - - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return; - } - if (change.from.line > doc.lastLine()) return; - - // Clip the change to the size of this doc - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin}; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin}; - } - - change.removed = getBetween(doc, change.from, change.to); - - if (!selAfter) selAfter = computeSelAfterChange(doc, change); - if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); - else updateDoc(doc, change, spans); - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - } - - // Handle the interaction of a change to a document with the editor - // that this document is part of. - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function(line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true; - } - }); - } - - if (doc.sel.contains(change.from, change.to) > -1) - signalCursorActivity(cm); - - updateDoc(doc, change, spans, estimateHeight(cm)); - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function(line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) cm.curOp.updateMaxLine = true; - } - - // Adjust frontier, schedule worker - doc.frontier = Math.min(doc.frontier, from.line); - startWorker(cm, 400); - - var lendiff = change.text.length - (to.line - from.line) - 1; - // Remember that these lines changed, for updating the display - if (change.full) - regChange(cm); - else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - regLineChange(cm, from.line, "text"); - else - regChange(cm, from.line, to.line + 1, lendiff); - - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) signalLater(cm, "change", cm, obj); - if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); - } - cm.display.selForContextMenu = null; - } - - function replaceRange(doc, code, from, to, origin) { - if (!to) to = from; - if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } - if (typeof code == "string") code = doc.splitLines(code); - makeChange(doc, {from: from, to: to, text: code, origin: origin}); - } - - // SCROLLING THINGS INTO VIEW - - // If an editor sits on the top or bottom of the window, partially - // scrolled out of view, this ensures that the cursor is visible. - function maybeScrollWindow(cm, coords) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) return; - - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; - if (coords.top + box.top < 0) doScroll = true; - else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + - (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + - (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " + - coords.left + "px; width: 2px;"); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - - // Scroll a given position into view (immediately), verifying that - // it actually became visible (as line heights are accurately - // measured, the position of something may 'drift' during drawing). - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) margin = 0; - for (var limit = 0; limit < 5; limit++) { - var changed = false, coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), - Math.min(coords.top, endCoords.top) - margin, - Math.max(coords.left, endCoords.left), - Math.max(coords.bottom, endCoords.bottom) + margin); - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - setScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; - } - if (!changed) break; - } - return coords; - } - - // Scroll a given set of coordinates into view (immediately). - function scrollIntoView(cm, x1, y1, x2, y2) { - var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); - if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); - if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); - } - - // Calculate a new scroll position needed to scroll the given - // rectangle into view. Returns an object with scrollTop and - // scrollLeft properties. When these are undefined, the - // vertical/horizontal position does not need to be adjusted. - function calculateScrollPos(cm, x1, y1, x2, y2) { - var display = cm.display, snapMargin = textHeight(cm.display); - if (y1 < 0) y1 = 0; - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen = displayHeight(cm), result = {}; - if (y2 - y1 > screen) y2 = y1 + screen; - var docBottom = cm.doc.height + paddingVert(display); - var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; - if (y1 < screentop) { - result.scrollTop = atTop ? 0 : y1; - } else if (y2 > screentop + screen) { - var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); - if (newTop != screentop) result.scrollTop = newTop; - } - - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; - var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); - var tooWide = x2 - x1 > screenw; - if (tooWide) x2 = x1 + screenw; - if (x1 < 10) - result.scrollLeft = 0; - else if (x1 < screenleft) - result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); - else if (x2 > screenw + screenleft - 3) - result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; - return result; - } - - // Store a relative adjustment to the scroll position in the current - // operation (to be applied when the operation finishes). - function addToScrollPos(cm, left, top) { - if (left != null || top != null) resolveScrollToPos(cm); - if (left != null) - cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; - if (top != null) - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; - } - - // Make sure that at the end of the operation the current cursor is - // shown. - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(), from = cur, to = cur; - if (!cm.options.lineWrapping) { - from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; - to = Pos(cur.line, cur.ch + 1); - } - cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; - } - - // When an operation has its scrollToPos property set, and another - // scroll action is applied before the end of the operation, this - // 'simulates' scrolling that position into view in a cheap way, so - // that the effect of intermediate scroll commands is not ignored. - function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos; - if (range) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); - var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), - Math.min(from.top, to.top) - range.margin, - Math.max(from.right, to.right), - Math.max(from.bottom, to.bottom) + range.margin); - cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - } - - // API UTILITIES - - // Indent the given line. The how parameter can be "smart", - // "add"/null, "subtract", or "prev". When aggressive is false - // (typically set to true for forced single-line indents), empty - // lines are not indented, and places where the mode returns Pass - // are left alone. - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state; - if (how == null) how = "add"; - if (how == "smart") { - // Fall back to "prev" when the mode doesn't have an indentation - // method. - if (!doc.mode.indent) how = "prev"; - else state = getStateBefore(cm, n); - } - - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) line.stateAfter = null; - var curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) return; - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); - else indentation = 0; - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - - var indentString = "", pos = 0; - if (cm.options.indentWithTabs) - for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} - if (pos < indentation) indentString += spaceStr(indentation - pos); - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - line.stateAfter = null; - return true; - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i, new Range(pos, pos)); - break; - } - } - } - } - - // Utility for applying a change to a line by handle or number, - // returning the number and optionally registering the line as - // changed. - function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle; - if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); - else no = lineNo(handle); - if (no == null) return null; - if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); - return line; - } - - // Helper for deleting text near the selection(s), used to implement - // backspace, delete, and similar functionality. - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = []; - // Build up a set of ranges to kill first, merging overlapping - // ranges. - for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break; - } - } - kill.push(toKill); - } - // Next, remove those actual ranges. - runInOp(cm, function() { - for (var i = kill.length - 1; i >= 0; i--) - replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); - ensureCursorVisible(cm); - }); - } - - // Used for horizontal relative motion. Dir is -1 or 1 (left or - // right), unit can be "char", "column" (like char, but doesn't - // cross line boundaries), "word" (across next word), or "group" (to - // the start of next group of word or non-word-non-whitespace - // chars). The visually param controls whether, in right-to-left - // text, direction 1 means to move towards the next index in the - // string, or towards the character to the right of the current - // position. The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosH(doc, pos, dir, unit, visually) { - var line = pos.line, ch = pos.ch, origDir = dir; - var lineObj = getLine(doc, line); - var possible = true; - function findNextLine() { - var l = line + dir; - if (l < doc.first || l >= doc.first + doc.size) return (possible = false); - line = l; - return lineObj = getLine(doc, l); - } - function moveOnce(boundToLine) { - var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); - if (next == null) { - if (!boundToLine && findNextLine()) { - if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); - else ch = dir < 0 ? lineObj.text.length : 0; - } else return (possible = false); - } else ch = next; - return true; - } - - if (unit == "char") moveOnce(); - else if (unit == "column") moveOnce(true); - else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) break; - var cur = lineObj.text.charAt(ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" - : group && cur == "\n" ? "n" - : !group || /\s/.test(cur) ? null - : "p"; - if (group && !first && !type) type = "s"; - if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce();} - break; - } - - if (type) sawType = type; - if (dir > 0 && !moveOnce(!first)) break; - } - } - var result = skipAtomic(doc, Pos(line, ch), origDir, true); - if (!possible) result.hitSide = true; - return result; - } - - // For relative vertical movement. Dir may be -1 or 1. Unit can be - // "page" or "line". The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - for (;;) { - var target = coordsChar(cm, x, y); - if (!target.outside) break; - if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } - y += dir * 5; - } - return target; - } - - // EDITOR METHODS - - // The publicly visible API. Note that methodOp(f) means - // 'wrap f in an operation, performed on its `this` parameter'. - - // This is not the complete set of editor methods. Most of the - // methods defined on the Doc type are also injected into - // CodeMirror.prototype, for backwards compatibility and - // convenience. - - CodeMirror.prototype = { - constructor: CodeMirror, - focus: function(){window.focus(); this.display.input.focus();}, - - setOption: function(option, value) { - var options = this.options, old = options[option]; - if (options[option] == value && option != "mode") return; - options[option] = value; - if (optionHandlers.hasOwnProperty(option)) - operation(this, optionHandlers[option])(this, value, old); - }, - - getOption: function(option) {return this.options[option];}, - getDoc: function() {return this.doc;}, - - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); - }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps; - for (var i = 0; i < maps.length; ++i) - if (maps[i] == map || maps[i].name == map) { - maps.splice(i, 1); - return true; - } - }, - - addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); - if (mode.startState) throw new Error("Overlays may not be stateful."); - this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function(spec) { - var overlays = this.state.overlays; - for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1); - this.state.modeGen++; - regChange(this); - return; - } - } - }), - - indentLine: methodOp(function(n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; - else dir = dir ? "add" : "subtract"; - } - if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); - }), - indentSelection: methodOp(function(how) { - var ranges = this.doc.sel.ranges, end = -1; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) { - var from = range.from(), to = range.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) - indentLine(this, j, how); - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); - } else if (range.head.line > end) { - indentLine(this, range.head.line, how, true); - end = range.head.line; - if (i == this.doc.sel.primIndex) ensureCursorVisible(this); - } - } - }), - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos, precise) { - return takeToken(this, pos, precise); - }, - - getLineTokens: function(line, precise) { - return takeToken(this, Pos(line), precise, true); - }, - - getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; - var type; - if (ch == 0) type = styles[2]; - else for (;;) { - var mid = (before + after) >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; - else if (styles[mid * 2 + 1] < ch) before = mid + 1; - else { type = styles[mid * 2 + 2]; break; } - } - var cut = type ? type.indexOf("cm-overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); - }, - - getModeAt: function(pos) { - var mode = this.doc.mode; - if (!mode.innerMode) return mode; - return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; - }, - - getHelper: function(pos, type) { - return this.getHelpers(pos, type)[0]; - }, - - getHelpers: function(pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) return found; - var help = helpers[type], mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) found.push(help[mode[type]]); - } else if (mode[type]) { - for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]]; - if (val) found.push(val); - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i = 0; i < help._global.length; i++) { - var cur = help._global[i]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) - found.push(cur.val); - } - return found; - }, - - getStateAfter: function(line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); - return getStateBefore(this, line + 1, precise); - }, - - cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary(); - if (start == null) pos = range.head; - else if (typeof start == "object") pos = clipPos(this.doc, start); - else pos = start ? range.from() : range.to(); - return cursorCoords(this, pos, mode || "page"); - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page"); - }, - - coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top); - }, - - lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset); - }, - heightAtLine: function(line, mode) { - var end = false, lineObj; - if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) line = this.doc.first; - else if (line > last) { line = last; end = true; } - lineObj = getLine(this.doc, line); - } else { - lineObj = line; - } - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + - (end ? this.doc.height - heightAtLine(lineObj) : 0); - }, - - defaultTextHeight: function() { return textHeight(this.display); }, - defaultCharWidth: function() { return charWidth(this.display); }, - - setGutterMarker: methodOp(function(line, gutterID, value) { - return changeLine(this.doc, line, "gutter", function(line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) line.gutterMarkers = null; - return true; - }); - }), - - clearGutter: methodOp(function(gutterID) { - var cm = this, doc = cm.doc, i = doc.first; - doc.iter(function(line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - line.gutterMarkers[gutterID] = null; - regLineChange(cm, i, "gutter"); - if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; - } - ++i; - }); - }), - - lineInfo: function(line) { - if (typeof line == "number") { - if (!isLine(this.doc, line)) return null; - var n = line; - line = getLine(this.doc, line); - if (!line) return null; - } else { - var n = lineNo(line); - if (n == null) return null; - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets}; - }, - - getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, left = pos.left; - node.style.position = "absolute"; - node.setAttribute("cm-ignore-events", "true"); - this.display.input.setUneditable(node); - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - // Default to positioning above (if specified and possible); otherwise default to positioning below - if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - top = pos.top - node.offsetHeight; - else if (pos.bottom + node.offsetHeight <= vspace) - top = pos.bottom; - if (left + node.offsetWidth > hspace) - left = hspace - node.offsetWidth; - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") left = 0; - else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; - node.style.left = left + "px"; - } - if (scroll) - scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); - }, - - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - - execCommand: function(cmd) { - if (commands.hasOwnProperty(cmd)) - return commands[cmd](this); - }, - - triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), - - findPosH: function(from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) break; - } - return cur; - }, - - moveH: methodOp(function(dir, unit) { - var cm = this; - cm.extendSelectionsBy(function(range) { - if (cm.display.shift || cm.doc.extend || range.empty()) - return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); - else - return dir < 0 ? range.from() : range.to(); - }, sel_move); - }), - - deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc; - if (sel.somethingSelected()) - doc.replaceSelection("", null, "+delete"); - else - deleteNearSelection(this, function(range) { - var other = findPosH(doc, range.head, dir, unit, false); - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; - }); - }), - - findPosV: function(from, amount, unit, goalColumn) { - var dir = 1, x = goalColumn; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) x = coords.left; - else coords.left = x; - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) break; - } - return cur; - }, - - moveV: methodOp(function(dir, unit) { - var cm = this, doc = this.doc, goals = []; - var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function(range) { - if (collapse) - return dir < 0 ? range.from() : range.to(); - var headPos = cursorCoords(cm, range.head, "div"); - if (range.goalColumn != null) headPos.left = range.goalColumn; - goals.push(headPos.left); - var pos = findPosV(cm, headPos, dir, unit); - if (unit == "page" && range == doc.sel.primary()) - addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); - return pos; - }, sel_move); - if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) - doc.sel.ranges[i].goalColumn = goals[i]; - }), - - // Find the word at the given position (as returned by coordsChar). - findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text; - var start = pos.ch, end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) - ? function(ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} - : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; - while (start > 0 && check(line.charAt(start - 1))) --start; - while (end < line.length && check(line.charAt(end))) ++end; - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)); - }, - - toggleOverwrite: function(value) { - if (value != null && value == this.state.overwrite) return; - if (this.state.overwrite = !this.state.overwrite) - addClass(this.display.cursorDiv, "CodeMirror-overwrite"); - else - rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); - - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function() { return this.display.input.getField() == activeElt(); }, - - scrollTo: methodOp(function(x, y) { - if (x != null || y != null) resolveScrollToPos(this); - if (x != null) this.curOp.scrollLeft = x; - if (y != null) this.curOp.scrollTop = y; - }), - getScrollInfo: function() { - var scroller = this.display.scroller; - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), clientWidth: displayWidth(this)}; - }, - - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null}; - if (margin == null) margin = this.options.cursorScrollMargin; - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null}; - } else if (range.from == null) { - range = {from: range, to: null}; - } - if (!range.to) range.to = range.from; - range.margin = margin || 0; - - if (range.from.line != null) { - resolveScrollToPos(this); - this.curOp.scrollToPos = range; - } else { - var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), - Math.min(range.from.top, range.to.top) - range.margin, - Math.max(range.from.right, range.to.right), - Math.max(range.from.bottom, range.to.bottom) + range.margin); - this.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - }), - - setSize: methodOp(function(width, height) { - var cm = this; - function interpret(val) { - return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; - } - if (width != null) cm.display.wrapper.style.width = interpret(width); - if (height != null) cm.display.wrapper.style.height = interpret(height); - if (cm.options.lineWrapping) clearLineMeasurementCache(this); - var lineNo = cm.display.viewFrom; - cm.doc.iter(lineNo, cm.display.viewTo, function(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) - if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } - ++lineNo; - }); - cm.curOp.forceUpdate = true; - signal(cm, "refresh", this); - }), - - operation: function(f){return runInOp(this, f);}, - - refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) - estimateLineHeights(this); - signal(this, "refresh", this); - }), - - swapDoc: methodOp(function(doc) { - var old = this.doc; - old.cm = null; - attachDoc(this, doc); - clearCaches(this); - this.display.input.reset(); - this.scrollTo(doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old; - }), - - getInputField: function(){return this.display.input.getField();}, - getWrapperElement: function(){return this.display.wrapper;}, - getScrollerElement: function(){return this.display.scroller;}, - getGutterElement: function(){return this.display.gutters;} - }; - eventMixin(CodeMirror); - - // OPTION DEFAULTS - - // The default configuration options. - var defaults = CodeMirror.defaults = {}; - // Functions to run when options are changed. - var optionHandlers = CodeMirror.optionHandlers = {}; - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt; - if (handle) optionHandlers[name] = - notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; - } - - // Passed to option handlers when there is no old value. - var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function(cm, val) { - cm.setValue(val); - }, true); - option("mode", null, function(cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function(cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - option("lineSeparator", null, function(cm, val) { - cm.doc.lineSep = val; - if (!val) return; - var newBreaks = [], lineNo = cm.doc.first; - cm.doc.iter(function(line) { - for (var pos = 0;;) { - var found = line.text.indexOf(val, pos); - if (found == -1) break; - pos = found + val.length; - newBreaks.push(Pos(lineNo, found)); - } - lineNo++; - }); - for (var i = newBreaks.length - 1; i >= 0; i--) - replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) - }); - option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); - if (old != CodeMirror.Init) cm.refresh(); - }); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); - option("electricChars", true); - option("inputStyle", mobile ? "contenteditable" : "textarea", function() { - throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME - }, true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - - option("theme", "default", function(cm) { - themeChanged(cm); - guttersChanged(cm); - }, true); - option("keyMap", "default", function(cm, val, old) { - var next = getKeyMap(val); - var prev = old != CodeMirror.Init && getKeyMap(old); - if (prev && prev.detach) prev.detach(cm, next); - if (next.attach) next.attach(cm, prev || null); - }); - option("extraKeys", null); - - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("fixedGutter", true, function(cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true); - option("scrollbarStyle", "native", function(cm) { - initScrollbars(cm); - updateScrollbars(cm); - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); - }, true); - option("lineNumbers", false, function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("firstLineNumber", 1, guttersChanged, true); - option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); - option("showCursorWhenSelecting", false, updateSelection, true); - - option("resetSelectionOnContextMenu", true); - option("lineWiseCopyCut", true); - - option("readOnly", false, function(cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - cm.display.disabled = true; - } else { - cm.display.disabled = false; - if (!val) cm.display.input.reset(); - } - }); - option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); - option("dragDrop", true, dragDropChanged); - - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function(cm){cm.refresh();}, true); - option("maxHighlightLength", 10000, resetModeState, true); - option("moveInputWithCursor", true, function(cm, val) { - if (!val) cm.display.input.resetPosition(); - }); - - option("tabindex", null, function(cm, val) { - cm.display.input.getField().tabIndex = val || ""; - }); - option("autofocus", null); - - // MODE DEFINITION AND QUERYING - - // Known modes, by name and by MIME - var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - CodeMirror.defineMode = function(name, mode) { - if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - if (arguments.length > 2) - mode.dependencies = Array.prototype.slice.call(arguments, 2); - modes[name] = mode; - }; - - CodeMirror.defineMIME = function(mime, spec) { - mimeModes[mime] = spec; - }; - - // Given a MIME type, a {name, ...options} config object, or a name - // string, return a mode config object. - CodeMirror.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") found = {name: found}; - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return CodeMirror.resolveMode("application/xml"); - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; - }; - - // Given a mode spec (anything that resolveMode accepts), find and - // initialize an actual mode object. - CodeMirror.getMode = function(options, spec) { - var spec = CodeMirror.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) return CodeMirror.getMode(options, "text/plain"); - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) continue; - if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - if (spec.helperType) modeObj.helperType = spec.helperType; - if (spec.modeProps) for (var prop in spec.modeProps) - modeObj[prop] = spec.modeProps[prop]; - - return modeObj; - }; - - // Minimal default mode. - CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; - }); - CodeMirror.defineMIME("text/plain", "null"); - - // This can be used to attach properties to mode objects from - // outside the actual mode definition. - var modeExtensions = CodeMirror.modeExtensions = {}; - CodeMirror.extendMode = function(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - copyObj(properties, exts); - }; - - // EXTENSIONS - - CodeMirror.defineExtension = function(name, func) { - CodeMirror.prototype[name] = func; - }; - CodeMirror.defineDocExtension = function(name, func) { - Doc.prototype[name] = func; - }; - CodeMirror.defineOption = option; - - var initHooks = []; - CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; - - var helpers = CodeMirror.helpers = {}; - CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; - helpers[type][name] = value; - }; - CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value); - helpers[type]._global.push({pred: predicate, val: value}); - }; - - // MODE STATE HANDLING - - // Utility functions for working with state. Exported because nested - // modes need to do this for their inner modes. - - var copyState = CodeMirror.copyState = function(mode, state) { - if (state === true) return state; - if (mode.copyState) return mode.copyState(state); - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) val = val.concat([]); - nstate[n] = val; - } - return nstate; - }; - - var startState = CodeMirror.startState = function(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - }; - - // Given a mode and a state (for that mode), find the inner mode and - // state at the position that the state refers to. - CodeMirror.innerMode = function(mode, state) { - while (mode.innerMode) { - var info = mode.innerMode(state); - if (!info || info.mode == mode) break; - state = info.state; - mode = info.mode; - } - return info || {mode: mode, state: state}; - }; - - // STANDARD COMMANDS - - // Commands are parameter-less actions that can be performed on an - // editor, mostly used for keybindings. - var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, - singleSelection: function(cm) { - cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); - }, - killLine: function(cm) { - deleteNearSelection(cm, function(range) { - if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length; - if (range.head.ch == len && range.head.line < cm.lastLine()) - return {from: range.head, to: Pos(range.head.line + 1, 0)}; - else - return {from: range.head, to: Pos(range.head.line, len)}; - } else { - return {from: range.from(), to: range.to()}; - } - }); - }, - deleteLine: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), - to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; - }); - }, - delLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), to: range.from()}; - }); - }, - delWrappedLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var leftPos = cm.coordsChar({left: 0, top: top}, "div"); - return {from: leftPos, to: range.from()}; - }); - }, - delWrappedLineRight: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - return {from: range.from(), to: rightPos }; - }); - }, - undo: function(cm) {cm.undo();}, - redo: function(cm) {cm.redo();}, - undoSelection: function(cm) {cm.undoSelection();}, - redoSelection: function(cm) {cm.redoSelection();}, - goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, - goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, - goLineStart: function(cm) { - cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, - {origin: "+move", bias: 1}); - }, - goLineStartSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - return lineStartSmart(cm, range.head); - }, {origin: "+move", bias: 1}); - }, - goLineEnd: function(cm) { - cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, - {origin: "+move", bias: -1}); - }, - goLineRight: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - }, sel_move); - }, - goLineLeft: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: 0, top: top}, "div"); - }, sel_move); - }, - goLineLeftSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var pos = cm.coordsChar({left: 0, top: top}, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); - return pos; - }, sel_move); - }, - goLineUp: function(cm) {cm.moveV(-1, "line");}, - goLineDown: function(cm) {cm.moveV(1, "line");}, - goPageUp: function(cm) {cm.moveV(-1, "page");}, - goPageDown: function(cm) {cm.moveV(1, "page");}, - goCharLeft: function(cm) {cm.moveH(-1, "char");}, - goCharRight: function(cm) {cm.moveH(1, "char");}, - goColumnLeft: function(cm) {cm.moveH(-1, "column");}, - goColumnRight: function(cm) {cm.moveH(1, "column");}, - goWordLeft: function(cm) {cm.moveH(-1, "word");}, - goGroupRight: function(cm) {cm.moveH(1, "group");}, - goGroupLeft: function(cm) {cm.moveH(-1, "group");}, - goWordRight: function(cm) {cm.moveH(1, "word");}, - delCharBefore: function(cm) {cm.deleteH(-1, "char");}, - delCharAfter: function(cm) {cm.deleteH(1, "char");}, - delWordBefore: function(cm) {cm.deleteH(-1, "word");}, - delWordAfter: function(cm) {cm.deleteH(1, "word");}, - delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, - delGroupAfter: function(cm) {cm.deleteH(1, "group");}, - indentAuto: function(cm) {cm.indentSelection("smart");}, - indentMore: function(cm) {cm.indentSelection("add");}, - indentLess: function(cm) {cm.indentSelection("subtract");}, - insertTab: function(cm) {cm.replaceSelection("\t");}, - insertSoftTab: function(cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); - } - cm.replaceSelections(spaces); - }, - defaultTab: function(cm) { - if (cm.somethingSelected()) cm.indentSelection("add"); - else cm.execCommand("insertTab"); - }, - transposeChars: function(cm) { - runInOp(cm, function() { - var ranges = cm.listSelections(), newSel = []; - for (var i = 0; i < ranges.length; i++) { - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) - cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + - prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); - }, - newlineAndIndent: function(cm) { - runInOp(cm, function() { - var len = cm.listSelections().length; - for (var i = 0; i < len; i++) { - var range = cm.listSelections()[i]; - cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input"); - cm.indentLine(range.from().line + 1, null, true); - ensureCursorVisible(cm); - } - }); - }, - toggleOverwrite: function(cm) {cm.toggleOverwrite();} - }; - - - // STANDARD KEYMAPS - - var keyMap = CodeMirror.keyMap = {}; - - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", - "Esc": "singleSelection" - }; - // Note that the save and find-related commands aren't defined by - // default. User code or addons can define them. Unknown commands - // are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", - "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", - fallthrough: "basic" - }; - // Very basic readline/emacs-style bindings, which are standard on Mac. - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", - "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", - fallthrough: ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - - // KEYMAP DISPATCH - - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/), name = parts[parts.length - 1]; - var alt, ctrl, shift, cmd; - for (var i = 0; i < parts.length - 1; i++) { - var mod = parts[i]; - if (/^(cmd|meta|m)$/i.test(mod)) cmd = true; - else if (/^a(lt)?$/i.test(mod)) alt = true; - else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true; - else if (/^s(hift)$/i.test(mod)) shift = true; - else throw new Error("Unrecognized modifier name: " + mod); - } - if (alt) name = "Alt-" + name; - if (ctrl) name = "Ctrl-" + name; - if (cmd) name = "Cmd-" + name; - if (shift) name = "Shift-" + name; - return name; - } - - // This is a kludge to keep keymaps mostly working as raw objects - // (backwards compatibility) while at the same time support features - // like normalization and multi-stroke key bindings. It compiles a - // new normalized keymap, and then updates the old object to reflect - // this. - CodeMirror.normalizeKeyMap = function(keymap) { - var copy = {}; - for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname]; - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue; - if (value == "...") { delete keymap[keyname]; continue; } - - var keys = map(keyname.split(" "), normalizeKeyName); - for (var i = 0; i < keys.length; i++) { - var val, name; - if (i == keys.length - 1) { - name = keys.join(" "); - val = value; - } else { - name = keys.slice(0, i + 1).join(" "); - val = "..."; - } - var prev = copy[name]; - if (!prev) copy[name] = val; - else if (prev != val) throw new Error("Inconsistent bindings for " + name); - } - delete keymap[keyname]; - } - for (var prop in copy) keymap[prop] = copy[prop]; - return keymap; - }; - - var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) { - map = getKeyMap(map); - var found = map.call ? map.call(key, context) : map[key]; - if (found === false) return "nothing"; - if (found === "...") return "multi"; - if (found != null && handle(found)) return "handled"; - - if (map.fallthrough) { - if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") - return lookupKey(key, map.fallthrough, handle, context); - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle, context); - if (result) return result; - } - } - }; - - // Modifier key presses don't count as 'real' key presses for the - // purpose of keymap fallthrough. - var isModifierKey = CodeMirror.isModifierKey = function(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - }; - - // Look up the name of a key as indicated by an event object. - var keyName = CodeMirror.keyName = function(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) return false; - var base = keyNames[event.keyCode], name = base; - if (name == null || event.altGraphKey) return false; - if (event.altKey && base != "Alt") name = "Alt-" + name; - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name; - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name; - if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name; - return name; - }; - - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val; - } - - // FROMTEXTAREA - - CodeMirror.fromTextArea = function(textarea, options) { - options = options ? copyObj(options) : {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabIndex) - options.tabindex = textarea.tabIndex; - if (!options.placeholder && textarea.placeholder) - options.placeholder = textarea.placeholder; - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = activeElt(); - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - - function save() {textarea.value = cm.getValue();} - if (textarea.form) { - on(textarea.form, "submit", save); - // Deplorable hack to make the submit method do the right thing. - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form, realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function() { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch(e) {} - } - } - - options.finishInit = function(cm) { - cm.save = save; - cm.getTextArea = function() { return textarea; }; - cm.toTextArea = function() { - cm.toTextArea = isNaN; // Prevent this from being ran twice - save(); - textarea.parentNode.removeChild(cm.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (typeof textarea.form.submit == "function") - textarea.form.submit = realSubmit; - } - }; - }; - - textarea.style.display = "none"; - var cm = CodeMirror(function(node) { - textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - return cm; - }; - - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - var StringStream = CodeMirror.StringStream = function(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - }; - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == this.lineStart;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - indentation: function() { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } - }; - - // TEXTMARKERS - - // Created with markText and setBookmark methods. A TextMarker is a - // handle that can be used to clear or find a marked position in the - // document. Line objects hold arrays (markedSpans) containing - // {from, to, marker} object pointing to such marker objects, and - // indicating that such a marker is present on that line. Multiple - // lines may point to the same marker when it spans across lines. - // The spans will have null for their from/to properties when the - // marker continues beyond the start/end of the line. Markers have - // links back to the lines they currently touch. - - var nextMarkerId = 0; - - var TextMarker = CodeMirror.TextMarker = function(doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - this.id = ++nextMarkerId; - }; - eventMixin(TextMarker); - - // Clear the marker. - TextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - var cm = this.doc.cm, withOp = cm && !cm.curOp; - if (withOp) startOperation(cm); - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) signalLater(this, "clear", found.from, found.to); - } - var min = null, max = null; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); - else if (cm) { - if (span.to != null) max = lineNo(line); - if (span.from != null) min = lineNo(line); - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) - updateLineHeight(line, textHeight(cm.display)); - } - if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { - var visual = visualLine(this.lines[i]), len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } - - if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) reCheckSelection(cm.doc); - } - if (cm) signalLater(cm, "markerCleared", cm, this); - if (withOp) endOperation(cm); - if (this.parent) this.parent.clear(); - }; - - // Find the position of the marker in the document. Returns a {from, - // to} object by default. Side can be passed to get a specific side - // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the - // Pos objects returned contain a line object, rather than a line - // number (used to prevent looking up the same line twice). - TextMarker.prototype.find = function(side, lineObj) { - if (side == null && this.type == "bookmark") side = 1; - var from, to; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) return from; - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) return to; - } - } - return from && {from: from, to: to}; - }; - - // Signals that the marker's widget changed, and surrounding layout - // should be recomputed. - TextMarker.prototype.changed = function() { - var pos = this.find(-1, true), widget = this, cm = this.doc.cm; - if (!pos || !cm) return; - runInOp(cm, function() { - var line = pos.line, lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) - updateLineHeight(line, line.height + dHeight); - } - }); - }; - - TextMarker.prototype.attachLine = function(line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); - } - this.lines.push(line); - }; - TextMarker.prototype.detachLine = function(line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - - // Collapsed markers have unique ids, in order to be able to order - // them, which is needed for uniquely determining an outer marker - // when they overlap (they may nest, but not partially overlap). - var nextMarkerId = 0; - - // Create a marker, wire it up to the right lines, and - function markText(doc, from, to, options, type) { - // Shared markers (across linked documents) are handled separately - // (markTextShared will call out to this again, once per - // document). - if (options && options.shared) return markTextShared(doc, from, to, options, type); - // Ensure we are in an operation. - if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); - - var marker = new TextMarker(doc, type), diff = cmp(from, to); - if (options) copyObj(options, marker, false); - // Don't connect empty markers unless clearWhenEmpty is false - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) - return marker; - if (marker.replacedWith) { - // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true; - marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true"); - if (options.insertLeft) marker.widgetNode.insertLeft = true; - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || - from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) - throw new Error("Inserting collapsed marker partially overlapping an existing one"); - sawCollapsedSpans = true; - } - - if (marker.addToHistory) - addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); - - var curLine = from.line, cm = doc.cm, updateMaxLine; - doc.iter(curLine, to.line + 1, function(line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - updateMaxLine = true; - if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); - addMarkedSpan(line, new MarkedSpan(marker, - curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null)); - ++curLine; - }); - // lineIsHidden depends on the presence of the spans, so needs a second pass - if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { - if (lineIsHidden(doc, line)) updateLineHeight(line, 0); - }); - - if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); - - if (marker.readOnly) { - sawReadOnlySpans = true; - if (doc.history.done.length || doc.history.undone.length) - doc.clearHistory(); - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - // Sync editor state - if (updateMaxLine) cm.curOp.updateMaxLine = true; - if (marker.collapsed) - regChange(cm, from.line, to.line + 1); - else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) - for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); - if (marker.atomic) reCheckSelection(cm.doc); - signalLater(cm, "markerAdded", cm, marker); - } - return marker; - } - - // SHARED TEXTMARKERS - - // A shared marker spans multiple linked documents. It is - // implemented as a meta-marker-object controlling multiple normal - // markers. - var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i = 0; i < markers.length; ++i) - markers[i].parent = this; - }; - eventMixin(SharedTextMarker); - - SharedTextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - this.explicitlyCleared = true; - for (var i = 0; i < this.markers.length; ++i) - this.markers[i].clear(); - signalLater(this, "clear"); - }; - SharedTextMarker.prototype.find = function(side, lineObj) { - return this.primary.find(side, lineObj); - }; - - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function(doc) { - if (widget) options.widgetNode = widget.cloneNode(true); - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); - for (var i = 0; i < doc.linked.length; ++i) - if (doc.linked[i].isParent) return; - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary); - } - - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), - function(m) { return m.parent; }); - } - - function copySharedMarkers(doc, markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find(); - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } - } - } - - function detachSharedMarkers(markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], linked = [marker.primary.doc];; - linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - } - } - - // TEXTMARKER SPANS - - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; this.to = to; - } - - // Search an array of spans for a span matching the given marker. - function getMarkedSpanFor(spans, marker) { - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.marker == marker) return span; - } - } - // Remove a span from an array, returning undefined if no spans are - // left (we don't store arrays for lines without spans). - function removeMarkedSpan(spans, span) { - for (var r, i = 0; i < spans.length; ++i) - if (spans[i] != span) (r || (r = [])).push(spans[i]); - return r; - } - // Add a span to a line. - function addMarkedSpan(line, span) { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - span.marker.attachLine(line); - } - - // Used for the algorithm that adjusts markers for a change in the - // document. These functions cut an array of spans at a given - // character position, returning an array of remaining chunks (or - // undefined if nothing remains). - function markedSpansBefore(old, startCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } - return nw; - } - function markedSpansAfter(old, endCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)); - } - } - return nw; - } - - // Given a change object, compute the new set of marker spans that - // cover the line in which the change took place. Removes spans - // entirely within the change, reconnects spans belonging to the - // same marker that appear on both sides of the change, and cuts off - // spans partially within the change. Returns an array of span - // arrays with one element for each line in (after) the change. - function stretchSpansOverChange(doc, change) { - if (change.full) return null; - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) return null; - - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - - // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) span.to = startCh; - else if (sameLine) span.to = found.to == null ? null : found.to + offset; - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i = 0; i < last.length; ++i) { - var span = last[i]; - if (span.to != null) span.to += offset; - if (span.from == null) { - var found = getMarkedSpanFor(first, span.marker); - if (!found) { - span.from = offset; - if (sameLine) (first || (first = [])).push(span); - } - } else { - span.from += offset; - if (sameLine) (first || (first = [])).push(span); - } - } - } - // Make sure we didn't create any zero-length spans - if (first) first = clearEmptySpans(first); - if (last && last != first) last = clearEmptySpans(last); - - var newMarkers = [first]; - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers; - if (gap > 0 && first) - for (var i = 0; i < first.length; ++i) - if (first[i].to == null) - (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); - for (var i = 0; i < gap; ++i) - newMarkers.push(gapMarkers); - newMarkers.push(last); - } - return newMarkers; - } - - // Remove spans that are empty and don't have a clearWhenEmpty - // option of false. - function clearEmptySpans(spans) { - for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - spans.splice(i--, 1); - } - if (!spans.length) return null; - return spans; - } - - // Used for un/re-doing changes from the history. Combines the - // result of computing the existing spans with the set of spans that - // existed in the history (so that deleting around a span and then - // undoing brings back the span). - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) return stretched; - if (!stretched) return old; - - for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) - if (oldCur[k].marker == span.marker) continue spans; - oldCur.push(span); - } - } else if (stretchCur) { - old[i] = stretchCur; - } - } - return old; - } - - // Used to 'clip' out readOnly ranges when making a change. - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function(line) { - if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - (markers || (markers = [])).push(mark); - } - }); - if (!markers) return null; - var parts = [{from: from, to: to}]; - for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - newParts.push({from: p.from, to: m.from}); - if (dto > 0 || !mk.inclusiveRight && !dto) - newParts.push({from: m.to, to: p.to}); - parts.splice.apply(parts, newParts); - j += newParts.length - 1; - } - } - return parts; - } - - // Connect or disconnect spans from a line. - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.detachLine(line); - line.markedSpans = null; - } - function attachMarkedSpans(line, spans) { - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.attachLine(line); - line.markedSpans = spans; - } - - // Helpers used when computing which overlapping collapsed span - // counts as the larger one. - function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } - function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } - - // Returns a number indicating which of two overlapping collapsed - // spans is larger (and thus includes the other). Falls back to - // comparing ids when the spans cover exactly the same range. - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) return lenDiff; - var aPos = a.find(), bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) return -fromCmp; - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) return toCmp; - return b.id - a.id; - } - - // Find out whether a line ends or starts in a collapsed span. If - // so, return the marker for that span. - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - found = sp.marker; - } - return found; - } - function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } - function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } - - // Test whether there exists a collapsed span that partially - // overlaps (covers the start or end, but not both) of a new span. - // Such overlap is not allowed. - function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (!sp.marker.collapsed) continue; - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; - if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || - fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) - return true; - } - } - - // A visual line is a line as drawn on the screen. Folding, for - // example, can cause multiple logical lines to appear on the same - // visual line. This finds the start of the visual line that the - // given line is part of (usually that is the line itself). - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) - line = merged.find(-1, true).line; - return line; - } - - // Returns an array of logical lines that continue the visual line - // started by the argument, or undefined if there are no such lines. - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - (lines || (lines = [])).push(line); - } - return lines; - } - - // Get the line number of the start of the visual line that the - // given line number is part of. - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line); - if (line == vis) return lineN; - return lineNo(vis); - } - // Get the line number of the start of the next visual line after - // the given line. - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) return lineN; - var line = getLine(doc, lineN), merged; - if (!lineIsHidden(doc, line)) return lineN; - while (merged = collapsedSpanAtEnd(line)) - line = merged.find(1, true).line; - return lineNo(line) + 1; - } - - // Compute whether a line is hidden. Lines count as hidden when they - // are part of a visual line that starts with another line, or when - // they are entirely covered by collapsed, non-widget span. - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) continue; - if (sp.from == null) return true; - if (sp.marker.widgetNode) continue; - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) - return true; - } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); - } - if (span.marker.inclusiveRight && span.to == line.text.length) - return true; - for (var sp, i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && - (sp.to == null || sp.to != span.from) && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(doc, line, sp)) return true; - } - } - - // LINE WIDGETS - - // Line widgets are block elements displayed above or below a line. - - var LineWidget = CodeMirror.LineWidget = function(doc, node, options) { - if (options) for (var opt in options) if (options.hasOwnProperty(opt)) - this[opt] = options[opt]; - this.doc = doc; - this.node = node; - }; - eventMixin(LineWidget); - - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - addToScrollPos(cm, null, diff); - } - - LineWidget.prototype.clear = function() { - var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); - if (no == null || !ws) return; - for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); - if (!ws.length) line.widgets = null; - var height = widgetHeight(this); - updateLineHeight(line, Math.max(0, line.height - height)); - if (cm) runInOp(cm, function() { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - }); - }; - LineWidget.prototype.changed = function() { - var oldH = this.height, cm = this.doc.cm, line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) return; - updateLineHeight(line, line.height + diff); - if (cm) runInOp(cm, function() { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - }); - }; - - function widgetHeight(widget) { - if (widget.height != null) return widget.height; - var cm = widget.doc.cm; - if (!cm) return 0; - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) - parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; - if (widget.noHScroll) - parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.offsetHeight; - } - - function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options); - var cm = doc.cm; - if (cm && widget.noHScroll) cm.display.alignWidgets = true; - changeLine(doc, handle, "widget", function(line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) widgets.push(widget); - else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); - widget.line = line; - if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) addToScrollPos(cm, null, widget.height); - cm.curOp.forceUpdate = true; - } - return true; - }); - return widget; - } - - // LINE DATA STRUCTURE - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight ? estimateHeight(this) : 1; - }; - eventMixin(Line); - Line.prototype.lineNo = function() { return lineNo(this); }; - - // Change the content (text, markers) of a line. Automatically - // invalidates cached information and tries to re-estimate the - // line's height. - function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text; - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - if (line.order != null) line.order = null; - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight ? estimateHeight(line) : 1; - if (estHeight != line.height) updateLineHeight(line, estHeight); - } - - // Detach a line from the document tree and its markers. - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - - function extractLineClasses(type, output) { - if (type) for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) break; - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop] == null) - output[prop] = lineClass[2]; - else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) - output[prop] += " " + lineClass[2]; - } - return type; - } - - function callBlankLine(mode, state) { - if (mode.blankLine) return mode.blankLine(state); - if (!mode.innerMode) return; - var inner = CodeMirror.innerMode(mode, state); - if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); - } - - function readToken(mode, stream, state, inner) { - for (var i = 0; i < 10; i++) { - if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; - var style = mode.token(stream, state); - if (stream.pos > stream.start) return style; - } - throw new Error("Mode " + mode.name + " failed to advance stream."); - } - - // Utility for getTokenAt and getLineTokens - function takeToken(cm, pos, precise, asArray) { - function getObj(copy) { - return {start: stream.start, end: stream.pos, - string: stream.current(), - type: style || null, - state: copy ? copyState(doc.mode, state) : state}; - } - - var doc = cm.doc, mode = doc.mode, style; - pos = clipPos(doc, pos); - var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); - var stream = new StringStream(line.text, cm.options.tabSize), tokens; - if (asArray) tokens = []; - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos; - style = readToken(mode, stream, state); - if (asArray) tokens.push(getObj(true)); - } - return asArray ? tokens : getObj(); - } - - // Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; - var curStart = 0, curStyle = null; - var stream = new StringStream(text, cm.options.tabSize), style; - var inner = cm.options.addModeClass && [null]; - if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) processLine(cm, text, state, stream.pos); - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses); - } - if (inner) { - var mName = inner[0].name; - if (mName) style = "m-" + (style ? mName + " " + style : mName); - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 50000); - f(curStart, curStyle); - } - curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 characters - var pos = Math.min(stream.pos, curStart + 50000); - f(pos, curStyle); - curStart = pos; - } - } - - // Compute a style array (an array starting with a mode generation - // -- for invalidation -- followed by pairs of end positions and - // style strings), which is used to highlight the tokens on the - // line. - function highlightLine(cm, line, state, forceToEnd) { - // A styles array always starts with a number identifying the - // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {}; - // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, state, function(end, style) { - st.push(end, style); - }, lineClasses, forceToEnd); - - // Run overlays, adjust style array. - for (var o = 0; o < cm.state.overlays.length; ++o) { - var overlay = cm.state.overlays[o], i = 1, at = 0; - runMode(cm, line.text, overlay.mode, true, function(end, style) { - var start = i; - // Ensure there's a token end at the current position, and that i points at it - while (at < end) { - var i_end = st[i]; - if (i_end > end) - st.splice(i, 1, end, st[i+1], i_end); - i += 2; - at = Math.min(end, i_end); - } - if (!style) return; - if (overlay.opaque) { - st.splice(start, i - start, end, "cm-overlay " + style); - i = start + 2; - } else { - for (; start < i; start += 2) { - var cur = st[start+1]; - st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; - } - } - }, lineClasses); - } - - return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; - } - - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); - line.styles = result.styles; - if (result.classes) line.styleClasses = result.classes; - else if (line.styleClasses) line.styleClasses = null; - if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; - } - return line.styles; - } - - // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. Used for lines that - // aren't currently visible. - function processLine(cm, text, state, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize); - stream.start = stream.pos = startAt || 0; - if (text == "") callBlankLine(mode, state); - while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) { - readToken(mode, stream, state); - stream.start = stream.pos; - } - } - - // Convert a style as returned by a mode (either null, or a string - // containing one or more styles) to a CSS style. This is cached, - // and also looks for line-wide styles. - var styleToClassCache = {}, styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) return null; - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || - (cache[style] = style.replace(/\S+/g, "cm-$&")); - } - - // Render the DOM representation of the text of a line. Also builds - // up a 'line map', which points at the DOM nodes that represent - // specific stretches of text, and is used by the measuring code. - // The returned object contains the DOM node, this map, and - // information about line-wide styles that were set by the mode. - function buildLineContent(cm, lineView) { - // The padding-right forces the element to have a 'border', which - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content, - col: 0, pos: 0, cm: cm, - splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; - lineView.measure = {}; - - // Iterate over the logical lines that make up this visual line. - for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order; - builder.pos = 0; - builder.addToken = buildToken; - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) - builder.addToken = buildTokenBadBidi(builder.addToken, order); - builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) - builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); - if (line.styleClasses.textClass) - builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); - } - - // Ensure at least a single node is present, for measuring. - if (builder.map.length == 0) - builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); - - // Store the map and a cache object for the current logical line - if (i == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); - (lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - - // See issue #2901 - if (webkit && /\bcm-tab\b/.test(builder.content.lastChild.className)) - builder.content.className = "cm-tab-wrap-hack"; - - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) - builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); - - return builder; - } - - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - token.setAttribute("aria-label", token.title); - return token; - } - - // Build up the DOM representation for a single token, and add it to - // the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, title, css) { - if (!text) return; - var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; - var special = builder.cm.state.specialChars, mustWrap = false; - if (!special.test(text)) { - builder.col += text.length; - var content = document.createTextNode(displayText); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) mustWrap = true; - builder.pos += text.length; - } else { - var content = document.createDocumentFragment(), pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) break; - pos += skipped + 1; - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - txt.setAttribute("role", "presentation"); - txt.setAttribute("cm-text", "\t"); - builder.col += tabWidth; - } else if (m[0] == "\r" || m[0] == "\n") { - var txt = content.appendChild(elt("span", m[0] == "\r" ? "␍" : "␤", "cm-invalidchar")); - txt.setAttribute("cm-text", m[0]); - builder.col += 1; - } else { - var txt = builder.cm.options.specialCharPlaceholder(m[0]); - txt.setAttribute("cm-text", m[0]); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt); - builder.pos++; - } - } - if (style || startStyle || endStyle || mustWrap || css) { - var fullStyle = style || ""; - if (startStyle) fullStyle += startStyle; - if (endStyle) fullStyle += endStyle; - var token = elt("span", [content], fullStyle, css); - if (title) token.title = title; - return builder.content.appendChild(token); - } - builder.content.appendChild(content); - } - - function splitSpaces(old) { - var out = " "; - for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; - out += " "; - return out; - } - - // Work around nonsense dimensions being reported for stretches of - // right-to-left text. - function buildTokenBadBidi(inner, order) { - return function(builder, text, style, startStyle, endStyle, title, css) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, end = start + text.length; - for (;;) { - // Find the part that overlaps with the start of this text - for (var i = 0; i < order.length; i++) { - var part = order[i]; - if (part.to > start && part.from <= start) break; - } - if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); - inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - }; - } - - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) builder.map.push(builder.pos, builder.pos + size, widget); - if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { - if (!widget) - widget = builder.content.appendChild(document.createElement("span")); - widget.setAttribute("cm-marker", marker.id); - } - if (widget) { - builder.cm.display.input.setUneditable(widget); - builder.content.appendChild(widget); - } - builder.pos += size; - } - - // Outputs a number of spans to make up a line, taking highlighting - // and marked text into account. - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0; - if (!spans) { - for (var i = 1; i < styles.length; i+=2) - builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); - return; - } - - var len = allText.length, pos = 0, i = 1, text = "", style, css; - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = title = css = ""; - collapsed = null; nextChange = Infinity; - var foundBookmarks = []; - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m); - } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { - if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to; - spanEndStyle = ""; - } - if (m.className) spanStyle += " " + m.className; - if (m.css) css = m.css; - if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; - if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; - if (m.title && !title) title = m.title; - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - collapsed = sp; - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null); - if (collapsed.to == null) return; - if (collapsed.to == pos) collapsed = false; - } - if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) - buildCollapsedSpan(builder, 0, foundBookmarks[j]); - } - if (pos >= len) break; - - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i++]); - style = interpretTokenStyle(styles[i++], builder.cm.options); - } - } - } - - // DOCUMENT DATA STRUCTURE - - // By default, updates that start and end at the beginning of a line - // are treated specially, in order to make the association of line - // widgets and marker elements with the text behave more intuitive. - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore); - } - - // Perform a change on the document data structure. - function updateDoc(doc, change, markedSpans, estimateHeight) { - function spansFor(n) {return markedSpans ? markedSpans[n] : null;} - function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight); - signalLater(line, "change", line, change); - } - function linesFor(start, end) { - for (var i = start, result = []; i < end; ++i) - result.push(new Line(text[i], spansFor(i), estimateHeight)); - return result; - } - - var from = change.from, to = change.to, text = change.text; - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; - - // Adjust the line structure - if (change.full) { - doc.insert(0, linesFor(0, text.length)); - doc.remove(text.length, doc.size - text.length); - } else if (isWholeLineUpdate(doc, change)) { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = linesFor(0, text.length - 1); - update(lastLine, lastLine.text, lastSpans); - if (nlines) doc.remove(from.line, nlines); - if (added.length) doc.insert(from.line, added); - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); - } else { - var added = linesFor(1, text.length - 1); - added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added); - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - var added = linesFor(1, text.length - 1); - if (nlines > 1) doc.remove(from.line + 1, nlines - 1); - doc.insert(from.line + 1, added); - } - - signalLater(doc, "change", doc, change); - } - - // The document is represented as a BTree consisting of leaves, with - // chunk of lines in them, and branches, with up to ten leaves or - // other branch nodes below them. The top node is always a branch - // node, and is the document object itself (meaning it has - // additional methods and properties). - // - // All nodes have parent links. The tree is used both to go from - // line numbers to line objects, and to go from objects to numbers. - // It also indexes by height, and is used to convert between height - // and line object, and to find the total height of the document. - // - // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html - - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - for (var i = 0, height = 0; i < lines.length; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length; }, - // Remove the n lines at offset 'at'. - removeInner: function(at, n) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - // Helper used to collapse a small branch into a single leaf. - collapse: function(lines) { - lines.push.apply(lines, this.lines); - }, - // Insert the given array of lines at offset 'at', count them as - // having the given height. - insertInner: function(at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0; i < lines.length; ++i) lines[i].parent = this; - }, - // Used to iterate over a part of the tree. - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - if (op(this.lines[at])) return true; - } - }; - - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0; i < children.length; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - - BranchChunk.prototype = { - chunkSize: function() { return this.size; }, - removeInner: function(at, n) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) break; - at = 0; - } else at -= sz; - } - // If the result is smaller than 25 lines, ensure that it is a - // single leaf node. - if (this.size - n < 25 && - (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function(lines) { - for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); - }, - insertInner: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - while (child.lines.length > 50) { - var spilled = child.lines.splice(child.lines.length - 25, 25); - var newleaf = new LeafChunk(spilled); - child.height -= newleaf.height; - this.children.splice(i + 1, 0, newleaf); - newleaf.parent = this; - } - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - // When a node has grown, check whether it should be split. - maybeSpill: function() { - if (this.children.length <= 10) return; - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iterN: function(at, n, op) { - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) return true; - if ((n -= used) == 0) break; - at = 0; - } else at -= sz; - } - } - }; - - var nextDocId = 0; - var Doc = CodeMirror.Doc = function(text, mode, firstLine, lineSep) { - if (!(this instanceof Doc)) return new Doc(text, mode, firstLine, lineSep); - if (firstLine == null) firstLine = 0; - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.frontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - this.lineSep = lineSep; - - if (typeof text == "string") text = this.splitLines(text); - updateDoc(this, {from: start, to: start, text: text}); - setSelection(this, simpleSelection(start), sel_dontScroll); - }; - - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function(from, to, op) { - if (op) this.iterN(from - this.first, to - from, op); - else this.iterN(this.first, this.first + this.size, from); - }, - - // Non-public interface for adding and removing lines. - insert: function(at, lines) { - var height = 0; - for (var i = 0; i < lines.length; ++i) height += lines[i].height; - this.insertInner(at - this.first, lines, height); - }, - remove: function(at, n) { this.removeInner(at - this.first, n); }, - - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - - getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) return lines; - return lines.join(lineSep || this.lineSeparator()); - }, - setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1; - makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), origin: "setValue", full: true}, true); - setSelection(this, simpleSelection(top)); - }), - replaceRange: function(code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) return lines; - return lines.join(lineSep || this.lineSeparator()); - }, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, - - getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, - getLineNumber: function(line) {return lineNo(line);}, - - getLineHandleVisualStart: function(line) { - if (typeof line == "number") line = getLine(this, line); - return visualLine(line); - }, - - lineCount: function() {return this.size;}, - firstLine: function() {return this.first;}, - lastLine: function() {return this.first + this.size - 1;}, - - clipPos: function(pos) {return clipPos(this, pos);}, - - getCursor: function(start) { - var range = this.sel.primary(), pos; - if (start == null || start == "head") pos = range.head; - else if (start == "anchor") pos = range.anchor; - else if (start == "end" || start == "to" || start === false) pos = range.to(); - else pos = range.from(); - return pos; - }, - listSelections: function() { return this.sel.ranges; }, - somethingSelected: function() {return this.sel.somethingSelected();}, - - setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads, options)); - }), - extendSelectionsBy: docMethodOp(function(f, options) { - extendSelections(this, map(this.sel.ranges, f), options); - }), - setSelections: docMethodOp(function(ranges, primary, options) { - if (!ranges.length) return; - for (var i = 0, out = []; i < ranges.length; i++) - out[i] = new Range(clipPos(this, ranges[i].anchor), - clipPos(this, ranges[i].head)); - if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); - setSelection(this, normalizeSelection(out, primary), options); - }), - addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); - }), - - getSelection: function(lineSep) { - var ranges = this.sel.ranges, lines; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) return lines; - else return lines.join(lineSep || this.lineSeparator()); - }, - getSelections: function(lineSep) { - var parts = [], ranges = this.sel.ranges; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - if (lineSep !== false) sel = sel.join(lineSep || this.lineSeparator()); - parts[i] = sel; - } - return parts; - }, - replaceSelection: function(code, collapse, origin) { - var dup = []; - for (var i = 0; i < this.sel.ranges.length; i++) - dup[i] = code; - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function(code, collapse, origin) { - var changes = [], sel = this.sel; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin}; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i = changes.length - 1; i >= 0; i--) - makeChange(this, changes[i]); - if (newSel) setSelectionReplaceHistory(this, newSel); - else if (this.cm) ensureCursorVisible(this.cm); - }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), - - setExtending: function(val) {this.extend = val;}, - getExtending: function() {return this.extend;}, - - historySize: function() { - var hist = this.history, done = 0, undone = 0; - for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; - for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; - return {undo: done, redo: undone}; - }, - clearHistory: function() {this.history = new History(this.history.maxGeneration);}, - - markClean: function() { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function(forceSplit) { - if (forceSplit) - this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; - return this.history.generation; - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration); - }, - - getHistory: function() { - return {done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone)}; - }, - setHistory: function(histData) { - var hist = this.history = new History(this.history.maxGeneration); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - - addLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - if (!line[prop]) line[prop] = cls; - else if (classTest(cls).test(line[prop])) return false; - else line[prop] += " " + cls; - return true; - }); - }), - removeLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) return false; - else if (cls == null) line[prop] = null; - else { - var found = cur.match(classTest(cls)); - if (!found) return false; - var end = found.index + found[0].length; - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true; - }); - }), - - addLineWidget: docMethodOp(function(handle, node, options) { - return addLineWidget(this, handle, node, options); - }), - removeLineWidget: function(widget) { widget.clear(); }, - - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents}; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark"); - }, - findMarksAt: function(pos) { - pos = clipPos(this, pos); - var markers = [], spans = getLine(this, pos.line).markedSpans; - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - markers.push(span.marker.parent || span.marker); - } - return markers; - }, - findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to); - var found = [], lineNo = from.line; - this.iter(from.line, to.line + 1, function(line) { - var spans = line.markedSpans; - if (spans) for (var i = 0; i < spans.length; i++) { - var span = spans[i]; - if (!(lineNo == from.line && from.ch > span.to || - span.from == null && lineNo != from.line|| - lineNo == to.line && span.from > to.ch) && - (!filter || filter(span.marker))) - found.push(span.marker.parent || span.marker); - } - ++lineNo; - }); - return found; - }, - getAllMarks: function() { - var markers = []; - this.iter(function(line) { - var sps = line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) - if (sps[i].from != null) markers.push(sps[i].marker); - }); - return markers; - }, - - posFromIndex: function(off) { - var ch, lineNo = this.first; - this.iter(function(line) { - var sz = line.text.length + 1; - if (sz > off) { ch = off; return true; } - off -= sz; - ++lineNo; - }); - return clipPos(this, Pos(lineNo, ch)); - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) return 0; - this.iter(this.first, coords.line, function (line) { - index += line.text.length + 1; - }); - return index; - }, - - copy: function(copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), - this.modeOption, this.first, this.lineSep); - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc; - }, - - linkedDoc: function(options) { - if (!options) options = {}; - var from = this.first, to = this.first + this.size; - if (options.from != null && options.from > from) from = options.from; - if (options.to != null && options.to < to) to = options.to; - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep); - if (options.sharedHist) copy.history = this.history; - (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy; - }, - unlinkDoc: function(other) { - if (other instanceof CodeMirror) other = other.doc; - if (this.linked) for (var i = 0; i < this.linked.length; ++i) { - var link = this.linked[i]; - if (link.doc != other) continue; - this.linked.splice(i, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break; - } - // If the histories were shared, split them again - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function(f) {linkedDocs(this, f);}, - - getMode: function() {return this.mode;}, - getEditor: function() {return this.cm;}, - - splitLines: function(str) { - if (this.lineSep) return str.split(this.lineSep); - return splitLinesAuto(str); - }, - lineSeparator: function() { return this.lineSep || "\n"; } - }); - - // Public alias. - Doc.prototype.eachLine = Doc.prototype.iter; - - // Set up methods on CodeMirror's prototype to redirect to the editor's document. - var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); - for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - CodeMirror.prototype[prop] = (function(method) { - return function() {return method.apply(this.doc, arguments);}; - })(Doc.prototype[prop]); - - eventMixin(Doc); - - // Call f for all linked documents. - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc, skip, sharedHist) { - if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i]; - if (rel.doc == skip) continue; - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) continue; - f(rel.doc, shared); - propagate(rel.doc, doc, shared); - } - } - propagate(doc, null, true); - } - - // Attach a document to an editor. - function attachDoc(cm, doc) { - if (doc.cm) throw new Error("This document is already in use."); - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - if (!cm.options.lineWrapping) findMaxLine(cm); - cm.options.mode = doc.modeOption; - regChange(cm); - } - - // LINE UTILITIES - - // Find the line object corresponding to the given line number. - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); - for (var chunk = doc; !chunk.lines;) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break; } - n -= sz; - } - } - return chunk.lines[n]; - } - - // Get the part of a document between two positions, as an array of - // strings. - function getBetween(doc, start, end) { - var out = [], n = start.line; - doc.iter(start.line, end.line + 1, function(line) { - var text = line.text; - if (n == end.line) text = text.slice(0, end.ch); - if (n == start.line) text = text.slice(start.ch); - out.push(text); - ++n; - }); - return out; - } - // Get the lines between from and to, as array of strings. - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function(line) { out.push(line.text); }); - return out; - } - - // Update the height of a line, propagating the height change - // upwards to parent nodes. - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) for (var n = line; n; n = n.parent) n.height += diff; - } - - // Given a line object, find its line number by walking up through - // its parent links. - function lineNo(line) { - if (line.parent == null) return null; - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) break; - no += chunk.children[i].chunkSize(); - } - } - return no + cur.first; - } - - // Find the line at the given vertical position, using the height - // information in the document tree. - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i = 0; i < chunk.children.length; ++i) { - var child = chunk.children[i], ch = child.height; - if (h < ch) { chunk = child; continue outer; } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) break; - h -= lh; - } - return n + i; - } - - - // Find the height above the given line. - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - - var h = 0, chunk = lineObj.parent; - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i]; - if (line == lineObj) break; - else h += line.height; - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i = 0; i < p.children.length; ++i) { - var cur = p.children[i]; - if (cur == chunk) break; - else h += cur.height; - } - } - return h; - } - - // Get the bidi ordering for the given line (and cache it). Returns - // false for lines that are fully left-to-right, and an array of - // BidiSpan objects otherwise. - function getOrder(line) { - var order = line.order; - if (order == null) order = line.order = bidiOrdering(line.text); - return order; - } - - // HISTORY - - function History(startGen) { - // Arrays of change events and selections. Doing something adds an - // event to done and clears undo. Undoing moves events from done - // to undone, redoing moves them in the other direction. - this.done = []; this.undone = []; - this.undoDepth = Infinity; - // Used to track when changes can be merged into a single undo - // event - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1; - } - - // Create a history change event from an updateDoc-style change - // object. - function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); - return histChange; - } - - // Pop all selection events off the end of a history array. Stop at - // a change event. - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) array.pop(); - else break; - } - } - - // Find the top change event in the history. Pop off selection - // events that are in the way. - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done); - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done); - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done); - } - } - - // Register a change in the history. Merges changes that are within - // a single operation, ore are close together with an origin that - // allows merging (starting with "+") into a single event. - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = +new Date, cur; - - if ((hist.lastOp == opId || - hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || - change.origin.charAt(0) == "*")) && - (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - // Merge this change into the last event - var last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - // Optimized case for simple insertion -- don't want to add - // new changesets for every character typed - last.to = changeEnd(change); - } else { - // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - // Can not be merged, start a new event. - var before = lst(hist.done); - if (!before || !before.ranges) - pushSelectionToHistory(doc.sel, hist.done); - cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation}; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) hist.done.shift(); - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - - if (!last) signal(doc, "historyAdded"); - } - - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || - ch == "+" && - prev.ranges.length == sel.ranges.length && - prev.somethingSelected() == sel.somethingSelected() && - new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); - } - - // Called whenever the selection changes, sets the new selection as - // the pending selection in the history, and pushes the old pending - // selection into the 'done' array when it was significantly - // different (in number of selected ranges, emptiness, or time). - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin; - - // A new event is started when the previous origin does not match - // the current, or the origins don't allow matching. Origins - // starting with * are always merged, those starting with + are - // merged when similar and close together in time. - if (opId == hist.lastSelOp || - (origin && hist.lastSelOrigin == origin && - (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || - selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - hist.done[hist.done.length - 1] = sel; - else - pushSelectionToHistory(sel, hist.done); - - hist.lastSelTime = +new Date; - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) - clearSelectionEvents(hist.undone); - } - - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) - dest.push(sel); - } - - // Used to store marked span information in the history. - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { - if (line.markedSpans) - (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; - ++n; - }); - } - - // When un/re-doing restores text containing marked spans, those - // that have been explicitly cleared should not be restored. - function removeClearedSpans(spans) { - if (!spans) return null; - for (var i = 0, out; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } - else if (out) out.push(spans[i]); - } - return !out ? spans : out.length ? out : null; - } - - // Retrieve and filter the old marked spans stored in a change event. - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) return null; - for (var i = 0, nw = []; i < change.text.length; ++i) - nw.push(removeClearedSpans(found[i])); - return nw; - } - - // Used both to provide a JSON-safe object in .getHistory, and, when - // detaching a document, to split the history in two - function copyHistoryArray(events, newGroup, instantiateSel) { - for (var i = 0, copy = []; i < events.length; ++i) { - var event = events[i]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue; - } - var changes = event.changes, newChanges = []; - copy.push({changes: newChanges}); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m; - newChanges.push({from: change.from, to: change.to, text: change.text}); - if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop]; - delete change[prop]; - } - } - } - } - return copy; - } - - // Rebasing/resetting history to deal with externally-sourced changes - - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - - // Tries to rebase an array of history events given a change in the - // document. If the change touches the same lines as the event, the - // event, and everything 'behind' it, is discarded. If the change is - // before the event, the event's positions are updated. Uses a - // copy-on-write scheme for the positions, to avoid having to - // reallocate them all on every rebase, but also avoid problems with - // shared position objects being unsafely updated. - function rebaseHistArray(array, from, to, diff) { - for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true; - if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue; - } - for (var j = 0; j < sub.changes.length; ++j) { - var cur = sub.changes[j]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break; - } - } - if (!ok) { - array.splice(0, i + 1); - i = 0; - } - } - } - - function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - - // EVENT UTILITIES - - // Due to the fact that we still support jurassic IE versions, some - // compatibility wrappers are needed. - - var e_preventDefault = CodeMirror.e_preventDefault = function(e) { - if (e.preventDefault) e.preventDefault(); - else e.returnValue = false; - }; - var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { - if (e.stopPropagation) e.stopPropagation(); - else e.cancelBubble = true; - }; - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; - } - var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; - - function e_target(e) {return e.target || e.srcElement;} - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) b = 1; - else if (e.button & 2) b = 3; - else if (e.button & 4) b = 2; - } - if (mac && e.ctrlKey && b == 1) b = 3; - return b; - } - - // EVENT HANDLING - - // Lightweight event framework. on/off also work on DOM nodes, - // registering native DOM handlers. - - var on = CodeMirror.on = function(emitter, type, f) { - if (emitter.addEventListener) - emitter.addEventListener(type, f, false); - else if (emitter.attachEvent) - emitter.attachEvent("on" + type, f); - else { - var map = emitter._handlers || (emitter._handlers = {}); - var arr = map[type] || (map[type] = []); - arr.push(f); - } - }; - - var off = CodeMirror.off = function(emitter, type, f) { - if (emitter.removeEventListener) - emitter.removeEventListener(type, f, false); - else if (emitter.detachEvent) - emitter.detachEvent("on" + type, f); - else { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - for (var i = 0; i < arr.length; ++i) - if (arr[i] == f) { arr.splice(i, 1); break; } - } - }; - - var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); - }; - - var orphanDelayedCallbacks = null; - - // Often, we want to signal events at a point where we are in the - // middle of some work, but don't want the handler to start calling - // other methods on the editor, which might be in an inconsistent - // state or simply not expect any other events to happen. - // signalLater looks whether there are any handlers, and schedules - // them to be executed when the last operation ends, or, if no - // operation is active, when a timeout fires. - function signalLater(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2), list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; - } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - function bnd(f) {return function(){f.apply(null, args);};}; - for (var i = 0; i < arr.length; ++i) - list.push(bnd(arr[i])); - } - - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i = 0; i < delayed.length; ++i) delayed[i](); - } - - // The DOM events that CodeMirror handles can be overridden by - // registering a (non-DOM) handler on the editor for the event name, - // and preventDefault-ing the event in that handler. - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") - e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore; - } - - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) return; - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) - set.push(arr[i]); - } - - function hasHandler(emitter, type) { - var arr = emitter._handlers && emitter._handlers[type]; - return arr && arr.length > 0; - } - - // Add on and off methods to a constructor's prototype, to make - // registering events on such objects more convenient. - function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f);}; - ctor.prototype.off = function(type, f) {off(this, type, f);}; - } - - // MISC UTILITIES - - // Number of pixels added to scroller and sizer to hide scrollbar - var scrollerGap = 30; - - // Returned or thrown by various protocols to signal 'I'm not - // handling this'. - var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; - - // Reused option objects for setSelection & friends - var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; - - function Delayed() {this.id = null;} - Delayed.prototype.set = function(ms, f) { - clearTimeout(this.id); - this.id = setTimeout(f, ms); - }; - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i); - if (nextTab < 0 || nextTab >= end) - return n + (end - i); - n += nextTab - i; - n += tabSize - (n % tabSize); - i = nextTab + 1; - } - }; - - // The inverse of countColumn -- find the offset that corresponds to - // a particular column. - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos); - if (nextTab == -1) nextTab = string.length; - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) - return pos + Math.min(skipped, goal - col); - col += nextTab - pos; - col += tabSize - (col % tabSize); - pos = nextTab + 1; - if (col >= goal) return pos; - } - } - - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) - spaceStrs.push(lst(spaceStrs) + " "); - return spaceStrs[n]; - } - - function lst(arr) { return arr[arr.length-1]; } - - var selectInput = function(node) { node.select(); }; - if (ios) // Mobile Safari apparently has a bug where select() is broken. - selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; - else if (ie) // Suppress mysterious IE10 errors - selectInput = function(node) { try { node.select(); } catch(_e) {} }; - - function indexOf(array, elt) { - for (var i = 0; i < array.length; ++i) - if (array[i] == elt) return i; - return -1; - } - function map(array, f) { - var out = []; - for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); - return out; - } - - function nothing() {} - - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - nothing.prototype = base; - inst = new nothing(); - } - if (props) copyObj(props, inst); - return inst; - }; - - function copyObj(obj, target, overwrite) { - if (!target) target = {}; - for (var prop in obj) - if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - target[prop] = obj[prop]; - return target; - } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function(){return f.apply(null, args);}; - } - - var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var isWordCharBasic = CodeMirror.isWordChar = function(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - }; - function isWordChar(ch, helper) { - if (!helper) return isWordCharBasic(ch); - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; - return helper.test(ch); - } - - function isEmpty(obj) { - for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; - return true; - } - - // Extending unicode characters. A series of a non-extending char + - // any number of extending chars is treated as a single unit as far - // as editing and measuring is concerned. This is not fully correct, - // since some scripts/fonts/browsers also treat other configurations - // of code points as a group. - var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; - function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } - - // DOM UTILITIES - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) e.className = className; - if (style) e.style.cssText = style; - if (typeof content == "string") e.appendChild(document.createTextNode(content)); - else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); - return e; - } - - var range; - if (document.createRange) range = function(node, start, end, endNode) { - var r = document.createRange(); - r.setEnd(endNode || node, end); - r.setStart(node, start); - return r; - }; - else range = function(node, start, end) { - var r = document.body.createTextRange(); - try { r.moveToElementText(node.parentNode); } - catch(e) { return r; } - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r; - }; - - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) - e.removeChild(e.firstChild); - return e; - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e); - } - - var contains = CodeMirror.contains = function(parent, child) { - if (child.nodeType == 3) // Android browser always returns false when child is a textnode - child = child.parentNode; - if (parent.contains) - return parent.contains(child); - do { - if (child.nodeType == 11) child = child.host; - if (child == parent) return true; - } while (child = child.parentNode); - }; - - function activeElt() { - var activeElement = document.activeElement; - while (activeElement && activeElement.root && activeElement.root.activeElement) - activeElement = activeElement.root.activeElement; - return activeElement; - } - // Older versions of IE throws unspecified error when touching - // document.activeElement in some cases (during loading, in iframe) - if (ie && ie_version < 11) activeElt = function() { - try { return document.activeElement; } - catch(e) { return document.body; } - }; - - function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } - var rmClass = CodeMirror.rmClass = function(node, cls) { - var current = node.className; - var match = classTest(cls).exec(current); - if (match) { - var after = current.slice(match.index + match[0].length); - node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); - } - }; - var addClass = CodeMirror.addClass = function(node, cls) { - var current = node.className; - if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls; - }; - function joinClasses(a, b) { - var as = a.split(" "); - for (var i = 0; i < as.length; i++) - if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; - return b; - } - - // WINDOW-WIDE EVENTS - - // These must be handled carefully, because naively registering a - // handler for each editor will cause the editors to never be - // garbage collected. - - function forEachCodeMirror(f) { - if (!document.body.getElementsByClassName) return; - var byClass = document.body.getElementsByClassName("CodeMirror"); - for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror; - if (cm) f(cm); - } - } - - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) return; - registerGlobalHandlers(); - globalsRegistered = true; - } - function registerGlobalHandlers() { - // When the window resizes, we need to refresh active editors. - var resizeTimer; - on(window, "resize", function() { - if (resizeTimer == null) resizeTimer = setTimeout(function() { - resizeTimer = null; - forEachCodeMirror(onResize); - }, 100); - }); - // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function() { - forEachCodeMirror(onBlur); - }); - } - - // FEATURE DETECTION - - // Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie && ie_version < 9) return false; - var div = elt('div'); - return "draggable" in div || "dragDrop" in div; - }(); - - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); - } - var node = zwspSupported ? elt("span", "\u200b") : - elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); - node.setAttribute("cm-text", ""); - return node; - } - - // Feature-detect IE's crummy client rect reporting for bidi text - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) return badBidiRects; - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) - var r1 = range(txt, 1, 2).getBoundingClientRect(); - return badBidiRects = (r1.right - r0.right < 3); - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLinesAuto = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { - var pos = 0, result = [], l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) nl = string.length; - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result; - } : function(string){return string.split(/\r\n?|\n/);}; - - var hasSelection = window.getSelection ? function(te) { - try { return te.selectionStart != te.selectionEnd; } - catch(e) { return false; } - } : function(te) { - try {var range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) return false; - return range.compareEndPoints("StartToEnd", range) != 0; - }; - - var hasCopyEvent = (function() { - var e = elt("div"); - if ("oncopy" in e) return true; - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function"; - })(); - - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) return badZoomedRects; - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; - } - - // KEY NAMES - - var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"}; - CodeMirror.keyNames = keyNames; - (function() { - // Number keys - for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); - // Alphabetic keys - for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); - // Function keys - for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; - })(); - - // BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) return f(from, to, "ltr"); - var found = false; - for (var i = 0; i < order.length; ++i) { - var part = order[i]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); - found = true; - } - } - if (!found) f(from, to, "ltr"); - } - - function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } - function bidiRight(part) { return part.level % 2 ? part.from : part.to; } - - function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } - function lineRight(line) { - var order = getOrder(line); - if (!order) return line.text.length; - return bidiRight(lst(order)); - } - - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) lineN = lineNo(visual); - var order = getOrder(visual); - var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); - return Pos(lineN, ch); - } - function lineEnd(cm, lineN) { - var merged, line = getLine(cm.doc, lineN); - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - lineN = null; - } - var order = getOrder(line); - var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); - return Pos(lineN == null ? lineNo(line) : lineN, ch); - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS); - } - return start; - } - - function compareBidiLevel(order, a, b) { - var linedir = order[0].level; - if (a == linedir) return true; - if (b == linedir) return false; - return a < b; - } - var bidiOther; - function getBidiPartAt(order, pos) { - bidiOther = null; - for (var i = 0, found; i < order.length; ++i) { - var cur = order[i]; - if (cur.from < pos && cur.to > pos) return i; - if ((cur.from == pos || cur.to == pos)) { - if (found == null) { - found = i; - } else if (compareBidiLevel(order, cur.level, order[found].level)) { - if (cur.from != cur.to) bidiOther = found; - return i; - } else { - if (cur.from != cur.to) bidiOther = i; - return found; - } - } - } - return found; - } - - function moveInLine(line, pos, dir, byUnit) { - if (!byUnit) return pos + dir; - do pos += dir; - while (pos > 0 && isExtendingChar(line.text.charAt(pos))); - return pos; - } - - // This is needed in order to move 'visually' through bi-directional - // text -- i.e., pressing left should make the cursor go left, even - // when in RTL text. The tricky part is the 'jumps', where RTL and - // LTR text touch each other. This often requires the cursor offset - // to move more than one unit, in order to visually move one unit. - function moveVisually(line, start, dir, byUnit) { - var bidi = getOrder(line); - if (!bidi) return moveLogically(line, start, dir, byUnit); - var pos = getBidiPartAt(bidi, start), part = bidi[pos]; - var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); - - for (;;) { - if (target > part.from && target < part.to) return target; - if (target == part.from || target == part.to) { - if (getBidiPartAt(bidi, target) == pos) return target; - part = bidi[pos += dir]; - return (dir > 0) == part.level % 2 ? part.to : part.from; - } else { - part = bidi[pos += dir]; - if (!part) return null; - if ((dir > 0) == part.level % 2) - target = moveInLine(line, part.to, -1, byUnit); - else - target = moveInLine(line, part.from, 1, byUnit); - } - } - } - - function moveLogically(line, start, dir, byUnit) { - var target = start + dir; - if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; - return target < 0 || target > line.text.length ? null : target; - } - - // Bidirectional ordering algorithm - // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm - // that this (partially) implements. - - // One-char codes used for character types: - // L (L): Left-to-Right - // R (R): Right-to-Left - // r (AL): Right-to-Left Arabic - // 1 (EN): European Number - // + (ES): European Number Separator - // % (ET): European Number Terminator - // n (AN): Arabic Number - // , (CS): Common Number Separator - // m (NSM): Non-Spacing Mark - // b (BN): Boundary Neutral - // s (B): Paragraph Separator - // t (S): Segment Separator - // w (WS): Whitespace - // N (ON): Other Neutrals - - // Returns null if characters are ordered as they appear - // (left-to-right), or an array of sections ({from, to, level} - // objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - // Character types for codepoints 0x600 to 0x6ff - var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; - function charType(code) { - if (code <= 0xf7) return lowTypes.charAt(code); - else if (0x590 <= code && code <= 0x5f4) return "R"; - else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); - else if (0x6ee <= code && code <= 0x8ac) return "r"; - else if (0x2000 <= code && code <= 0x200b) return "w"; - else if (code == 0x200c) return "b"; - else return "L"; - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; - // Browsers seem to always treat the boundaries of block elements as being L. - var outerType = "L"; - - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; this.to = to; - } - - return function(str) { - if (!bidiRE.test(str)) return false; - var len = str.length, types = []; - for (var i = 0, type; i < len; ++i) - types.push(type = charType(str.charCodeAt(i))); - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i = 0, prev = outerType; i < len; ++i) { - var type = types[i]; - if (type == "m") types[i] = prev; - else prev = type; - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (type == "1" && cur == "r") types[i] = "n"; - else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i = 1, prev = types[0]; i < len - 1; ++i) { - var type = types[i]; - if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; - else if (type == "," && prev == types[i+1] && - (prev == "1" || prev == "n")) types[i] = prev; - prev = type; - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i = 0; i < len; ++i) { - var type = types[i]; - if (type == ",") types[i] = "N"; - else if (type == "%") { - for (var end = i + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (cur == "L" && type == "1") types[i] = "L"; - else if (isStrong.test(type)) cur = type; - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i = 0; i < len; ++i) { - if (isNeutral.test(types[i])) { - for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} - var before = (i ? types[i-1] : outerType) == "L"; - var after = (end < len ? types[end] : outerType) == "L"; - var replace = before || after ? "L" : "R"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m; - for (var i = 0; i < len;) { - if (countsAsLeft.test(types[i])) { - var start = i; - for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} - order.push(new BidiSpan(0, start, i)); - } else { - var pos = i, at = order.length; - for (++i; i < len && types[i] != "L"; ++i) {} - for (var j = pos; j < i;) { - if (countsAsNum.test(types[j])) { - if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); - var nstart = j; - for (++j; j < i && countsAsNum.test(types[j]); ++j) {} - order.splice(at, 0, new BidiSpan(2, nstart, j)); - pos = j; - } else ++j; - } - if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); - } - } - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } - if (order[0].level == 2) - order.unshift(new BidiSpan(1, order[0].to, order[0].to)); - if (order[0].level != lst(order).level) - order.push(new BidiSpan(order[0].level, len, len)); - - return order; - }; - })(); - - // THE END - - CodeMirror.version = "5.5.0"; - - return CodeMirror; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/css.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/css.js deleted file mode 100644 index 63698c1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/css.js +++ /dev/null @@ -1,756 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("css", function(config, parserConfig) { - if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); - - var indentUnit = config.indentUnit, - tokenHooks = parserConfig.tokenHooks, - documentTypes = parserConfig.documentTypes || {}, - mediaTypes = parserConfig.mediaTypes || {}, - mediaFeatures = parserConfig.mediaFeatures || {}, - propertyKeywords = parserConfig.propertyKeywords || {}, - nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, - fontProperties = parserConfig.fontProperties || {}, - counterDescriptors = parserConfig.counterDescriptors || {}, - colorKeywords = parserConfig.colorKeywords || {}, - valueKeywords = parserConfig.valueKeywords || {}, - allowNested = parserConfig.allowNested; - - var type, override; - function ret(style, tp) { type = tp; return style; } - - // Tokenizers - - function tokenBase(stream, state) { - var ch = stream.next(); - if (tokenHooks[ch]) { - var result = tokenHooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == "@") { - stream.eatWhile(/[\w\\\-]/); - return ret("def", stream.current()); - } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { - return ret(null, "compare"); - } else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "#") { - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "hash"); - } else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (ch === "-") { - if (/[\d.]/.test(stream.peek())) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (stream.match(/^-[\w\\\-]+/)) { - stream.eatWhile(/[\w\\\-]/); - if (stream.match(/^\s*:/, false)) - return ret("variable-2", "variable-definition"); - return ret("variable-2", "variable"); - } else if (stream.match(/^\w+-/)) { - return ret("meta", "meta"); - } - } else if (/[,+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { - return ret("qualifier", "qualifier"); - } else if (/[:;{}\[\]\(\)]/.test(ch)) { - return ret(null, ch); - } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) || - (ch == "d" && stream.match("omain(")) || - (ch == "r" && stream.match("egexp("))) { - stream.backUp(1); - state.tokenize = tokenParenthesized; - return ret("property", "word"); - } else if (/[\w\\\-]/.test(ch)) { - stream.eatWhile(/[\w\\\-]/); - return ret("property", "word"); - } else { - return ret(null, null); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - if (quote == ")") stream.backUp(1); - break; - } - escaped = !escaped && ch == "\\"; - } - if (ch == quote || !escaped && quote != ")") state.tokenize = null; - return ret("string", "string"); - }; - } - - function tokenParenthesized(stream, state) { - stream.next(); // Must be '(' - if (!stream.match(/\s*[\"\')]/, false)) - state.tokenize = tokenString(")"); - else - state.tokenize = null; - return ret(null, "("); - } - - // Context management - - function Context(type, indent, prev) { - this.type = type; - this.indent = indent; - this.prev = prev; - } - - function pushContext(state, stream, type) { - state.context = new Context(type, stream.indentation() + indentUnit, state.context); - return type; - } - - function popContext(state) { - state.context = state.context.prev; - return state.context.type; - } - - function pass(type, stream, state) { - return states[state.context.type](type, stream, state); - } - function popAndPass(type, stream, state, n) { - for (var i = n || 1; i > 0; i--) - state.context = state.context.prev; - return pass(type, stream, state); - } - - // Parser - - function wordAsValue(stream) { - var word = stream.current().toLowerCase(); - if (valueKeywords.hasOwnProperty(word)) - override = "atom"; - else if (colorKeywords.hasOwnProperty(word)) - override = "keyword"; - else - override = "variable"; - } - - var states = {}; - - states.top = function(type, stream, state) { - if (type == "{") { - return pushContext(state, stream, "block"); - } else if (type == "}" && state.context.prev) { - return popContext(state); - } else if (/@(media|supports|(-moz-)?document)/.test(type)) { - return pushContext(state, stream, "atBlock"); - } else if (/@(font-face|counter-style)/.test(type)) { - state.stateArg = type; - return "restricted_atBlock_before"; - } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { - return "keyframes"; - } else if (type && type.charAt(0) == "@") { - return pushContext(state, stream, "at"); - } else if (type == "hash") { - override = "builtin"; - } else if (type == "word") { - override = "tag"; - } else if (type == "variable-definition") { - return "maybeprop"; - } else if (type == "interpolation") { - return pushContext(state, stream, "interpolation"); - } else if (type == ":") { - return "pseudo"; - } else if (allowNested && type == "(") { - return pushContext(state, stream, "parens"); - } - return state.context.type; - }; - - states.block = function(type, stream, state) { - if (type == "word") { - var word = stream.current().toLowerCase(); - if (propertyKeywords.hasOwnProperty(word)) { - override = "property"; - return "maybeprop"; - } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { - override = "string-2"; - return "maybeprop"; - } else if (allowNested) { - override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag"; - return "block"; - } else { - override += " error"; - return "maybeprop"; - } - } else if (type == "meta") { - return "block"; - } else if (!allowNested && (type == "hash" || type == "qualifier")) { - override = "error"; - return "block"; - } else { - return states.top(type, stream, state); - } - }; - - states.maybeprop = function(type, stream, state) { - if (type == ":") return pushContext(state, stream, "prop"); - return pass(type, stream, state); - }; - - states.prop = function(type, stream, state) { - if (type == ";") return popContext(state); - if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); - if (type == "}" || type == "{") return popAndPass(type, stream, state); - if (type == "(") return pushContext(state, stream, "parens"); - - if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { - override += " error"; - } else if (type == "word") { - wordAsValue(stream); - } else if (type == "interpolation") { - return pushContext(state, stream, "interpolation"); - } - return "prop"; - }; - - states.propBlock = function(type, _stream, state) { - if (type == "}") return popContext(state); - if (type == "word") { override = "property"; return "maybeprop"; } - return state.context.type; - }; - - states.parens = function(type, stream, state) { - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == ")") return popContext(state); - if (type == "(") return pushContext(state, stream, "parens"); - if (type == "interpolation") return pushContext(state, stream, "interpolation"); - if (type == "word") wordAsValue(stream); - return "parens"; - }; - - states.pseudo = function(type, stream, state) { - if (type == "word") { - override = "variable-3"; - return state.context.type; - } - return pass(type, stream, state); - }; - - states.atBlock = function(type, stream, state) { - if (type == "(") return pushContext(state, stream, "atBlock_parens"); - if (type == "}") return popAndPass(type, stream, state); - if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); - - if (type == "word") { - var word = stream.current().toLowerCase(); - if (word == "only" || word == "not" || word == "and" || word == "or") - override = "keyword"; - else if (documentTypes.hasOwnProperty(word)) - override = "tag"; - else if (mediaTypes.hasOwnProperty(word)) - override = "attribute"; - else if (mediaFeatures.hasOwnProperty(word)) - override = "property"; - else if (propertyKeywords.hasOwnProperty(word)) - override = "property"; - else if (nonStandardPropertyKeywords.hasOwnProperty(word)) - override = "string-2"; - else if (valueKeywords.hasOwnProperty(word)) - override = "atom"; - else if (colorKeywords.hasOwnProperty(word)) - override = "keyword"; - else - override = "error"; - } - return state.context.type; - }; - - states.atBlock_parens = function(type, stream, state) { - if (type == ")") return popContext(state); - if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); - return states.atBlock(type, stream, state); - }; - - states.restricted_atBlock_before = function(type, stream, state) { - if (type == "{") - return pushContext(state, stream, "restricted_atBlock"); - if (type == "word" && state.stateArg == "@counter-style") { - override = "variable"; - return "restricted_atBlock_before"; - } - return pass(type, stream, state); - }; - - states.restricted_atBlock = function(type, stream, state) { - if (type == "}") { - state.stateArg = null; - return popContext(state); - } - if (type == "word") { - if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) || - (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))) - override = "error"; - else - override = "property"; - return "maybeprop"; - } - return "restricted_atBlock"; - }; - - states.keyframes = function(type, stream, state) { - if (type == "word") { override = "variable"; return "keyframes"; } - if (type == "{") return pushContext(state, stream, "top"); - return pass(type, stream, state); - }; - - states.at = function(type, stream, state) { - if (type == ";") return popContext(state); - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == "word") override = "tag"; - else if (type == "hash") override = "builtin"; - return "at"; - }; - - states.interpolation = function(type, stream, state) { - if (type == "}") return popContext(state); - if (type == "{" || type == ";") return popAndPass(type, stream, state); - if (type == "word") override = "variable"; - else if (type != "variable" && type != "(" && type != ")") override = "error"; - return "interpolation"; - }; - - return { - startState: function(base) { - return {tokenize: null, - state: "top", - stateArg: null, - context: new Context("top", base || 0, null)}; - }, - - token: function(stream, state) { - if (!state.tokenize && stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style && typeof style == "object") { - type = style[1]; - style = style[0]; - } - override = style; - state.state = states[state.state](type, stream, state); - return override; - }, - - indent: function(state, textAfter) { - var cx = state.context, ch = textAfter && textAfter.charAt(0); - var indent = cx.indent; - if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; - if (cx.prev && - (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "restricted_atBlock") || - ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || - ch == "{" && (cx.type == "at" || cx.type == "atBlock"))) { - indent = cx.indent - indentUnit; - cx = cx.prev; - } - return indent; - }, - - electricChars: "}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - fold: "brace" - }; -}); - - function keySet(array) { - var keys = {}; - for (var i = 0; i < array.length; ++i) { - keys[array[i]] = true; - } - return keys; - } - - var documentTypes_ = [ - "domain", "regexp", "url", "url-prefix" - ], documentTypes = keySet(documentTypes_); - - var mediaTypes_ = [ - "all", "aural", "braille", "handheld", "print", "projection", "screen", - "tty", "tv", "embossed" - ], mediaTypes = keySet(mediaTypes_); - - var mediaFeatures_ = [ - "width", "min-width", "max-width", "height", "min-height", "max-height", - "device-width", "min-device-width", "max-device-width", "device-height", - "min-device-height", "max-device-height", "aspect-ratio", - "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", - "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", - "max-color", "color-index", "min-color-index", "max-color-index", - "monochrome", "min-monochrome", "max-monochrome", "resolution", - "min-resolution", "max-resolution", "scan", "grid" - ], mediaFeatures = keySet(mediaFeatures_); - - var propertyKeywords_ = [ - "align-content", "align-items", "align-self", "alignment-adjust", - "alignment-baseline", "anchor-point", "animation", "animation-delay", - "animation-direction", "animation-duration", "animation-fill-mode", - "animation-iteration-count", "animation-name", "animation-play-state", - "animation-timing-function", "appearance", "azimuth", "backface-visibility", - "background", "background-attachment", "background-clip", "background-color", - "background-image", "background-origin", "background-position", - "background-repeat", "background-size", "baseline-shift", "binding", - "bleed", "bookmark-label", "bookmark-level", "bookmark-state", - "bookmark-target", "border", "border-bottom", "border-bottom-color", - "border-bottom-left-radius", "border-bottom-right-radius", - "border-bottom-style", "border-bottom-width", "border-collapse", - "border-color", "border-image", "border-image-outset", - "border-image-repeat", "border-image-slice", "border-image-source", - "border-image-width", "border-left", "border-left-color", - "border-left-style", "border-left-width", "border-radius", "border-right", - "border-right-color", "border-right-style", "border-right-width", - "border-spacing", "border-style", "border-top", "border-top-color", - "border-top-left-radius", "border-top-right-radius", "border-top-style", - "border-top-width", "border-width", "bottom", "box-decoration-break", - "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", - "caption-side", "clear", "clip", "color", "color-profile", "column-count", - "column-fill", "column-gap", "column-rule", "column-rule-color", - "column-rule-style", "column-rule-width", "column-span", "column-width", - "columns", "content", "counter-increment", "counter-reset", "crop", "cue", - "cue-after", "cue-before", "cursor", "direction", "display", - "dominant-baseline", "drop-initial-after-adjust", - "drop-initial-after-align", "drop-initial-before-adjust", - "drop-initial-before-align", "drop-initial-size", "drop-initial-value", - "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", - "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", - "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", - "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", - "font-stretch", "font-style", "font-synthesis", "font-variant", - "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", - "font-variant-ligatures", "font-variant-numeric", "font-variant-position", - "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", - "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end", - "grid-column-start", "grid-row", "grid-row-end", "grid-row-start", - "grid-template", "grid-template-areas", "grid-template-columns", - "grid-template-rows", "hanging-punctuation", "height", "hyphens", - "icon", "image-orientation", "image-rendering", "image-resolution", - "inline-box-align", "justify-content", "left", "letter-spacing", - "line-break", "line-height", "line-stacking", "line-stacking-ruby", - "line-stacking-shift", "line-stacking-strategy", "list-style", - "list-style-image", "list-style-position", "list-style-type", "margin", - "margin-bottom", "margin-left", "margin-right", "margin-top", - "marker-offset", "marks", "marquee-direction", "marquee-loop", - "marquee-play-count", "marquee-speed", "marquee-style", "max-height", - "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", - "nav-left", "nav-right", "nav-up", "object-fit", "object-position", - "opacity", "order", "orphans", "outline", - "outline-color", "outline-offset", "outline-style", "outline-width", - "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", - "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", - "page", "page-break-after", "page-break-before", "page-break-inside", - "page-policy", "pause", "pause-after", "pause-before", "perspective", - "perspective-origin", "pitch", "pitch-range", "play-during", "position", - "presentation-level", "punctuation-trim", "quotes", "region-break-after", - "region-break-before", "region-break-inside", "region-fragment", - "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", - "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", - "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", - "shape-outside", "size", "speak", "speak-as", "speak-header", - "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", - "tab-size", "table-layout", "target", "target-name", "target-new", - "target-position", "text-align", "text-align-last", "text-decoration", - "text-decoration-color", "text-decoration-line", "text-decoration-skip", - "text-decoration-style", "text-emphasis", "text-emphasis-color", - "text-emphasis-position", "text-emphasis-style", "text-height", - "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", - "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", - "text-wrap", "top", "transform", "transform-origin", "transform-style", - "transition", "transition-delay", "transition-duration", - "transition-property", "transition-timing-function", "unicode-bidi", - "vertical-align", "visibility", "voice-balance", "voice-duration", - "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", - "voice-volume", "volume", "white-space", "widows", "width", "word-break", - "word-spacing", "word-wrap", "z-index", - // SVG-specific - "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", - "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", - "color-interpolation", "color-interpolation-filters", - "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", - "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", - "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", - "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", - "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", - "glyph-orientation-vertical", "text-anchor", "writing-mode" - ], propertyKeywords = keySet(propertyKeywords_); - - var nonStandardPropertyKeywords_ = [ - "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", - "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", - "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside", - "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", - "searchfield-results-decoration", "zoom" - ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); - - var fontProperties_ = [ - "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", - "font-stretch", "font-weight", "font-style" - ], fontProperties = keySet(fontProperties_); - - var counterDescriptors_ = [ - "additive-symbols", "fallback", "negative", "pad", "prefix", "range", - "speak-as", "suffix", "symbols", "system" - ], counterDescriptors = keySet(counterDescriptors_); - - var colorKeywords_ = [ - "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", - "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", - "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", - "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", - "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", - "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", - "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", - "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", - "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", - "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", - "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", - "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", - "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", - "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", - "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", - "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", - "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", - "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", - "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", - "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", - "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", - "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", - "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", - "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", - "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", - "whitesmoke", "yellow", "yellowgreen" - ], colorKeywords = keySet(colorKeywords_); - - var valueKeywords_ = [ - "above", "absolute", "activeborder", "additive", "activecaption", "afar", - "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", - "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", - "arabic-indic", "armenian", "asterisks", "attr", "auto", "avoid", "avoid-column", "avoid-page", - "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", - "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", - "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel", - "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian", - "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", - "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", - "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", - "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", - "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop", - "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal", - "decimal-leading-zero", "default", "default-button", "destination-atop", - "destination-in", "destination-out", "destination-over", "devanagari", - "disc", "discard", "disclosure-closed", "disclosure-open", "document", - "dot-dash", "dot-dot-dash", - "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", - "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", - "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", - "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", - "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", - "ethiopic-halehame-gez", "ethiopic-halehame-om-et", - "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", - "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", - "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed", - "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "footnotes", - "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", - "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", - "help", "hidden", "hide", "higher", "highlight", "highlighttext", - "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", - "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", - "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", - "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert", - "italic", "japanese-formal", "japanese-informal", "justify", "kannada", - "katakana", "katakana-iroha", "keep-all", "khmer", - "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", - "landscape", "lao", "large", "larger", "left", "level", "lighter", - "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", - "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", - "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", - "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d", - "media-controls-background", "media-current-time-display", - "media-fullscreen-button", "media-mute-button", "media-play-button", - "media-return-to-realtime-button", "media-rewind-button", - "media-seek-back-button", "media-seek-forward-button", "media-slider", - "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", - "media-volume-slider-container", "media-volume-sliderthumb", "medium", - "menu", "menulist", "menulist-button", "menulist-text", - "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", - "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", - "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", - "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", - "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", - "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", - "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", - "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter", - "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", - "progress", "push-button", "radial-gradient", "radio", "read-only", - "read-write", "read-write-plaintext-only", "rectangle", "region", - "relative", "repeat", "repeating-linear-gradient", - "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse", - "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", - "rotateZ", "round", "row-resize", "rtl", "run-in", "running", - "s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", - "scroll", "scrollbar", "se-resize", "searchfield", - "searchfield-cancel-button", "searchfield-decoration", - "searchfield-results-button", "searchfield-results-decoration", - "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", - "simp-chinese-formal", "simp-chinese-informal", "single", - "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", - "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", - "small", "small-caps", "small-caption", "smaller", "solid", "somali", - "source-atop", "source-in", "source-out", "source-over", "space", "spell-out", "square", - "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", - "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table", - "table-caption", "table-cell", "table-column", "table-column-group", - "table-footer-group", "table-header-group", "table-row", "table-row-group", - "tamil", - "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", - "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", - "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", - "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", - "trad-chinese-formal", "trad-chinese-informal", - "translate", "translate3d", "translateX", "translateY", "translateZ", - "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", - "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", - "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", - "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", - "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", - "window", "windowframe", "windowtext", "words", "x-large", "x-small", "xor", - "xx-large", "xx-small" - ], valueKeywords = keySet(valueKeywords_); - - var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(propertyKeywords_) - .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_); - CodeMirror.registerHelper("hintWords", "css", allWords); - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return ["comment", "comment"]; - } - - CodeMirror.defineMIME("text/css", { - documentTypes: documentTypes, - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - fontProperties: fontProperties, - counterDescriptors: counterDescriptors, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - tokenHooks: { - "/": function(stream, state) { - if (!stream.eat("*")) return false; - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - }, - name: "css" - }); - - CodeMirror.defineMIME("text/x-scss", { - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - fontProperties: fontProperties, - allowNested: true, - tokenHooks: { - "/": function(stream, state) { - if (stream.eat("/")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } else if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else { - return ["operator", "operator"]; - } - }, - ":": function(stream) { - if (stream.match(/\s*\{/)) - return [null, "{"]; - return false; - }, - "$": function(stream) { - stream.match(/^[\w-]+/); - if (stream.match(/^\s*:/, false)) - return ["variable-2", "variable-definition"]; - return ["variable-2", "variable"]; - }, - "#": function(stream) { - if (!stream.eat("{")) return false; - return [null, "interpolation"]; - } - }, - name: "css", - helperType: "scss" - }); - - CodeMirror.defineMIME("text/x-less", { - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - fontProperties: fontProperties, - allowNested: true, - tokenHooks: { - "/": function(stream, state) { - if (stream.eat("/")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } else if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else { - return ["operator", "operator"]; - } - }, - "@": function(stream) { - if (stream.eat("{")) return [null, "interpolation"]; - if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; - stream.eatWhile(/[\w\\\-]/); - if (stream.match(/^\s*:/, false)) - return ["variable-2", "variable-definition"]; - return ["variable-2", "variable"]; - }, - "&": function() { - return ["atom", "atom"]; - } - }, - name: "css", - helperType: "less" - }); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/index.html deleted file mode 100644 index 2d2b9b0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: CSS mode - - - - - - - - - - - - -
                -

                CSS mode

                -
                - - -

                MIME types defined: text/css, text/x-scss (demo), text/x-less (demo).

                - -

                Parsing/Highlighting Tests: normal, verbose.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/less.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/less.html deleted file mode 100644 index adf7427..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/less.html +++ /dev/null @@ -1,152 +0,0 @@ - - -CodeMirror: LESS mode - - - - - - - - - - -
                -

                LESS mode

                -
                - - -

                The LESS mode is a sub-mode of the CSS mode (defined in css.js).

                - -

                Parsing/Highlighting Tests: normal, verbose.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/less_test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/less_test.js deleted file mode 100644 index 7b77f58..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/less_test.js +++ /dev/null @@ -1,54 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - "use strict"; - - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } - - MT("variable", - "[variable-2 @base]: [atom #f04615];", - "[qualifier .class] {", - " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", - " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", - "}"); - - MT("amp", - "[qualifier .child], [qualifier .sibling] {", - " [qualifier .parent] [atom &] {", - " [property color]: [keyword black];", - " }", - " [atom &] + [atom &] {", - " [property color]: [keyword red];", - " }", - "}"); - - MT("mixin", - "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", - " [property color]: [variable darken]([variable-2 @color], [number 10%]);", - "}", - "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", - " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", - "}", - "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", - " [property display]: [atom block];", - "}", - "[variable-2 @switch]: [variable light];", - "[qualifier .class] {", - " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", - "}"); - - MT("nest", - "[qualifier .one] {", - " [def @media] ([property width]: [number 400px]) {", - " [property font-size]: [number 1.2em];", - " [def @media] [attribute print] [keyword and] [property color] {", - " [property color]: [keyword blue];", - " }", - " }", - "}"); - - - MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }"); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/scss.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/scss.html deleted file mode 100644 index f8e4d37..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/scss.html +++ /dev/null @@ -1,157 +0,0 @@ - - -CodeMirror: SCSS mode - - - - - - - - - -
                -

                SCSS mode

                -
                - - -

                The SCSS mode is a sub-mode of the CSS mode (defined in css.js).

                - -

                Parsing/Highlighting Tests: normal, verbose.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/scss_test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/scss_test.js deleted file mode 100644 index 26c226a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/scss_test.js +++ /dev/null @@ -1,110 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } - - MT('url_with_quotation', - "[tag foo] { [property background]:[atom url]([string test.jpg]) }"); - - MT('url_with_double_quotes', - "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }"); - - MT('url_with_single_quotes', - "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }"); - - MT('string', - "[def @import] [string \"compass/css3\"]"); - - MT('important_keyword', - "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }"); - - MT('variable', - "[variable-2 $blue]:[atom #333]"); - - MT('variable_as_attribute', - "[tag foo] { [property color]:[variable-2 $blue] }"); - - MT('numbers', - "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"); - - MT('number_percentage', - "[tag foo] { [property width]:[number 80%] }"); - - MT('selector', - "[builtin #hello][qualifier .world]{}"); - - MT('singleline_comment', - "[comment // this is a comment]"); - - MT('multiline_comment', - "[comment /*foobar*/]"); - - MT('attribute_with_hyphen', - "[tag foo] { [property font-size]:[number 10px] }"); - - MT('string_after_attribute', - "[tag foo] { [property content]:[string \"::\"] }"); - - MT('directives', - "[def @include] [qualifier .mixin]"); - - MT('basic_structure', - "[tag p] { [property background]:[keyword red]; }"); - - MT('nested_structure', - "[tag p] { [tag a] { [property color]:[keyword red]; } }"); - - MT('mixin', - "[def @mixin] [tag table-base] {}"); - - MT('number_without_semicolon', - "[tag p] {[property width]:[number 12]}", - "[tag a] {[property color]:[keyword red];}"); - - MT('atom_in_nested_block', - "[tag p] { [tag a] { [property color]:[atom #000]; } }"); - - MT('interpolation_in_property', - "[tag foo] { #{[variable-2 $hello]}:[number 2]; }"); - - MT('interpolation_in_selector', - "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"); - - MT('interpolation_error', - "[tag foo]#{[variable foo]} { [property color]:[atom #000]; }"); - - MT("divide_operator", - "[tag foo] { [property width]:[number 4] [operator /] [number 2] }"); - - MT('nested_structure_with_id_selector', - "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"); - - MT('indent_mixin', - "[def @mixin] [tag container] (", - " [variable-2 $a]: [number 10],", - " [variable-2 $b]: [number 10])", - "{}"); - - MT('indent_nested', - "[tag foo] {", - " [tag bar] {", - " }", - "}"); - - MT('indent_parentheses', - "[tag foo] {", - " [property color]: [variable darken]([variable-2 $blue],", - " [number 9%]);", - "}"); - - MT('indent_vardef', - "[variable-2 $name]:", - " [string 'val'];", - "[tag tag] {", - " [tag inner] {", - " [property margin]: [number 3px];", - " }", - "}"); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/test.js deleted file mode 100644 index 55ae676..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/css/test.js +++ /dev/null @@ -1,188 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "css"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - // Error, because "foobarhello" is neither a known type or property, but - // property was expected (after "and"), and it should be in parenthese. - MT("atMediaUnknownType", - "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); - - // Soft error, because "foobarhello" is not a known property or type. - MT("atMediaUnknownProperty", - "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"); - - // Make sure nesting works with media queries - MT("atMediaMaxWidthNested", - "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); - - MT("tagSelector", - "[tag foo] { }"); - - MT("classSelector", - "[qualifier .foo-bar_hello] { }"); - - MT("idSelector", - "[builtin #foo] { [error #foo] }"); - - MT("tagSelectorUnclosed", - "[tag foo] { [property margin]: [number 0] } [tag bar] { }"); - - MT("tagStringNoQuotes", - "[tag foo] { [property font-family]: [variable hello] [variable world]; }"); - - MT("tagStringDouble", - "[tag foo] { [property font-family]: [string \"hello world\"]; }"); - - MT("tagStringSingle", - "[tag foo] { [property font-family]: [string 'hello world']; }"); - - MT("tagColorKeyword", - "[tag foo] {", - " [property color]: [keyword black];", - " [property color]: [keyword navy];", - " [property color]: [keyword yellow];", - "}"); - - MT("tagColorHex3", - "[tag foo] { [property background]: [atom #fff]; }"); - - MT("tagColorHex6", - "[tag foo] { [property background]: [atom #ffffff]; }"); - - MT("tagColorHex4", - "[tag foo] { [property background]: [atom&error #ffff]; }"); - - MT("tagColorHexInvalid", - "[tag foo] { [property background]: [atom&error #ffg]; }"); - - MT("tagNegativeNumber", - "[tag foo] { [property margin]: [number -5px]; }"); - - MT("tagPositiveNumber", - "[tag foo] { [property padding]: [number 5px]; }"); - - MT("tagVendor", - "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"); - - MT("tagBogusProperty", - "[tag foo] { [property&error barhelloworld]: [number 0]; }"); - - MT("tagTwoProperties", - "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"); - - MT("tagTwoPropertiesURL", - "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"); - - MT("indent_tagSelector", - "[tag strong], [tag em] {", - " [property background]: [atom rgba](", - " [number 255], [number 255], [number 0], [number .2]", - " );", - "}"); - - MT("indent_atMedia", - "[def @media] {", - " [tag foo] {", - " [property color]:", - " [keyword yellow];", - " }", - "}"); - - MT("indent_comma", - "[tag foo] {", - " [property font-family]: [variable verdana],", - " [atom sans-serif];", - "}"); - - MT("indent_parentheses", - "[tag foo]:[variable-3 before] {", - " [property background]: [atom url](", - "[string blahblah]", - "[string etc]", - "[string ]) [keyword !important];", - "}"); - - MT("font_face", - "[def @font-face] {", - " [property font-family]: [string 'myfont'];", - " [error nonsense]: [string 'abc'];", - " [property src]: [atom url]([string http://blah]),", - " [atom url]([string http://foo]);", - "}"); - - MT("empty_url", - "[def @import] [tag url]() [tag screen];"); - - MT("parens", - "[qualifier .foo] {", - " [property background-image]: [variable fade]([atom #000], [number 20%]);", - " [property border-image]: [atom linear-gradient](", - " [atom to] [atom bottom],", - " [variable fade]([atom #000], [number 20%]) [number 0%],", - " [variable fade]([atom #000], [number 20%]) [number 100%]", - " );", - "}"); - - MT("css_variable", - ":[variable-3 root] {", - " [variable-2 --main-color]: [atom #06c];", - "}", - "[tag h1][builtin #foo] {", - " [property color]: [atom var]([variable-2 --main-color]);", - "}"); - - MT("supports", - "[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {", - " [property text-align-last]: [atom justify];", - "}"); - - MT("document", - "[def @document] [tag url]([string http://blah]),", - " [tag url-prefix]([string https://]),", - " [tag domain]([string blah.com]),", - " [tag regexp]([string \".*blah.+\"]) {", - " [builtin #id] {", - " [property background-color]: [keyword white];", - " }", - " [tag foo] {", - " [property font-family]: [variable Verdana], [atom sans-serif];", - " }", - " }"); - - MT("document_url", - "[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"); - - MT("document_urlPrefix", - "[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"); - - MT("document_domain", - "[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"); - - MT("document_regexp", - "[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }"); - - MT("counter-style", - "[def @counter-style] [variable binary] {", - " [property system]: [atom numeric];", - " [property symbols]: [number 0] [number 1];", - " [property suffix]: [string \".\"];", - " [property range]: [atom infinite];", - " [property speak-as]: [atom numeric];", - "}"); - - MT("counter-style-additive-symbols", - "[def @counter-style] [variable simple-roman] {", - " [property system]: [atom additive];", - " [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];", - " [property range]: [number 1] [number 49];", - "}"); - - MT("counter-style-use", - "[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"); - - MT("counter-style-symbols", - "[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }"); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/diff/diff.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/diff/diff.js deleted file mode 100644 index fe0305e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/diff/diff.js +++ /dev/null @@ -1,47 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("diff", function() { - - var TOKEN_NAMES = { - '+': 'positive', - '-': 'negative', - '@': 'meta' - }; - - return { - token: function(stream) { - var tw_pos = stream.string.search(/[\t ]+?$/); - - if (!stream.sol() || tw_pos === 0) { - stream.skipToEnd(); - return ("error " + ( - TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); - } - - var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); - - if (tw_pos === -1) { - stream.skipToEnd(); - } else { - stream.pos = tw_pos; - } - - return token_name; - } - }; -}); - -CodeMirror.defineMIME("text/x-diff", "diff"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/diff/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/diff/index.html deleted file mode 100644 index 0af611f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/diff/index.html +++ /dev/null @@ -1,117 +0,0 @@ - - -CodeMirror: Diff mode - - - - - - - - - -
                -

                Diff mode

                -
                - - -

                MIME types defined: text/x-diff.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/dtd/dtd.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/dtd/dtd.js deleted file mode 100644 index f37029a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/dtd/dtd.js +++ /dev/null @@ -1,142 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* - DTD mode - Ported to CodeMirror by Peter Kroon - Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues - GitHub: @peterkroon -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("dtd", function(config) { - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - var ch = stream.next(); - - if (ch == "<" && stream.eat("!") ) { - if (stream.eatWhile(/[\-]/)) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } else if (stream.eatWhile(/[\w]/)) return ret("keyword", "doindent"); - } else if (ch == "<" && stream.eat("?")) { //xml declaration - state.tokenize = inBlock("meta", "?>"); - return ret("meta", ch); - } else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag"); - else if (ch == "|") return ret("keyword", "seperator"); - else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else - else if (ch.match(/[\[\]]/)) return ret("rule", ch); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (stream.eatWhile(/[a-zA-Z\?\+\d]/)) { - var sc = stream.current(); - if( sc.substr(sc.length-1,sc.length).match(/\?|\+/) !== null )stream.backUp(1); - return ret("tag", "tag"); - } else if (ch == "%" || ch == "*" ) return ret("number", "number"); - else { - stream.eatWhile(/[\w\\\-_%.{,]/); - return ret(null, null); - } - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return ret("string", "tag"); - }; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = tokenBase; - break; - } - stream.next(); - } - return style; - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (stream.current() == "[" || type === "doindent" || type == "[") state.stack.push("rule"); - else if (type === "endtag") state.stack[state.stack.length-1] = "endtag"; - else if (stream.current() == "]" || type == "]" || (type == ">" && context == "rule")) state.stack.pop(); - else if (type == "[") state.stack.push("["); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - - if( textAfter.match(/\]\s+|\]/) )n=n-1; - else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){ - if(textAfter.substr(0,1) === "<")n; - else if( type == "doindent" && textAfter.length > 1 )n; - else if( type == "doindent")n--; - else if( type == ">" && textAfter.length > 1)n; - else if( type == "tag" && textAfter !== ">")n; - else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--; - else if( type == "tag")n++; - else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--; - else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n; - else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1; - else if( textAfter === ">")n; - else n=n-1; - //over rule them all - if(type == null || type == "]")n--; - } - - return state.baseIndent + n * indentUnit; - }, - - electricChars: "]>" - }; -}); - -CodeMirror.defineMIME("application/xml-dtd", "dtd"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/dtd/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/dtd/index.html deleted file mode 100644 index e6798a7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/dtd/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: DTD mode - - - - - - - - - -
                -

                DTD mode

                -
                - - -

                MIME types defined: application/xml-dtd.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/go/go.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/go/go.js deleted file mode 100644 index b121f4e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/go/go.js +++ /dev/null @@ -1,185 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("go", function(config) { - var indentUnit = config.indentUnit; - - var keywords = { - "break":true, "case":true, "chan":true, "const":true, "continue":true, - "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, - "func":true, "go":true, "goto":true, "if":true, "import":true, - "interface":true, "map":true, "package":true, "range":true, "return":true, - "select":true, "struct":true, "switch":true, "type":true, "var":true, - "bool":true, "byte":true, "complex64":true, "complex128":true, - "float32":true, "float64":true, "int8":true, "int16":true, "int32":true, - "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true, - "uint64":true, "int":true, "uint":true, "uintptr":true - }; - - var atoms = { - "true":true, "false":true, "iota":true, "nil":true, "append":true, - "cap":true, "close":true, "complex":true, "copy":true, "imag":true, - "len":true, "make":true, "new":true, "panic":true, "print":true, - "println":true, "real":true, "recover":true - }; - - var isOperatorChar = /[+\-*&^%:=<>!|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'" || ch == "`") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\d\.]/.test(ch)) { - if (ch == ".") { - stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); - } else if (ch == "0") { - stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); - } else { - stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); - } - return "number"; - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (cur == "case" || cur == "default") curPunc = "case"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || quote == "`")) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - if (!state.context.prev) return; - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - if (ctx.type == "case") ctx.type = "}"; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "case") ctx.type = "case"; - else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state); - else if (curPunc == ctx.type) popContext(state); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) { - state.context.type = "}"; - return ctx.indented; - } - var closing = firstChar == ctx.type; - if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}):", - fold: "brace", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-go", "go"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/go/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/go/index.html deleted file mode 100644 index 72e3b36..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/go/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: Go mode - - - - - - - - - - - -
                -

                Go mode

                -
                - - - -

                MIME type: text/x-go

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlembedded/htmlembedded.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlembedded/htmlembedded.js deleted file mode 100644 index 464dc57..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlembedded/htmlembedded.js +++ /dev/null @@ -1,28 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), - require("../../addon/mode/multiplex")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", - "../../addon/mode/multiplex"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { - return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { - open: parserConfig.open || parserConfig.scriptStartRegex || "<%", - close: parserConfig.close || parserConfig.scriptEndRegex || "%>", - mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) - }); - }, "htmlmixed"); - - CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); - CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); - CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); - CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlembedded/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlembedded/index.html deleted file mode 100644 index 365ef8f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlembedded/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - -CodeMirror: Html Embedded Scripts mode - - - - - - - - - - - - - - -
                -

                Html Embedded Scripts mode

                -
                - - - -

                Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on - JavaScript, CSS and XML.
                Other dependancies include those of the scriping language chosen.

                - -

                MIME types defined: application/x-aspx (ASP.NET), - application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlmixed/htmlmixed.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlmixed/htmlmixed.js deleted file mode 100644 index 24552e2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlmixed/htmlmixed.js +++ /dev/null @@ -1,121 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, {name: "xml", - htmlMode: true, - multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, - multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag}); - var cssMode = CodeMirror.getMode(config, "css"); - - var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes; - scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, - mode: CodeMirror.getMode(config, "javascript")}); - if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) { - var conf = scriptTypesConf[i]; - scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)}); - } - scriptTypes.push({matches: /./, - mode: CodeMirror.getMode(config, "text/plain")}); - - function html(stream, state) { - var tagName = state.htmlState.tagName; - if (tagName) tagName = tagName.toLowerCase(); - var style = htmlMode.token(stream, state.htmlState); - if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") { - // Script block: mode to change to depends on type attribute - var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); - scriptType = scriptType ? scriptType[1] : ""; - if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); - for (var i = 0; i < scriptTypes.length; ++i) { - var tp = scriptTypes[i]; - if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { - if (tp.mode) { - state.token = script; - state.localMode = tp.mode; - state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); - } - break; - } - } - } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { - state.token = css; - state.localMode = cssMode; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - } - return style; - } - function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat); - if (close > -1) stream.backUp(cur.length - close); - else if (cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur); - } - return style; - } - function script(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; - } - return maybeBackup(stream, /<\/\s*script\s*>/, - state.localMode.token(stream, state.localState)); - } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; - } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); - } - - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localMode: null, localState: null, htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.localMode, state.localState); - return {token: state.token, localMode: state.localMode, localState: local, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (!state.localMode || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.localMode.indent) - return state.localMode.indent(state.localState, textAfter); - else - return CodeMirror.Pass; - }, - - innerMode: function(state) { - return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; - } - }; -}, "xml", "javascript", "css"); - -CodeMirror.defineMIME("text/html", "htmlmixed"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlmixed/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlmixed/index.html deleted file mode 100644 index f94df9e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/htmlmixed/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: HTML mixed mode - - - - - - - - - - - - - - -
                -

                HTML mixed mode

                -
                - - -

                The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

                - -

                It takes an optional mode configuration - option, scriptTypes, which can be used to add custom - behavior for specific <script type="..."> tags. If - given, it should hold an array of {matches, mode} - objects, where matches is a string or regexp that - matches the script type, and mode is - either null, for script types that should stay in - HTML mode, or a mode - spec corresponding to the mode that should be used for the - script.

                - -

                MIME types defined: text/html - (redefined, only takes effect if you load this parser after the - XML parser).

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/http/http.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/http/http.js deleted file mode 100644 index 9a3c5f9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/http/http.js +++ /dev/null @@ -1,113 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("http", function() { - function failFirstLine(stream, state) { - stream.skipToEnd(); - state.cur = header; - return "error"; - } - - function start(stream, state) { - if (stream.match(/^HTTP\/\d\.\d/)) { - state.cur = responseStatusCode; - return "keyword"; - } else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) { - state.cur = requestPath; - return "keyword"; - } else { - return failFirstLine(stream, state); - } - } - - function responseStatusCode(stream, state) { - var code = stream.match(/^\d+/); - if (!code) return failFirstLine(stream, state); - - state.cur = responseStatusText; - var status = Number(code[0]); - if (status >= 100 && status < 200) { - return "positive informational"; - } else if (status >= 200 && status < 300) { - return "positive success"; - } else if (status >= 300 && status < 400) { - return "positive redirect"; - } else if (status >= 400 && status < 500) { - return "negative client-error"; - } else if (status >= 500 && status < 600) { - return "negative server-error"; - } else { - return "error"; - } - } - - function responseStatusText(stream, state) { - stream.skipToEnd(); - state.cur = header; - return null; - } - - function requestPath(stream, state) { - stream.eatWhile(/\S/); - state.cur = requestProtocol; - return "string-2"; - } - - function requestProtocol(stream, state) { - if (stream.match(/^HTTP\/\d\.\d$/)) { - state.cur = header; - return "keyword"; - } else { - return failFirstLine(stream, state); - } - } - - function header(stream) { - if (stream.sol() && !stream.eat(/[ \t]/)) { - if (stream.match(/^.*?:/)) { - return "atom"; - } else { - stream.skipToEnd(); - return "error"; - } - } else { - stream.skipToEnd(); - return "string"; - } - } - - function body(stream) { - stream.skipToEnd(); - return null; - } - - return { - token: function(stream, state) { - var cur = state.cur; - if (cur != header && cur != body && stream.eatSpace()) return null; - return cur(stream, state); - }, - - blankLine: function(state) { - state.cur = body; - }, - - startState: function() { - return {cur: start}; - } - }; -}); - -CodeMirror.defineMIME("message/http", "http"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/http/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/http/index.html deleted file mode 100644 index 0b8d531..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/http/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - -CodeMirror: HTTP mode - - - - - - - - - -
                -

                HTTP mode

                - - -
                - - - -

                MIME types defined: message/http.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/index.html deleted file mode 100644 index ca1703a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/index.html +++ /dev/null @@ -1,149 +0,0 @@ - - -CodeMirror: Language Modes - - - - - -
                - -

                Language modes

                - -

                This is a list of every mode in the distribution. Each mode lives -in a subdirectory of the mode/ directory, and typically -defines a single JavaScript file that implements the mode. Loading -such file will make the language available to CodeMirror, through -the mode -option.

                - -
                - -
                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/index.html deleted file mode 100644 index 592a133..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - -CodeMirror: JavaScript mode - - - - - - - - - - - - -
                -

                JavaScript mode

                - - -
                - - - -

                - JavaScript mode supports several configuration options: -

                  -
                • json which will set the mode to expect JSON - data rather than a JavaScript program.
                • -
                • jsonld which will set the mode to expect - JSON-LD linked data rather - than a JavaScript program (demo).
                • -
                • typescript which will activate additional - syntax highlighting and some other things for TypeScript code - (demo).
                • -
                • statementIndent which (given a number) will - determine the amount of indentation to use for statements - continued on a new line.
                • -
                • wordCharacters, a regexp that indicates which - characters should be considered part of an identifier. - Defaults to /[\w$]/, which does not handle - non-ASCII identifiers. Can be set to something more elaborate - to improve Unicode support.
                • -
                -

                - -

                MIME types defined: text/javascript, application/json, application/ld+json, text/typescript, application/typescript.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/javascript.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/javascript.js deleted file mode 100644 index c86f49e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/javascript.js +++ /dev/null @@ -1,704 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// TODO actually recognize syntax of TypeScript constructs - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var statementIndent = parserConfig.statementIndent; - var jsonldMode = parserConfig.jsonld; - var jsonMode = parserConfig.json || jsonldMode; - var isTS = parserConfig.typescript; - var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - - var jsKeywords = { - "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C, - "var": kw("var"), "const": kw("var"), "let": kw("var"), - "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, - "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"), - "yield": C, "export": kw("export"), "import": kw("import"), "extends": C - }; - - // Extend the 'normal' keywords with the TypeScript language extensions - if (isTS) { - var type = {type: "variable", style: "variable-3"}; - var tsKeywords = { - // object-like things - "interface": kw("interface"), - "extends": kw("extends"), - "constructor": kw("constructor"), - - // scope modifiers - "public": kw("public"), - "private": kw("private"), - "protected": kw("protected"), - "static": kw("static"), - - // types - "string": type, "number": type, "bool": type, "any": type - }; - - for (var attr in tsKeywords) { - jsKeywords[attr] = tsKeywords[attr]; - } - } - - return jsKeywords; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|~^]/; - var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; - - function readRegexp(stream) { - var escaped = false, next, inSet = false; - while ((next = stream.next()) != null) { - if (!escaped) { - if (next == "/" && !inSet) return; - if (next == "[") inSet = true; - else if (inSet && next == "]") inSet = false; - } - escaped = !escaped && next == "\\"; - } - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { - return ret("number", "number"); - } else if (ch == "." && stream.match("..")) { - return ret("spread", "meta"); - } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return ret(ch); - } else if (ch == "=" && stream.eat(">")) { - return ret("=>", "operator"); - } else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); - return ret("number", "number"); - } else if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (state.lastType == "operator" || state.lastType == "keyword c" || - state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) { - readRegexp(stream); - stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); - return ret("regexp", "string-2"); - } else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator", stream.current()); - } - } else if (ch == "`") { - state.tokenize = tokenQuasi; - return tokenQuasi(stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return ret("error", "error"); - } else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator", stream.current()); - } else if (wordRE.test(ch)) { - stream.eatWhile(wordRE); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.lastType != ".") ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next; - if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ - state.tokenize = tokenBase; - return ret("jsonld-keyword", "meta"); - } - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenQuasi(stream, state) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && next == "\\"; - } - return ret("quasi", "string-2", stream.current()); - } - - var brackets = "([{}])"; - // This is a crude lookahead trick to try and notice that we're - // parsing the argument patterns for a fat-arrow function before we - // actually hit the arrow token. It only works if the arrow is on - // the same line as the arguments and there's no strange noise - // (comments) in between. Fallback is to only notice when we hit the - // arrow, and not declare the arguments as locals for the arrow - // body. - function findFatArrow(stream, state) { - if (state.fatArrowAt) state.fatArrowAt = null; - var arrow = stream.string.indexOf("=>", stream.start); - if (arrow < 0) return; - - var depth = 0, sawSomething = false; - for (var pos = arrow - 1; pos >= 0; --pos) { - var ch = stream.string.charAt(pos); - var bracket = brackets.indexOf(ch); - if (bracket >= 0 && bracket < 3) { - if (!depth) { ++pos; break; } - if (--depth == 0) break; - } else if (bracket >= 3 && bracket < 6) { - ++depth; - } else if (wordRE.test(ch)) { - sawSomething = true; - } else if (/["'\/]/.test(ch)) { - return; - } else if (sawSomething && !depth) { - ++pos; - break; - } - } - if (sawSomething && !depth) state.fatArrowAt = pos; - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - for (var cx = state.context; cx; cx = cx.prev) { - for (var v = cx.vars; v; v = v.next) - if (v.name == varname) return true; - } - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function register(varname) { - function inList(list) { - for (var v = list; v; v = v.next) - if (v.name == varname) return true; - return false; - } - var state = cx.state; - if (state.context) { - cx.marked = "def"; - if (inList(state.localVars)) return; - state.localVars = {name: varname, next: state.localVars}; - } else { - if (inList(state.globalVars)) return; - if (parserConfig.globalVars) - state.globalVars = {name: varname, next: state.globalVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: {name: "arguments"}}; - function pushcontext() { - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - cx.state.localVars = defaultVars; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - function pushlex(type, info) { - var result = function() { - var state = cx.state, indent = state.indented; - if (state.lexical.type == "stat") indent = state.lexical.indented; - else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) - indent = outer.indented; - state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - function exp(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(exp); - }; - return exp; - } - - function statement(type, value) { - if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), block, poplex); - if (type == ";") return cont(); - if (type == "if") { - if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) - cx.state.cc.pop()(); - return cont(pushlex("form"), expression, statement, poplex, maybeelse); - } - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex); - if (type == "class") return cont(pushlex("form"), className, poplex); - if (type == "export") return cont(pushlex("form"), afterExport, poplex); - if (type == "import") return cont(pushlex("form"), afterImport, poplex); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - return expressionInner(type, false); - } - function expressionNoComma(type) { - return expressionInner(type, true); - } - function expressionInner(type, noComma) { - if (cx.state.fatArrowAt == cx.stream.start) { - var body = noComma ? arrowBodyNoComma : arrowBody; - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); - else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); - } - - var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; - if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); - if (type == "function") return cont(functiondef, maybeop); - if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); - if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop); - if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); - if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); - if (type == "{") return contCommasep(objprop, "}", null, maybeop); - if (type == "quasi") { return pass(quasi, maybeop); } - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - function maybeexpressionNoComma(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expressionNoComma); - } - - function maybeoperatorComma(type, value) { - if (type == ",") return cont(expression); - return maybeoperatorNoComma(type, value, false); - } - function maybeoperatorNoComma(type, value, noComma) { - var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; - var expr = noComma == false ? expression : expressionNoComma; - if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); - if (type == "operator") { - if (/\+\+|--/.test(value)) return cont(me); - if (value == "?") return cont(expression, expect(":"), expr); - return cont(expr); - } - if (type == "quasi") { return pass(quasi, me); } - if (type == ";") return; - if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); - if (type == ".") return cont(property, me); - if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); - } - function quasi(type, value) { - if (type != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasi); - return cont(expression, continueQuasi); - } - function continueQuasi(type) { - if (type == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasi); - } - } - function arrowBody(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expression); - } - function arrowBodyNoComma(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expressionNoComma); - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperatorComma, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type, value) { - if (type == "variable" || cx.style == "keyword") { - cx.marked = "property"; - if (value == "get" || value == "set") return cont(getterSetter); - return cont(afterprop); - } else if (type == "number" || type == "string") { - cx.marked = jsonldMode ? "property" : (cx.style + " property"); - return cont(afterprop); - } else if (type == "jsonld-keyword") { - return cont(afterprop); - } else if (type == "[") { - return cont(expression, expect("]"), afterprop); - } - } - function getterSetter(type) { - if (type != "variable") return pass(afterprop); - cx.marked = "property"; - return cont(functiondef); - } - function afterprop(type) { - if (type == ":") return cont(expressionNoComma); - if (type == "(") return pass(functiondef); - } - function commasep(what, end) { - function proceed(type) { - if (type == ",") { - var lex = cx.state.lexical; - if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; - return cont(what, proceed); - } - if (type == end) return cont(); - return cont(expect(end)); - } - return function(type) { - if (type == end) return cont(); - return pass(what, proceed); - }; - } - function contCommasep(what, end, info) { - for (var i = 3; i < arguments.length; i++) - cx.cc.push(arguments[i]); - return cont(pushlex(end, info), commasep(what, end), poplex); - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function maybetype(type) { - if (isTS && type == ":") return cont(typedef); - } - function maybedefault(_, value) { - if (value == "=") return cont(expressionNoComma); - } - function typedef(type) { - if (type == "variable") {cx.marked = "variable-3"; return cont();} - } - function vardef() { - return pass(pattern, maybetype, maybeAssign, vardefCont); - } - function pattern(type, value) { - if (type == "variable") { register(value); return cont(); } - if (type == "[") return contCommasep(pattern, "]"); - if (type == "{") return contCommasep(proppattern, "}"); - } - function proppattern(type, value) { - if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { - register(value); - return cont(maybeAssign); - } - if (type == "variable") cx.marked = "property"; - return cont(expect(":"), pattern, maybeAssign); - } - function maybeAssign(_type, value) { - if (value == "=") return cont(expressionNoComma); - } - function vardefCont(type) { - if (type == ",") return cont(vardef); - } - function maybeelse(type, value) { - if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); - } - function forspec(type) { - if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); - } - function forspec1(type) { - if (type == "var") return cont(vardef, expect(";"), forspec2); - if (type == ";") return cont(forspec2); - if (type == "variable") return cont(formaybeinof); - return pass(expression, expect(";"), forspec2); - } - function formaybeinof(_type, value) { - if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } - return cont(maybeoperatorComma, forspec2); - } - function forspec2(type, value) { - if (type == ";") return cont(forspec3); - if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } - return pass(expression, expect(";"), forspec3); - } - function forspec3(type) { - if (type != ")") cont(expression); - } - function functiondef(type, value) { - if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext); - } - function funarg(type) { - if (type == "spread") return cont(funarg); - return pass(pattern, maybetype, maybedefault); - } - function className(type, value) { - if (type == "variable") {register(value); return cont(classNameAfter);} - } - function classNameAfter(type, value) { - if (value == "extends") return cont(expression, classNameAfter); - if (type == "{") return cont(pushlex("}"), classBody, poplex); - } - function classBody(type, value) { - if (type == "variable" || cx.style == "keyword") { - if (value == "static") { - cx.marked = "keyword"; - return cont(classBody); - } - cx.marked = "property"; - if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); - return cont(functiondef, classBody); - } - if (value == "*") { - cx.marked = "keyword"; - return cont(classBody); - } - if (type == ";") return cont(classBody); - if (type == "}") return cont(); - } - function classGetterSetter(type) { - if (type != "variable") return pass(); - cx.marked = "property"; - return cont(); - } - function afterModule(type, value) { - if (type == "string") return cont(statement); - if (type == "variable") { register(value); return cont(maybeFrom); } - } - function afterExport(_type, value) { - if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } - if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } - return pass(statement); - } - function afterImport(type) { - if (type == "string") return cont(); - return pass(importSpec, maybeFrom); - } - function importSpec(type, value) { - if (type == "{") return contCommasep(importSpec, "}"); - if (type == "variable") register(value); - if (value == "*") cx.marked = "keyword"; - return cont(maybeAs); - } - function maybeAs(_type, value) { - if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } - } - function maybeFrom(_type, value) { - if (value == "from") { cx.marked = "keyword"; return cont(expression); } - } - function arrayLiteral(type) { - if (type == "]") return cont(); - return pass(expressionNoComma, maybeArrayComprehension); - } - function maybeArrayComprehension(type) { - if (type == "for") return pass(comprehension, expect("]")); - if (type == ",") return cont(commasep(maybeexpressionNoComma, "]")); - return pass(commasep(expressionNoComma, "]")); - } - function comprehension(type) { - if (type == "for") return cont(forspec, comprehension); - if (type == "if") return cont(expression, comprehension); - } - - function isContinuedStatement(state, textAfter) { - return state.lastType == "operator" || state.lastType == "," || - isOperatorChar.test(textAfter.charAt(0)) || - /[,.]/.test(textAfter.charAt(0)); - } - - // Interface - - return { - startState: function(basecolumn) { - var state = { - tokenize: tokenBase, - lastType: "sof", - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - context: parserConfig.localVars && {vars: parserConfig.localVars}, - indented: 0 - }; - if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") - state.globalVars = parserConfig.globalVars; - return state; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - findFatArrow(stream, state); - } - if (state.tokenize != tokenComment && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize == tokenComment) return CodeMirror.Pass; - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; - // Kludge to prevent 'maybelse' from blocking lexical scope pops - if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { - var c = state.cc[i]; - if (c == poplex) lexical = lexical.prev; - else if (c != maybeelse) break; - } - if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; - if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") - lexical = lexical.prev; - var type = lexical.type, closing = firstChar == type; - - if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "form") return lexical.indented + indentUnit; - else if (type == "stat") - return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); - else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, - blockCommentStart: jsonMode ? null : "/*", - blockCommentEnd: jsonMode ? null : "*/", - lineComment: jsonMode ? null : "//", - fold: "brace", - closeBrackets: "()[]{}''\"\"``", - - helperType: jsonMode ? "json" : "javascript", - jsonldMode: jsonldMode, - jsonMode: jsonMode - }; -}); - -CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("text/ecmascript", "javascript"); -CodeMirror.defineMIME("application/javascript", "javascript"); -CodeMirror.defineMIME("application/x-javascript", "javascript"); -CodeMirror.defineMIME("application/ecmascript", "javascript"); -CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); -CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); -CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); -CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); -CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/json-ld.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/json-ld.html deleted file mode 100644 index 3a37f0b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/json-ld.html +++ /dev/null @@ -1,72 +0,0 @@ - - -CodeMirror: JSON-LD mode - - - - - - - - - - - - -
                -

                JSON-LD mode

                - - -
                - - - -

                This is a specialization of the JavaScript mode.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/test.js deleted file mode 100644 index 092d25d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/test.js +++ /dev/null @@ -1,205 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("locals", - "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); - - MT("comma-and-binop", - "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); - - MT("destructuring", - "([keyword function]([def a], [[[def b], [def c] ]]) {", - " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);", - " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", - "})();"); - - MT("class_body", - "[keyword class] [variable Foo] {", - " [property constructor]() {}", - " [property sayName]() {", - " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];", - " }", - "}"); - - MT("class", - "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {", - " [property get] [property prop]() { [keyword return] [number 24]; }", - " [property constructor]([def x], [def y]) {", - " [keyword super]([string 'something']);", - " [keyword this].[property x] [operator =] [variable-2 x];", - " }", - "}"); - - MT("module", - "[keyword module] [string 'foo'] {", - " [keyword export] [keyword let] [def x] [operator =] [number 42];", - " [keyword export] [keyword *] [keyword from] [string 'somewhere'];", - "}"); - - MT("import", - "[keyword function] [variable foo]() {", - " [keyword import] [def $] [keyword from] [string 'jquery'];", - " [keyword module] [def crypto] [keyword from] [string 'crypto'];", - " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", - "}"); - - MT("const", - "[keyword function] [variable f]() {", - " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", - "}"); - - MT("for/of", - "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"); - - MT("generator", - "[keyword function*] [variable repeat]([def n]) {", - " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", - " [keyword yield] [variable-2 i];", - "}"); - - MT("quotedStringAddition", - "[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"); - - MT("quotedFatArrow", - "[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"); - - MT("fatArrow", - "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", - "[variable a];", // No longer in scope - "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", - "[variable c];"); - - MT("spread", - "[keyword function] [variable f]([def a], [meta ...][def b]) {", - " [variable something]([variable-2 a], [meta ...][variable-2 b]);", - "}"); - - MT("comprehension", - "[keyword function] [variable f]() {", - " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];", - " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));", - "}"); - - MT("quasi", - "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); - - MT("quasi_no_function", - "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); - - MT("indent_statement", - "[keyword var] [variable x] [operator =] [number 10]", - "[variable x] [operator +=] [variable y] [operator +]", - " [atom Infinity]", - "[keyword debugger];"); - - MT("indent_if", - "[keyword if] ([number 1])", - " [keyword break];", - "[keyword else] [keyword if] ([number 2])", - " [keyword continue];", - "[keyword else]", - " [number 10];", - "[keyword if] ([number 1]) {", - " [keyword break];", - "} [keyword else] [keyword if] ([number 2]) {", - " [keyword continue];", - "} [keyword else] {", - " [number 10];", - "}"); - - MT("indent_for", - "[keyword for] ([keyword var] [variable i] [operator =] [number 0];", - " [variable i] [operator <] [number 100];", - " [variable i][operator ++])", - " [variable doSomething]([variable i]);", - "[keyword debugger];"); - - MT("indent_c_style", - "[keyword function] [variable foo]()", - "{", - " [keyword debugger];", - "}"); - - MT("indent_else", - "[keyword for] (;;)", - " [keyword if] ([variable foo])", - " [keyword if] ([variable bar])", - " [number 1];", - " [keyword else]", - " [number 2];", - " [keyword else]", - " [number 3];"); - - MT("indent_funarg", - "[variable foo]([number 10000],", - " [keyword function]([def a]) {", - " [keyword debugger];", - "};"); - - MT("indent_below_if", - "[keyword for] (;;)", - " [keyword if] ([variable foo])", - " [number 1];", - "[number 2];"); - - MT("multilinestring", - "[keyword var] [variable x] [operator =] [string 'foo\\]", - "[string bar'];"); - - MT("scary_regexp", - "[string-2 /foo[[/]]bar/];"); - - MT("indent_strange_array", - "[keyword var] [variable x] [operator =] [[", - " [number 1],,", - " [number 2],", - "]];", - "[number 10];"); - - MT("param_default", - "[keyword function] [variable foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {", - " [keyword return] [variable-2 x];", - "}"); - - var jsonld_mode = CodeMirror.getMode( - {indentUnit: 2}, - {name: "javascript", jsonld: true} - ); - function LD(name) { - test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1)); - } - - LD("json_ld_keywords", - '{', - ' [meta "@context"]: {', - ' [meta "@base"]: [string "http://example.com"],', - ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],', - ' [property "likesFlavor"]: {', - ' [meta "@container"]: [meta "@list"]', - ' [meta "@reverse"]: [string "@beFavoriteOf"]', - ' },', - ' [property "nick"]: { [meta "@container"]: [meta "@set"] },', - ' [property "nick"]: { [meta "@container"]: [meta "@index"] }', - ' },', - ' [meta "@graph"]: [[ {', - ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],', - ' [property "name"]: [string "John Lennon"],', - ' [property "modified"]: {', - ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],', - ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]', - ' }', - ' } ]]', - '}'); - - LD("json_ld_fake", - '{', - ' [property "@fake"]: [string "@fake"],', - ' [property "@contextual"]: [string "@identifier"],', - ' [property "user@domain.com"]: [string "@graphical"],', - ' [property "@ID"]: [string "@@ID"]', - '}'); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/typescript.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/typescript.html deleted file mode 100644 index 2cfc538..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/javascript/typescript.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: TypeScript mode - - - - - - - - - -
                -

                TypeScript mode

                - - -
                - - - -

                This is a specialization of the JavaScript mode.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/index.html deleted file mode 100644 index c3bb8df..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/index.html +++ /dev/null @@ -1,359 +0,0 @@ - - -CodeMirror: Markdown mode - - - - - - - - - - - -
                -

                Markdown mode

                -
                - - - -

                Optionally depends on the XML mode for properly highlighted inline XML blocks.

                - -

                MIME types defined: text/x-markdown.

                - -

                Parsing/Highlighting Tests: normal, verbose.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/markdown.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/markdown.js deleted file mode 100644 index 87c3ad3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/markdown.js +++ /dev/null @@ -1,781 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../xml/xml"), require("../meta")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml", "../meta"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - - var htmlFound = CodeMirror.modes.hasOwnProperty("xml"); - var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain"); - - function getMode(name) { - if (CodeMirror.findModeByName) { - var found = CodeMirror.findModeByName(name); - if (found) name = found.mime || found.mimes[0]; - } - var mode = CodeMirror.getMode(cmCfg, name); - return mode.name == "null" ? null : mode; - } - - // Should characters that affect highlighting be highlighted separate? - // Does not include characters that will be output (such as `1.` and `-` for lists) - if (modeCfg.highlightFormatting === undefined) - modeCfg.highlightFormatting = false; - - // Maximum number of nested blockquotes. Set to 0 for infinite nesting. - // Excess `>` will emit `error` token. - if (modeCfg.maxBlockquoteDepth === undefined) - modeCfg.maxBlockquoteDepth = 0; - - // Should underscores in words open/close em/strong? - if (modeCfg.underscoresBreakWords === undefined) - modeCfg.underscoresBreakWords = true; - - // Turn on fenced code blocks? ("```" to start/end) - if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false; - - // Turn on task lists? ("- [ ] " and "- [x] ") - if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; - - // Turn on strikethrough syntax - if (modeCfg.strikethrough === undefined) - modeCfg.strikethrough = false; - - var codeDepth = 0; - - var header = 'header' - , code = 'comment' - , quote = 'quote' - , list1 = 'variable-2' - , list2 = 'variable-3' - , list3 = 'keyword' - , hr = 'hr' - , image = 'tag' - , formatting = 'formatting' - , linkinline = 'link' - , linkemail = 'link' - , linktext = 'link' - , linkhref = 'string' - , em = 'em' - , strong = 'strong' - , strikethrough = 'strikethrough'; - - var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/ - , ulRE = /^[*\-+]\s+/ - , olRE = /^[0-9]+([.)])\s+/ - , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE - , atxHeaderRE = /^(#+)(?: |$)/ - , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ - , textRE = /^[^#!\[\]*_\\<>` "'(~]+/; - - function switchInline(stream, state, f) { - state.f = state.inline = f; - return f(stream, state); - } - - function switchBlock(stream, state, f) { - state.f = state.block = f; - return f(stream, state); - } - - - // Blocks - - function blankLine(state) { - // Reset linkTitle state - state.linkTitle = false; - // Reset EM state - state.em = false; - // Reset STRONG state - state.strong = false; - // Reset strikethrough state - state.strikethrough = false; - // Reset state.quote - state.quote = 0; - // Reset state.indentedCode - state.indentedCode = false; - if (!htmlFound && state.f == htmlBlock) { - state.f = inlineNormal; - state.block = blockNormal; - } - // Reset state.trailingSpace - state.trailingSpace = 0; - state.trailingSpaceNewLine = false; - // Mark this line as blank - state.thisLineHasContent = false; - return null; - } - - function blockNormal(stream, state) { - - var sol = stream.sol(); - - var prevLineIsList = state.list !== false, - prevLineIsIndentedCode = state.indentedCode; - - state.indentedCode = false; - - if (prevLineIsList) { - if (state.indentationDiff >= 0) { // Continued list - if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block - state.indentation -= state.indentationDiff; - } - state.list = null; - } else if (state.indentation > 0) { - state.list = null; - state.listDepth = Math.floor(state.indentation / 4); - } else { // No longer a list - state.list = false; - state.listDepth = 0; - } - } - - var match = null; - if (state.indentationDiff >= 4) { - stream.skipToEnd(); - if (prevLineIsIndentedCode || !state.prevLineHasContent) { - state.indentation -= 4; - state.indentedCode = true; - return code; - } else { - return null; - } - } else if (stream.eatSpace()) { - return null; - } else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) { - state.header = match[1].length; - if (modeCfg.highlightFormatting) state.formatting = "header"; - state.f = state.inline; - return getType(state); - } else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { - state.header = match[0].charAt(0) == '=' ? 1 : 2; - if (modeCfg.highlightFormatting) state.formatting = "header"; - state.f = state.inline; - return getType(state); - } else if (stream.eat('>')) { - state.quote = sol ? 1 : state.quote + 1; - if (modeCfg.highlightFormatting) state.formatting = "quote"; - stream.eatSpace(); - return getType(state); - } else if (stream.peek() === '[') { - return switchInline(stream, state, footnoteLink); - } else if (stream.match(hrRE, true)) { - state.hr = true; - return hr; - } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { - var listType = null; - if (stream.match(ulRE, true)) { - listType = 'ul'; - } else { - stream.match(olRE, true); - listType = 'ol'; - } - state.indentation += 4; - state.list = true; - state.listDepth++; - if (modeCfg.taskLists && stream.match(taskListRE, false)) { - state.taskList = true; - } - state.f = state.inline; - if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; - return getType(state); - } else if (modeCfg.fencedCodeBlocks && stream.match(/^```[ \t]*([\w+#]*)/, true)) { - // try switching mode - state.localMode = getMode(RegExp.$1); - if (state.localMode) state.localState = state.localMode.startState(); - state.f = state.block = local; - if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = true; - return getType(state); - } - - return switchInline(stream, state, state.inline); - } - - function htmlBlock(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if ((htmlFound && state.htmlState.tagStart === null && - (!state.htmlState.context && state.htmlState.tokenize.isInText)) || - (state.md_inside && stream.current().indexOf(">") > -1)) { - state.f = inlineNormal; - state.block = blockNormal; - state.htmlState = null; - } - return style; - } - - function local(stream, state) { - if (stream.sol() && stream.match("```", false)) { - state.localMode = state.localState = null; - state.f = state.block = leavingLocal; - return null; - } else if (state.localMode) { - return state.localMode.token(stream, state.localState); - } else { - stream.skipToEnd(); - return code; - } - } - - function leavingLocal(stream, state) { - stream.match("```"); - state.block = blockNormal; - state.f = inlineNormal; - if (modeCfg.highlightFormatting) state.formatting = "code-block"; - state.code = true; - var returnType = getType(state); - state.code = false; - return returnType; - } - - // Inline - function getType(state) { - var styles = []; - - if (state.formatting) { - styles.push(formatting); - - if (typeof state.formatting === "string") state.formatting = [state.formatting]; - - for (var i = 0; i < state.formatting.length; i++) { - styles.push(formatting + "-" + state.formatting[i]); - - if (state.formatting[i] === "header") { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.header); - } - - // Add `formatting-quote` and `formatting-quote-#` for blockquotes - // Add `error` instead if the maximum blockquote nesting depth is passed - if (state.formatting[i] === "quote") { - if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote); - } else { - styles.push("error"); - } - } - } - } - - if (state.taskOpen) { - styles.push("meta"); - return styles.length ? styles.join(' ') : null; - } - if (state.taskClosed) { - styles.push("property"); - return styles.length ? styles.join(' ') : null; - } - - if (state.linkHref) { - styles.push(linkhref, "url"); - } else { // Only apply inline styles to non-url text - if (state.strong) { styles.push(strong); } - if (state.em) { styles.push(em); } - if (state.strikethrough) { styles.push(strikethrough); } - - if (state.linkText) { styles.push(linktext); } - - if (state.code) { styles.push(code); } - } - - if (state.header) { styles.push(header); styles.push(header + "-" + state.header); } - - if (state.quote) { - styles.push(quote); - - // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth - if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(quote + "-" + state.quote); - } else { - styles.push(quote + "-" + modeCfg.maxBlockquoteDepth); - } - } - - if (state.list !== false) { - var listMod = (state.listDepth - 1) % 3; - if (!listMod) { - styles.push(list1); - } else if (listMod === 1) { - styles.push(list2); - } else { - styles.push(list3); - } - } - - if (state.trailingSpaceNewLine) { - styles.push("trailing-space-new-line"); - } else if (state.trailingSpace) { - styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b")); - } - - return styles.length ? styles.join(' ') : null; - } - - function handleText(stream, state) { - if (stream.match(textRE, true)) { - return getType(state); - } - return undefined; - } - - function inlineNormal(stream, state) { - var style = state.text(stream, state); - if (typeof style !== 'undefined') - return style; - - if (state.list) { // List marker (*, +, -, 1., etc) - state.list = null; - return getType(state); - } - - if (state.taskList) { - var taskOpen = stream.match(taskListRE, true)[1] !== "x"; - if (taskOpen) state.taskOpen = true; - else state.taskClosed = true; - if (modeCfg.highlightFormatting) state.formatting = "task"; - state.taskList = false; - return getType(state); - } - - state.taskOpen = false; - state.taskClosed = false; - - if (state.header && stream.match(/^#+$/, true)) { - if (modeCfg.highlightFormatting) state.formatting = "header"; - return getType(state); - } - - // Get sol() value now, before character is consumed - var sol = stream.sol(); - - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - if (modeCfg.highlightFormatting) { - var type = getType(state); - return type ? type + " formatting-escape" : "formatting-escape"; - } - } - - // Matches link titles present on next line - if (state.linkTitle) { - state.linkTitle = false; - var matchCh = ch; - if (ch === '(') { - matchCh = ')'; - } - matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; - if (stream.match(new RegExp(regex), true)) { - return linkhref; - } - } - - // If this block is changed, it may need to be updated in GFM mode - if (ch === '`') { - var previousFormatting = state.formatting; - if (modeCfg.highlightFormatting) state.formatting = "code"; - var t = getType(state); - var before = stream.pos; - stream.eatWhile('`'); - var difference = 1 + stream.pos - before; - if (!state.code) { - codeDepth = difference; - state.code = true; - return getType(state); - } else { - if (difference === codeDepth) { // Must be exact - state.code = false; - return t; - } - state.formatting = previousFormatting; - return getType(state); - } - } else if (state.code) { - return getType(state); - } - - if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { - stream.match(/\[[^\]]*\]/); - state.inline = state.f = linkHref; - return image; - } - - if (ch === '[' && stream.match(/.*\](\(.*\)| ?\[.*\])/, false)) { - state.linkText = true; - if (modeCfg.highlightFormatting) state.formatting = "link"; - return getType(state); - } - - if (ch === ']' && state.linkText && stream.match(/\(.*\)| ?\[.*\]/, false)) { - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - state.linkText = false; - state.inline = state.f = linkHref; - return type; - } - - if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { - state.f = state.inline = linkInline; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + linkinline; - } - - if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { - state.f = state.inline = linkInline; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + linkemail; - } - - if (ch === '<' && stream.match(/^(!--|\w)/, false)) { - var end = stream.string.indexOf(">", stream.pos); - if (end != -1) { - var atts = stream.string.substring(stream.start, end); - if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true; - } - stream.backUp(1); - state.htmlState = CodeMirror.startState(htmlMode); - return switchBlock(stream, state, htmlBlock); - } - - if (ch === '<' && stream.match(/^\/\w*?>/)) { - state.md_inside = false; - return "tag"; - } - - var ignoreUnderscore = false; - if (!modeCfg.underscoresBreakWords) { - if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) { - var prevPos = stream.pos - 2; - if (prevPos >= 0) { - var prevCh = stream.string.charAt(prevPos); - if (prevCh !== '_' && prevCh.match(/(\w)/, false)) { - ignoreUnderscore = true; - } - } - } - } - if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { - if (sol && stream.peek() === ' ') { - // Do nothing, surrounded by newline and space - } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG - if (modeCfg.highlightFormatting) state.formatting = "strong"; - var t = getType(state); - state.strong = false; - return t; - } else if (!state.strong && stream.eat(ch)) { // Add STRONG - state.strong = ch; - if (modeCfg.highlightFormatting) state.formatting = "strong"; - return getType(state); - } else if (state.em === ch) { // Remove EM - if (modeCfg.highlightFormatting) state.formatting = "em"; - var t = getType(state); - state.em = false; - return t; - } else if (!state.em) { // Add EM - state.em = ch; - if (modeCfg.highlightFormatting) state.formatting = "em"; - return getType(state); - } - } else if (ch === ' ') { - if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces - if (stream.peek() === ' ') { // Surrounded by spaces, ignore - return getType(state); - } else { // Not surrounded by spaces, back up pointer - stream.backUp(1); - } - } - } - - if (modeCfg.strikethrough) { - if (ch === '~' && stream.eatWhile(ch)) { - if (state.strikethrough) {// Remove strikethrough - if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; - var t = getType(state); - state.strikethrough = false; - return t; - } else if (stream.match(/^[^\s]/, false)) {// Add strikethrough - state.strikethrough = true; - if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; - return getType(state); - } - } else if (ch === ' ') { - if (stream.match(/^~~/, true)) { // Probably surrounded by space - if (stream.peek() === ' ') { // Surrounded by spaces, ignore - return getType(state); - } else { // Not surrounded by spaces, back up pointer - stream.backUp(2); - } - } - } - } - - if (ch === ' ') { - if (stream.match(/ +$/, false)) { - state.trailingSpace++; - } else if (state.trailingSpace) { - state.trailingSpaceNewLine = true; - } - } - - return getType(state); - } - - function linkInline(stream, state) { - var ch = stream.next(); - - if (ch === ">") { - state.f = state.inline = inlineNormal; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var type = getType(state); - if (type){ - type += " "; - } else { - type = ""; - } - return type + linkinline; - } - - stream.match(/^[^>]+/, true); - - return linkinline; - } - - function linkHref(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - var ch = stream.next(); - if (ch === '(' || ch === '[') { - state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]"); - if (modeCfg.highlightFormatting) state.formatting = "link-string"; - state.linkHref = true; - return getType(state); - } - return 'error'; - } - - function getLinkHrefInside(endChar) { - return function(stream, state) { - var ch = stream.next(); - - if (ch === endChar) { - state.f = state.inline = inlineNormal; - if (modeCfg.highlightFormatting) state.formatting = "link-string"; - var returnState = getType(state); - state.linkHref = false; - return returnState; - } - - if (stream.match(inlineRE(endChar), true)) { - stream.backUp(1); - } - - state.linkHref = true; - return getType(state); - }; - } - - function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, false)) { - state.f = footnoteLinkInside; - stream.next(); // Consume [ - if (modeCfg.highlightFormatting) state.formatting = "link"; - state.linkText = true; - return getType(state); - } - return switchInline(stream, state, inlineNormal); - } - - function footnoteLinkInside(stream, state) { - if (stream.match(/^\]:/, true)) { - state.f = state.inline = footnoteUrl; - if (modeCfg.highlightFormatting) state.formatting = "link"; - var returnType = getType(state); - state.linkText = false; - return returnType; - } - - stream.match(/^[^\]]+/, true); - - return linktext; - } - - function footnoteUrl(stream, state) { - // Check if space, and return NULL if so (to avoid marking the space) - if(stream.eatSpace()){ - return null; - } - // Match URL - stream.match(/^[^\s]+/, true); - // Check for link title - if (stream.peek() === undefined) { // End of line, set flag to check next line - state.linkTitle = true; - } else { // More content on line, check if link title - stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); - } - state.f = state.inline = inlineNormal; - return linkhref + " url"; - } - - var savedInlineRE = []; - function inlineRE(endChar) { - if (!savedInlineRE[endChar]) { - // Escape endChar for RegExp (taken from http://stackoverflow.com/a/494122/526741) - endChar = (endChar+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); - // Match any non-endChar, escaped character, as well as the closing - // endChar. - savedInlineRE[endChar] = new RegExp('^(?:[^\\\\]|\\\\.)*?(' + endChar + ')'); - } - return savedInlineRE[endChar]; - } - - var mode = { - startState: function() { - return { - f: blockNormal, - - prevLineHasContent: false, - thisLineHasContent: false, - - block: blockNormal, - htmlState: null, - indentation: 0, - - inline: inlineNormal, - text: handleText, - - formatting: false, - linkText: false, - linkHref: false, - linkTitle: false, - em: false, - strong: false, - header: 0, - hr: false, - taskList: false, - list: false, - listDepth: 0, - quote: 0, - trailingSpace: 0, - trailingSpaceNewLine: false, - strikethrough: false - }; - }, - - copyState: function(s) { - return { - f: s.f, - - prevLineHasContent: s.prevLineHasContent, - thisLineHasContent: s.thisLineHasContent, - - block: s.block, - htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), - indentation: s.indentation, - - localMode: s.localMode, - localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, - - inline: s.inline, - text: s.text, - formatting: false, - linkTitle: s.linkTitle, - em: s.em, - strong: s.strong, - strikethrough: s.strikethrough, - header: s.header, - hr: s.hr, - taskList: s.taskList, - list: s.list, - listDepth: s.listDepth, - quote: s.quote, - indentedCode: s.indentedCode, - trailingSpace: s.trailingSpace, - trailingSpaceNewLine: s.trailingSpaceNewLine, - md_inside: s.md_inside - }; - }, - - token: function(stream, state) { - - // Reset state.formatting - state.formatting = false; - - if (stream.sol()) { - var forceBlankLine = !!state.header || state.hr; - - // Reset state.header and state.hr - state.header = 0; - state.hr = false; - - if (stream.match(/^\s*$/, true) || forceBlankLine) { - state.prevLineHasContent = false; - blankLine(state); - return forceBlankLine ? this.token(stream, state) : null; - } else { - state.prevLineHasContent = state.thisLineHasContent; - state.thisLineHasContent = true; - } - - // Reset state.taskList - state.taskList = false; - - // Reset state.code - state.code = false; - - // Reset state.trailingSpace - state.trailingSpace = 0; - state.trailingSpaceNewLine = false; - - state.f = state.block; - var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; - var difference = Math.floor((indentation - state.indentation) / 4) * 4; - if (difference > 4) difference = 4; - var adjustedIndentation = state.indentation + difference; - state.indentationDiff = adjustedIndentation - state.indentation; - state.indentation = adjustedIndentation; - if (indentation > 0) return null; - } - return state.f(stream, state); - }, - - innerMode: function(state) { - if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode}; - if (state.localState) return {state: state.localState, mode: state.localMode}; - return {state: state, mode: mode}; - }, - - blankLine: blankLine, - - getType: getType, - - fold: "markdown" - }; - return mode; -}, "xml"); - -CodeMirror.defineMIME("text/x-markdown", "markdown"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/test.js deleted file mode 100644 index 7cd0bf4..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/markdown/test.js +++ /dev/null @@ -1,792 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true}); - function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } - - FT("formatting_emAsterisk", - "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"); - - FT("formatting_emUnderscore", - "[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"); - - FT("formatting_strongAsterisk", - "[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"); - - FT("formatting_strongUnderscore", - "[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"); - - FT("formatting_codeBackticks", - "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); - - FT("formatting_doubleBackticks", - "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); - - FT("formatting_atxHeader", - "[header&header-1&formatting&formatting-header&formatting-header-1 # ][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"); - - FT("formatting_setextHeader", - "foo", - "[header&header-1&formatting&formatting-header&formatting-header-1 =]"); - - FT("formatting_blockquote", - "[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"); - - FT("formatting_list", - "[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"); - FT("formatting_list", - "[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"); - - FT("formatting_link", - "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url (][string&url http://example.com/][string&formatting&formatting-link-string&url )]"); - - FT("formatting_linkReference", - "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url [][string&url bar][string&formatting&formatting-link-string&url ]]]", - "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string&url http://example.com/]"); - - FT("formatting_linkWeb", - "[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"); - - FT("formatting_linkEmail", - "[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"); - - FT("formatting_escape", - "[formatting-escape \\*]"); - - MT("plainText", - "foo"); - - // Don't style single trailing space - MT("trailingSpace1", - "foo "); - - // Two or more trailing spaces should be styled with line break character - MT("trailingSpace2", - "foo[trailing-space-a ][trailing-space-new-line ]"); - - MT("trailingSpace3", - "foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"); - - MT("trailingSpace4", - "foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"); - - // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) - MT("codeBlocksUsing4Spaces", - " [comment foo]"); - - // Code blocks using 4 spaces with internal indentation - MT("codeBlocksUsing4SpacesIndentation", - " [comment bar]", - " [comment hello]", - " [comment world]", - " [comment foo]", - "bar"); - - // Code blocks should end even after extra indented lines - MT("codeBlocksWithTrailingIndentedLine", - " [comment foo]", - " [comment bar]", - " [comment baz]", - " ", - "hello"); - - // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) - MT("codeBlocksUsing1Tab", - "\t[comment foo]"); - - // No code blocks directly after paragraph - // http://spec.commonmark.org/0.19/#example-65 - MT("noCodeBlocksAfterParagraph", - "Foo", - " Bar"); - - // Inline code using backticks - MT("inlineCodeUsingBackticks", - "foo [comment `bar`]"); - - // Block code using single backtick (shouldn't work) - MT("blockCodeSingleBacktick", - "[comment `]", - "foo", - "[comment `]"); - - // Unclosed backticks - // Instead of simply marking as CODE, it would be nice to have an - // incomplete flag for CODE, that is styled slightly different. - MT("unclosedBackticks", - "foo [comment `bar]"); - - // Per documentation: "To include a literal backtick character within a - // code span, you can use multiple backticks as the opening and closing - // delimiters" - MT("doubleBackticks", - "[comment ``foo ` bar``]"); - - // Tests based on Dingus - // http://daringfireball.net/projects/markdown/dingus - // - // Multiple backticks within an inline code block - MT("consecutiveBackticks", - "[comment `foo```bar`]"); - - // Multiple backticks within an inline code block with a second code block - MT("consecutiveBackticks", - "[comment `foo```bar`] hello [comment `world`]"); - - // Unclosed with several different groups of backticks - MT("unclosedBackticks", - "[comment ``foo ``` bar` hello]"); - - // Closed with several different groups of backticks - MT("closedBackticks", - "[comment ``foo ``` bar` hello``] world"); - - // atx headers - // http://daringfireball.net/projects/markdown/syntax#header - - MT("atxH1", - "[header&header-1 # foo]"); - - MT("atxH2", - "[header&header-2 ## foo]"); - - MT("atxH3", - "[header&header-3 ### foo]"); - - MT("atxH4", - "[header&header-4 #### foo]"); - - MT("atxH5", - "[header&header-5 ##### foo]"); - - MT("atxH6", - "[header&header-6 ###### foo]"); - - // http://spec.commonmark.org/0.19/#example-24 - MT("noAtxH7", - "####### foo"); - - // http://spec.commonmark.org/0.19/#example-25 - MT("noAtxH1WithoutSpace", - "#5 bolt"); - - // Inline styles should be parsed inside headers - MT("atxH1inline", - "[header&header-1 # foo ][header&header-1&em *bar*]"); - - // Setext headers - H1, H2 - // Per documentation, "Any number of underlining =’s or -’s will work." - // http://daringfireball.net/projects/markdown/syntax#header - // Ideally, the text would be marked as `header` as well, but this is - // not really feasible at the moment. So, instead, we're testing against - // what works today, to avoid any regressions. - // - // Check if single underlining = works - MT("setextH1", - "foo", - "[header&header-1 =]"); - - // Check if 3+ ='s work - MT("setextH1", - "foo", - "[header&header-1 ===]"); - - // Check if single underlining - works - MT("setextH2", - "foo", - "[header&header-2 -]"); - - // Check if 3+ -'s work - MT("setextH2", - "foo", - "[header&header-2 ---]"); - - // http://spec.commonmark.org/0.19/#example-45 - MT("setextH2AllowSpaces", - "foo", - " [header&header-2 ---- ]"); - - // http://spec.commonmark.org/0.19/#example-44 - MT("noSetextAfterIndentedCodeBlock", - " [comment foo]", - "[hr ---]"); - - // http://spec.commonmark.org/0.19/#example-51 - MT("noSetextAfterQuote", - "[quote"e-1 > foo]", - "[hr ---]"); - - MT("noSetextAfterList", - "[variable-2 - foo]", - "[hr ---]"); - - // Single-line blockquote with trailing space - MT("blockquoteSpace", - "[quote"e-1 > foo]"); - - // Single-line blockquote - MT("blockquoteNoSpace", - "[quote"e-1 >foo]"); - - // No blank line before blockquote - MT("blockquoteNoBlankLine", - "foo", - "[quote"e-1 > bar]"); - - // Nested blockquote - MT("blockquoteSpace", - "[quote"e-1 > foo]", - "[quote"e-1 >][quote"e-2 > foo]", - "[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"); - - // Single-line blockquote followed by normal paragraph - MT("blockquoteThenParagraph", - "[quote"e-1 >foo]", - "", - "bar"); - - // Multi-line blockquote (lazy mode) - MT("multiBlockquoteLazy", - "[quote"e-1 >foo]", - "[quote"e-1 bar]"); - - // Multi-line blockquote followed by normal paragraph (lazy mode) - MT("multiBlockquoteLazyThenParagraph", - "[quote"e-1 >foo]", - "[quote"e-1 bar]", - "", - "hello"); - - // Multi-line blockquote (non-lazy mode) - MT("multiBlockquote", - "[quote"e-1 >foo]", - "[quote"e-1 >bar]"); - - // Multi-line blockquote followed by normal paragraph (non-lazy mode) - MT("multiBlockquoteThenParagraph", - "[quote"e-1 >foo]", - "[quote"e-1 >bar]", - "", - "hello"); - - // Header with leading space after continued blockquote (#3287, negative indentation) - MT("headerAfterContinuedBlockquote", - "[quote"e-1 > foo]", - "[quote"e-1 bar]", - "", - " [header&header-1 # hello]"); - - // Check list types - - MT("listAsterisk", - "foo", - "bar", - "", - "[variable-2 * foo]", - "[variable-2 * bar]"); - - MT("listPlus", - "foo", - "bar", - "", - "[variable-2 + foo]", - "[variable-2 + bar]"); - - MT("listDash", - "foo", - "bar", - "", - "[variable-2 - foo]", - "[variable-2 - bar]"); - - MT("listNumber", - "foo", - "bar", - "", - "[variable-2 1. foo]", - "[variable-2 2. bar]"); - - // Lists require a preceding blank line (per Dingus) - MT("listBogus", - "foo", - "1. bar", - "2. hello"); - - // List after hr - MT("listAfterHr", - "[hr ---]", - "[variable-2 - bar]"); - - // List after header - MT("listAfterHeader", - "[header&header-1 # foo]", - "[variable-2 - bar]"); - - // hr after list - MT("hrAfterList", - "[variable-2 - foo]", - "[hr -----]"); - - // Formatting in lists (*) - MT("listAsteriskFormatting", - "[variable-2 * ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 * ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (+) - MT("listPlusFormatting", - "[variable-2 + ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 + ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (-) - MT("listDashFormatting", - "[variable-2 - ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 - ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"); - - // Formatting in lists (1.) - MT("listNumberFormatting", - "[variable-2 1. ][variable-2&em *foo*][variable-2 bar]", - "[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]", - "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", - "[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"); - - // Paragraph lists - MT("listParagraph", - "[variable-2 * foo]", - "", - "[variable-2 * bar]"); - - // Multi-paragraph lists - // - // 4 spaces - MT("listMultiParagraph", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2 hello]"); - - // 4 spaces, extra blank lines (should still be list, per Dingus) - MT("listMultiParagraphExtra", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "", - " [variable-2 hello]"); - - // 4 spaces, plus 1 space (should still be list, per Dingus) - MT("listMultiParagraphExtraSpace", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2 hello]", - "", - " [variable-2 world]"); - - // 1 tab - MT("listTab", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "\t[variable-2 hello]"); - - // No indent - MT("listNoIndent", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - "hello"); - - // Blockquote - MT("blockquote", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [variable-2"e"e-1 > hello]"); - - // Code block - MT("blockquoteCode", - "[variable-2 * foo]", - "", - "[variable-2 * bar]", - "", - " [comment > hello]", - "", - " [variable-2 world]"); - - // Code block followed by text - MT("blockquoteCodeText", - "[variable-2 * foo]", - "", - " [variable-2 bar]", - "", - " [comment hello]", - "", - " [variable-2 world]"); - - // Nested list - - MT("listAsteriskNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]"); - - MT("listPlusNested", - "[variable-2 + foo]", - "", - " [variable-3 + bar]"); - - MT("listDashNested", - "[variable-2 - foo]", - "", - " [variable-3 - bar]"); - - MT("listNumberNested", - "[variable-2 1. foo]", - "", - " [variable-3 2. bar]"); - - MT("listMixed", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [keyword - hello]", - "", - " [variable-2 1. world]"); - - MT("listBlockquote", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [quote"e-1&variable-3 > hello]"); - - MT("listCode", - "[variable-2 * foo]", - "", - " [variable-3 + bar]", - "", - " [comment hello]"); - - // Code with internal indentation - MT("listCodeIndentation", - "[variable-2 * foo]", - "", - " [comment bar]", - " [comment hello]", - " [comment world]", - " [comment foo]", - " [variable-2 bar]"); - - // List nesting edge cases - MT("listNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]", - "", - " [variable-2 hello]" - ); - MT("listNested", - "[variable-2 * foo]", - "", - " [variable-3 * bar]", - "", - " [variable-3 * foo]" - ); - - // Code followed by text - MT("listCodeText", - "[variable-2 * foo]", - "", - " [comment bar]", - "", - "hello"); - - // Following tests directly from official Markdown documentation - // http://daringfireball.net/projects/markdown/syntax#hr - - MT("hrSpace", - "[hr * * *]"); - - MT("hr", - "[hr ***]"); - - MT("hrLong", - "[hr *****]"); - - MT("hrSpaceDash", - "[hr - - -]"); - - MT("hrDashLong", - "[hr ---------------------------------------]"); - - // Inline link with title - MT("linkTitle", - "[link [[foo]]][string&url (http://example.com/ \"bar\")] hello"); - - // Inline link without title - MT("linkNoTitle", - "[link [[foo]]][string&url (http://example.com/)] bar"); - - // Inline link with image - MT("linkImage", - "[link [[][tag ![[foo]]][string&url (http://example.com/)][link ]]][string&url (http://example.com/)] bar"); - - // Inline link with Em - MT("linkEm", - "[link [[][link&em *foo*][link ]]][string&url (http://example.com/)] bar"); - - // Inline link with Strong - MT("linkStrong", - "[link [[][link&strong **foo**][link ]]][string&url (http://example.com/)] bar"); - - // Inline link with EmStrong - MT("linkEmStrong", - "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url (http://example.com/)] bar"); - - // Image with title - MT("imageTitle", - "[tag ![[foo]]][string&url (http://example.com/ \"bar\")] hello"); - - // Image without title - MT("imageNoTitle", - "[tag ![[foo]]][string&url (http://example.com/)] bar"); - - // Image with asterisks - MT("imageAsterisks", - "[tag ![[*foo*]]][string&url (http://example.com/)] bar"); - - // Not a link. Should be normal text due to square brackets being used - // regularly in text, especially in quoted material, and no space is allowed - // between square brackets and parentheses (per Dingus). - MT("notALink", - "[[foo]] (bar)"); - - // Reference-style links - MT("linkReference", - "[link [[foo]]][string&url [[bar]]] hello"); - - // Reference-style links with Em - MT("linkReferenceEm", - "[link [[][link&em *foo*][link ]]][string&url [[bar]]] hello"); - - // Reference-style links with Strong - MT("linkReferenceStrong", - "[link [[][link&strong **foo**][link ]]][string&url [[bar]]] hello"); - - // Reference-style links with EmStrong - MT("linkReferenceEmStrong", - "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url [[bar]]] hello"); - - // Reference-style links with optional space separator (per docuentation) - // "You can optionally use a space to separate the sets of brackets" - MT("linkReferenceSpace", - "[link [[foo]]] [string&url [[bar]]] hello"); - - // Should only allow a single space ("...use *a* space...") - MT("linkReferenceDoubleSpace", - "[[foo]] [[bar]] hello"); - - // Reference-style links with implicit link name - MT("linkImplicit", - "[link [[foo]]][string&url [[]]] hello"); - - // @todo It would be nice if, at some point, the document was actually - // checked to see if the referenced link exists - - // Link label, for reference-style links (taken from documentation) - - MT("labelNoTitle", - "[link [[foo]]:] [string&url http://example.com/]"); - - MT("labelIndented", - " [link [[foo]]:] [string&url http://example.com/]"); - - MT("labelSpaceTitle", - "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"]"); - - MT("labelDoubleTitle", - "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"] \"world\""); - - MT("labelTitleDoubleQuotes", - "[link [[foo]]:] [string&url http://example.com/ \"bar\"]"); - - MT("labelTitleSingleQuotes", - "[link [[foo]]:] [string&url http://example.com/ 'bar']"); - - MT("labelTitleParenthese", - "[link [[foo]]:] [string&url http://example.com/ (bar)]"); - - MT("labelTitleInvalid", - "[link [[foo]]:] [string&url http://example.com/] bar"); - - MT("labelLinkAngleBrackets", - "[link [[foo]]:] [string&url \"bar\"]"); - - MT("labelTitleNextDoubleQuotes", - "[link [[foo]]:] [string&url http://example.com/]", - "[string \"bar\"] hello"); - - MT("labelTitleNextSingleQuotes", - "[link [[foo]]:] [string&url http://example.com/]", - "[string 'bar'] hello"); - - MT("labelTitleNextParenthese", - "[link [[foo]]:] [string&url http://example.com/]", - "[string (bar)] hello"); - - MT("labelTitleNextMixed", - "[link [[foo]]:] [string&url http://example.com/]", - "(bar\" hello"); - - MT("linkWeb", - "[link ] foo"); - - MT("linkWebDouble", - "[link ] foo [link ]"); - - MT("linkEmail", - "[link ] foo"); - - MT("linkEmailDouble", - "[link ] foo [link ]"); - - MT("emAsterisk", - "[em *foo*] bar"); - - MT("emUnderscore", - "[em _foo_] bar"); - - MT("emInWordAsterisk", - "foo[em *bar*]hello"); - - MT("emInWordUnderscore", - "foo[em _bar_]hello"); - - // Per documentation: "...surround an * or _ with spaces, it’ll be - // treated as a literal asterisk or underscore." - - MT("emEscapedBySpaceIn", - "foo [em _bar _ hello_] world"); - - MT("emEscapedBySpaceOut", - "foo _ bar[em _hello_]world"); - - MT("emEscapedByNewline", - "foo", - "_ bar[em _hello_]world"); - - // Unclosed emphasis characters - // Instead of simply marking as EM / STRONG, it would be nice to have an - // incomplete flag for EM and STRONG, that is styled slightly different. - MT("emIncompleteAsterisk", - "foo [em *bar]"); - - MT("emIncompleteUnderscore", - "foo [em _bar]"); - - MT("strongAsterisk", - "[strong **foo**] bar"); - - MT("strongUnderscore", - "[strong __foo__] bar"); - - MT("emStrongAsterisk", - "[em *foo][em&strong **bar*][strong hello**] world"); - - MT("emStrongUnderscore", - "[em _foo][em&strong __bar_][strong hello__] world"); - - // "...same character must be used to open and close an emphasis span."" - MT("emStrongMixed", - "[em _foo][em&strong **bar*hello__ world]"); - - MT("emStrongMixed", - "[em *foo][em&strong __bar_hello** world]"); - - // These characters should be escaped: - // \ backslash - // ` backtick - // * asterisk - // _ underscore - // {} curly braces - // [] square brackets - // () parentheses - // # hash mark - // + plus sign - // - minus sign (hyphen) - // . dot - // ! exclamation mark - - MT("escapeBacktick", - "foo \\`bar\\`"); - - MT("doubleEscapeBacktick", - "foo \\\\[comment `bar\\\\`]"); - - MT("escapeAsterisk", - "foo \\*bar\\*"); - - MT("doubleEscapeAsterisk", - "foo \\\\[em *bar\\\\*]"); - - MT("escapeUnderscore", - "foo \\_bar\\_"); - - MT("doubleEscapeUnderscore", - "foo \\\\[em _bar\\\\_]"); - - MT("escapeHash", - "\\# foo"); - - MT("doubleEscapeHash", - "\\\\# foo"); - - MT("escapeNewline", - "\\", - "[em *foo*]"); - - - // Tests to make sure GFM-specific things aren't getting through - - MT("taskList", - "[variable-2 * [ ]] bar]"); - - MT("fencedCodeBlocks", - "[comment ```]", - "foo", - "[comment ```]"); - - // Tests that require XML mode - - MT("xmlMode", - "[tag&bracket <][tag div][tag&bracket >]", - "*foo*", - "[tag&bracket <][tag http://github.com][tag&bracket />]", - "[tag&bracket ]", - "[link ]"); - - MT("xmlModeWithMarkdownInside", - "[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]", - "[em *foo*]", - "[link ]", - "[tag
                ]", - "[link ]", - "[tag&bracket <][tag div][tag&bracket >]", - "[tag&bracket ]"); - -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/meta.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/meta.js deleted file mode 100644 index bc9f121..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/meta.js +++ /dev/null @@ -1,190 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.modeInfo = [ - {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, - {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]}, - {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]}, - {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, - {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]}, - {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, - {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, - {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, - {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, - {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]}, - {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/}, - {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, - {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, - {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, - {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]}, - {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]}, - {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]}, - {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]}, - {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]}, - {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]}, - {name: "Django", mime: "text/x-django", mode: "django"}, - {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/}, - {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]}, - {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]}, - {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"}, - {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]}, - {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, - {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]}, - {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, - {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, - {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, - {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]}, - {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]}, - {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]}, - {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]}, - {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]}, - {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]}, - {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i}, - {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]}, - {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]}, - {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, - {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, - {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]}, - {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]}, - {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]}, - {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]}, - {name: "HTTP", mime: "message/http", mode: "http"}, - {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]}, - {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]}, - {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, - {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]}, - {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], - mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]}, - {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]}, - {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]}, - {name: "Jinja2", mime: "null", mode: "jinja2"}, - {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]}, - {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]}, - {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]}, - {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]}, - {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]}, - {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, - {name: "mIRC", mime: "text/mirc", mode: "mirc"}, - {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, - {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]}, - {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, - {name: "MUMPS", mime: "text/x-mumps", mode: "mumps"}, - {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, - {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, - {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, - {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]}, - {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]}, - {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]}, - {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]}, - {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]}, - {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]}, - {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]}, - {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]}, - {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]}, - {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]}, - {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]}, - {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]}, - {name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]}, - {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]}, - {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]}, - {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]}, - {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]}, - {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"}, - {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]}, - {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]}, - {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]}, - {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]}, - {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]}, - {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]}, - {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]}, - {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]}, - {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]}, - {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, - {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, - {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, - {name: "Solr", mime: "text/x-solr", mode: "solr"}, - {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]}, - {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, - {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]}, - {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]}, - {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]}, - {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]}, - {name: "MariaDB", mime: "text/x-mariadb", mode: "sql"}, - {name: "sTeX", mime: "text/x-stex", mode: "stex"}, - {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]}, - {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]}, - {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]}, - {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]}, - {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"}, - {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, - {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]}, - {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, - {name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]}, - {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]}, - {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]}, - {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, - {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]}, - {name: "Twig", mime: "text/x-twig", mode: "twig"}, - {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, - {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]}, - {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]}, - {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, - {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]}, - {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, - {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]}, - {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]} - ]; - // Ensure all modes have a mime property for backwards compatibility - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.mimes) info.mime = info.mimes[0]; - } - - CodeMirror.findModeByMIME = function(mime) { - mime = mime.toLowerCase(); - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.mime == mime) return info; - if (info.mimes) for (var j = 0; j < info.mimes.length; j++) - if (info.mimes[j] == mime) return info; - } - }; - - CodeMirror.findModeByExtension = function(ext) { - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.ext) for (var j = 0; j < info.ext.length; j++) - if (info.ext[j] == ext) return info; - } - }; - - CodeMirror.findModeByFileName = function(filename) { - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.file && info.file.test(filename)) return info; - } - var dot = filename.lastIndexOf("."); - var ext = dot > -1 && filename.substring(dot + 1, filename.length); - if (ext) return CodeMirror.findModeByExtension(ext); - }; - - CodeMirror.findModeByName = function(name) { - name = name.toLowerCase(); - for (var i = 0; i < CodeMirror.modeInfo.length; i++) { - var info = CodeMirror.modeInfo[i]; - if (info.name.toLowerCase() == name) return info; - if (info.alias) for (var j = 0; j < info.alias.length; j++) - if (info.alias[j].toLowerCase() == name) return info; - } - }; -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/nginx/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/nginx/index.html deleted file mode 100644 index 5ffdc08..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/nginx/index.html +++ /dev/null @@ -1,181 +0,0 @@ - - -CodeMirror: NGINX mode - - - - - - - - - - - - - -
                -

                NGINX mode

                -
                - - -

                MIME types defined: text/nginx.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/nginx/nginx.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/nginx/nginx.js deleted file mode 100644 index 135b9cc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/nginx/nginx.js +++ /dev/null @@ -1,178 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("nginx", function(config) { - - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = words( - /* ngxDirectiveControl */ "break return rewrite set" + - /* ngxDirective */ " accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23" - ); - - var keywords_block = words( - /* ngxDirectiveBlock */ "http mail events server types location upstream charset_map limit_except if geo map" - ); - - var keywords_important = words( - /* ngxDirectiveImportant */ "include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files" - ); - - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - - - stream.eatWhile(/[\w\$_]/); - - var cur = stream.current(); - - - if (keywords.propertyIsEnumerable(cur)) { - return "keyword"; - } - else if (keywords_block.propertyIsEnumerable(cur)) { - return "variable-2"; - } - else if (keywords_important.propertyIsEnumerable(cur)) { - return "string-2"; - } - /**/ - - var ch = stream.next(); - if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - else if (ch == "=") ret(null, "compare"); - else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (/[,.+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } - else if (/[;{}:\[\]]/.test(ch)) { - return ret(null, ch); - } - else { - stream.eatWhile(/[\w\\\-]/); - return ret("variable", "variable"); - } - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - type = null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = "number"; - else if (!context || context == "@media{") style = "tag"; - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (context == "{" && type != "comment") state.stack.push("rule"); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/pascal/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/pascal/index.html deleted file mode 100644 index f8a99ad..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/pascal/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: Pascal mode - - - - - - - - - -
                -

                Pascal mode

                - - -
                - - - -

                MIME types defined: text/x-pascal.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/pascal/pascal.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/pascal/pascal.js deleted file mode 100644 index 2d0c3d4..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/pascal/pascal.js +++ /dev/null @@ -1,109 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("pascal", function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words("and array begin case const div do downto else end file for forward integer " + - "boolean char function goto if in label mod nil not of or packed procedure " + - "program record repeat set string then to type until var while with"); - var atoms = {"null": true}; - - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "#" && state.startOfLine) { - stream.skipToEnd(); - return "meta"; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (ch == "(" && stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return null; - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) return "keyword"; - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "variable"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !escaped) state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - // Interface - - return { - startState: function() { - return {tokenize: null}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - return style; - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-pascal", "pascal"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/perl/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/perl/index.html deleted file mode 100644 index 8c1021c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/perl/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - -CodeMirror: Perl mode - - - - - - - - - -
                -

                Perl mode

                - - -
                - - - -

                MIME types defined: text/x-perl.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/perl/perl.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/perl/perl.js deleted file mode 100644 index bef62bc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/perl/perl.js +++ /dev/null @@ -1,837 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) -// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("perl",function(){ - // http://perldoc.perl.org - var PERL={ // null - magic touch - // 1 - keyword - // 2 - def - // 3 - atom - // 4 - operator - // 5 - variable-2 (predefined) - // [x,y] - x=1,2,3; y=must be defined if x{...} - // PERL operators - '->' : 4, - '++' : 4, - '--' : 4, - '**' : 4, - // ! ~ \ and unary + and - - '=~' : 4, - '!~' : 4, - '*' : 4, - '/' : 4, - '%' : 4, - 'x' : 4, - '+' : 4, - '-' : 4, - '.' : 4, - '<<' : 4, - '>>' : 4, - // named unary operators - '<' : 4, - '>' : 4, - '<=' : 4, - '>=' : 4, - 'lt' : 4, - 'gt' : 4, - 'le' : 4, - 'ge' : 4, - '==' : 4, - '!=' : 4, - '<=>' : 4, - 'eq' : 4, - 'ne' : 4, - 'cmp' : 4, - '~~' : 4, - '&' : 4, - '|' : 4, - '^' : 4, - '&&' : 4, - '||' : 4, - '//' : 4, - '..' : 4, - '...' : 4, - '?' : 4, - ':' : 4, - '=' : 4, - '+=' : 4, - '-=' : 4, - '*=' : 4, // etc. ??? - ',' : 4, - '=>' : 4, - '::' : 4, - // list operators (rightward) - 'not' : 4, - 'and' : 4, - 'or' : 4, - 'xor' : 4, - // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) - 'BEGIN' : [5,1], - 'END' : [5,1], - 'PRINT' : [5,1], - 'PRINTF' : [5,1], - 'GETC' : [5,1], - 'READ' : [5,1], - 'READLINE' : [5,1], - 'DESTROY' : [5,1], - 'TIE' : [5,1], - 'TIEHANDLE' : [5,1], - 'UNTIE' : [5,1], - 'STDIN' : 5, - 'STDIN_TOP' : 5, - 'STDOUT' : 5, - 'STDOUT_TOP' : 5, - 'STDERR' : 5, - 'STDERR_TOP' : 5, - '$ARG' : 5, - '$_' : 5, - '@ARG' : 5, - '@_' : 5, - '$LIST_SEPARATOR' : 5, - '$"' : 5, - '$PROCESS_ID' : 5, - '$PID' : 5, - '$$' : 5, - '$REAL_GROUP_ID' : 5, - '$GID' : 5, - '$(' : 5, - '$EFFECTIVE_GROUP_ID' : 5, - '$EGID' : 5, - '$)' : 5, - '$PROGRAM_NAME' : 5, - '$0' : 5, - '$SUBSCRIPT_SEPARATOR' : 5, - '$SUBSEP' : 5, - '$;' : 5, - '$REAL_USER_ID' : 5, - '$UID' : 5, - '$<' : 5, - '$EFFECTIVE_USER_ID' : 5, - '$EUID' : 5, - '$>' : 5, - '$a' : 5, - '$b' : 5, - '$COMPILING' : 5, - '$^C' : 5, - '$DEBUGGING' : 5, - '$^D' : 5, - '${^ENCODING}' : 5, - '$ENV' : 5, - '%ENV' : 5, - '$SYSTEM_FD_MAX' : 5, - '$^F' : 5, - '@F' : 5, - '${^GLOBAL_PHASE}' : 5, - '$^H' : 5, - '%^H' : 5, - '@INC' : 5, - '%INC' : 5, - '$INPLACE_EDIT' : 5, - '$^I' : 5, - '$^M' : 5, - '$OSNAME' : 5, - '$^O' : 5, - '${^OPEN}' : 5, - '$PERLDB' : 5, - '$^P' : 5, - '$SIG' : 5, - '%SIG' : 5, - '$BASETIME' : 5, - '$^T' : 5, - '${^TAINT}' : 5, - '${^UNICODE}' : 5, - '${^UTF8CACHE}' : 5, - '${^UTF8LOCALE}' : 5, - '$PERL_VERSION' : 5, - '$^V' : 5, - '${^WIN32_SLOPPY_STAT}' : 5, - '$EXECUTABLE_NAME' : 5, - '$^X' : 5, - '$1' : 5, // - regexp $1, $2... - '$MATCH' : 5, - '$&' : 5, - '${^MATCH}' : 5, - '$PREMATCH' : 5, - '$`' : 5, - '${^PREMATCH}' : 5, - '$POSTMATCH' : 5, - "$'" : 5, - '${^POSTMATCH}' : 5, - '$LAST_PAREN_MATCH' : 5, - '$+' : 5, - '$LAST_SUBMATCH_RESULT' : 5, - '$^N' : 5, - '@LAST_MATCH_END' : 5, - '@+' : 5, - '%LAST_PAREN_MATCH' : 5, - '%+' : 5, - '@LAST_MATCH_START' : 5, - '@-' : 5, - '%LAST_MATCH_START' : 5, - '%-' : 5, - '$LAST_REGEXP_CODE_RESULT' : 5, - '$^R' : 5, - '${^RE_DEBUG_FLAGS}' : 5, - '${^RE_TRIE_MAXBUF}' : 5, - '$ARGV' : 5, - '@ARGV' : 5, - 'ARGV' : 5, - 'ARGVOUT' : 5, - '$OUTPUT_FIELD_SEPARATOR' : 5, - '$OFS' : 5, - '$,' : 5, - '$INPUT_LINE_NUMBER' : 5, - '$NR' : 5, - '$.' : 5, - '$INPUT_RECORD_SEPARATOR' : 5, - '$RS' : 5, - '$/' : 5, - '$OUTPUT_RECORD_SEPARATOR' : 5, - '$ORS' : 5, - '$\\' : 5, - '$OUTPUT_AUTOFLUSH' : 5, - '$|' : 5, - '$ACCUMULATOR' : 5, - '$^A' : 5, - '$FORMAT_FORMFEED' : 5, - '$^L' : 5, - '$FORMAT_PAGE_NUMBER' : 5, - '$%' : 5, - '$FORMAT_LINES_LEFT' : 5, - '$-' : 5, - '$FORMAT_LINE_BREAK_CHARACTERS' : 5, - '$:' : 5, - '$FORMAT_LINES_PER_PAGE' : 5, - '$=' : 5, - '$FORMAT_TOP_NAME' : 5, - '$^' : 5, - '$FORMAT_NAME' : 5, - '$~' : 5, - '${^CHILD_ERROR_NATIVE}' : 5, - '$EXTENDED_OS_ERROR' : 5, - '$^E' : 5, - '$EXCEPTIONS_BEING_CAUGHT' : 5, - '$^S' : 5, - '$WARNING' : 5, - '$^W' : 5, - '${^WARNING_BITS}' : 5, - '$OS_ERROR' : 5, - '$ERRNO' : 5, - '$!' : 5, - '%OS_ERROR' : 5, - '%ERRNO' : 5, - '%!' : 5, - '$CHILD_ERROR' : 5, - '$?' : 5, - '$EVAL_ERROR' : 5, - '$@' : 5, - '$OFMT' : 5, - '$#' : 5, - '$*' : 5, - '$ARRAY_BASE' : 5, - '$[' : 5, - '$OLD_PERL_VERSION' : 5, - '$]' : 5, - // PERL blocks - 'if' :[1,1], - elsif :[1,1], - 'else' :[1,1], - 'while' :[1,1], - unless :[1,1], - 'for' :[1,1], - foreach :[1,1], - // PERL functions - 'abs' :1, // - absolute value function - accept :1, // - accept an incoming socket connect - alarm :1, // - schedule a SIGALRM - 'atan2' :1, // - arctangent of Y/X in the range -PI to PI - bind :1, // - binds an address to a socket - binmode :1, // - prepare binary files for I/O - bless :1, // - create an object - bootstrap :1, // - 'break' :1, // - break out of a "given" block - caller :1, // - get context of the current subroutine call - chdir :1, // - change your current working directory - chmod :1, // - changes the permissions on a list of files - chomp :1, // - remove a trailing record separator from a string - chop :1, // - remove the last character from a string - chown :1, // - change the owership on a list of files - chr :1, // - get character this number represents - chroot :1, // - make directory new root for path lookups - close :1, // - close file (or pipe or socket) handle - closedir :1, // - close directory handle - connect :1, // - connect to a remote socket - 'continue' :[1,1], // - optional trailing block in a while or foreach - 'cos' :1, // - cosine function - crypt :1, // - one-way passwd-style encryption - dbmclose :1, // - breaks binding on a tied dbm file - dbmopen :1, // - create binding on a tied dbm file - 'default' :1, // - defined :1, // - test whether a value, variable, or function is defined - 'delete' :1, // - deletes a value from a hash - die :1, // - raise an exception or bail out - 'do' :1, // - turn a BLOCK into a TERM - dump :1, // - create an immediate core dump - each :1, // - retrieve the next key/value pair from a hash - endgrent :1, // - be done using group file - endhostent :1, // - be done using hosts file - endnetent :1, // - be done using networks file - endprotoent :1, // - be done using protocols file - endpwent :1, // - be done using passwd file - endservent :1, // - be done using services file - eof :1, // - test a filehandle for its end - 'eval' :1, // - catch exceptions or compile and run code - 'exec' :1, // - abandon this program to run another - exists :1, // - test whether a hash key is present - exit :1, // - terminate this program - 'exp' :1, // - raise I to a power - fcntl :1, // - file control system call - fileno :1, // - return file descriptor from filehandle - flock :1, // - lock an entire file with an advisory lock - fork :1, // - create a new process just like this one - format :1, // - declare a picture format with use by the write() function - formline :1, // - internal function used for formats - getc :1, // - get the next character from the filehandle - getgrent :1, // - get next group record - getgrgid :1, // - get group record given group user ID - getgrnam :1, // - get group record given group name - gethostbyaddr :1, // - get host record given its address - gethostbyname :1, // - get host record given name - gethostent :1, // - get next hosts record - getlogin :1, // - return who logged in at this tty - getnetbyaddr :1, // - get network record given its address - getnetbyname :1, // - get networks record given name - getnetent :1, // - get next networks record - getpeername :1, // - find the other end of a socket connection - getpgrp :1, // - get process group - getppid :1, // - get parent process ID - getpriority :1, // - get current nice value - getprotobyname :1, // - get protocol record given name - getprotobynumber :1, // - get protocol record numeric protocol - getprotoent :1, // - get next protocols record - getpwent :1, // - get next passwd record - getpwnam :1, // - get passwd record given user login name - getpwuid :1, // - get passwd record given user ID - getservbyname :1, // - get services record given its name - getservbyport :1, // - get services record given numeric port - getservent :1, // - get next services record - getsockname :1, // - retrieve the sockaddr for a given socket - getsockopt :1, // - get socket options on a given socket - given :1, // - glob :1, // - expand filenames using wildcards - gmtime :1, // - convert UNIX time into record or string using Greenwich time - 'goto' :1, // - create spaghetti code - grep :1, // - locate elements in a list test true against a given criterion - hex :1, // - convert a string to a hexadecimal number - 'import' :1, // - patch a module's namespace into your own - index :1, // - find a substring within a string - 'int' :1, // - get the integer portion of a number - ioctl :1, // - system-dependent device control system call - 'join' :1, // - join a list into a string using a separator - keys :1, // - retrieve list of indices from a hash - kill :1, // - send a signal to a process or process group - last :1, // - exit a block prematurely - lc :1, // - return lower-case version of a string - lcfirst :1, // - return a string with just the next letter in lower case - length :1, // - return the number of bytes in a string - 'link' :1, // - create a hard link in the filesytem - listen :1, // - register your socket as a server - local : 2, // - create a temporary value for a global variable (dynamic scoping) - localtime :1, // - convert UNIX time into record or string using local time - lock :1, // - get a thread lock on a variable, subroutine, or method - 'log' :1, // - retrieve the natural logarithm for a number - lstat :1, // - stat a symbolic link - m :null, // - match a string with a regular expression pattern - map :1, // - apply a change to a list to get back a new list with the changes - mkdir :1, // - create a directory - msgctl :1, // - SysV IPC message control operations - msgget :1, // - get SysV IPC message queue - msgrcv :1, // - receive a SysV IPC message from a message queue - msgsnd :1, // - send a SysV IPC message to a message queue - my : 2, // - declare and assign a local variable (lexical scoping) - 'new' :1, // - next :1, // - iterate a block prematurely - no :1, // - unimport some module symbols or semantics at compile time - oct :1, // - convert a string to an octal number - open :1, // - open a file, pipe, or descriptor - opendir :1, // - open a directory - ord :1, // - find a character's numeric representation - our : 2, // - declare and assign a package variable (lexical scoping) - pack :1, // - convert a list into a binary representation - 'package' :1, // - declare a separate global namespace - pipe :1, // - open a pair of connected filehandles - pop :1, // - remove the last element from an array and return it - pos :1, // - find or set the offset for the last/next m//g search - print :1, // - output a list to a filehandle - printf :1, // - output a formatted list to a filehandle - prototype :1, // - get the prototype (if any) of a subroutine - push :1, // - append one or more elements to an array - q :null, // - singly quote a string - qq :null, // - doubly quote a string - qr :null, // - Compile pattern - quotemeta :null, // - quote regular expression magic characters - qw :null, // - quote a list of words - qx :null, // - backquote quote a string - rand :1, // - retrieve the next pseudorandom number - read :1, // - fixed-length buffered input from a filehandle - readdir :1, // - get a directory from a directory handle - readline :1, // - fetch a record from a file - readlink :1, // - determine where a symbolic link is pointing - readpipe :1, // - execute a system command and collect standard output - recv :1, // - receive a message over a Socket - redo :1, // - start this loop iteration over again - ref :1, // - find out the type of thing being referenced - rename :1, // - change a filename - require :1, // - load in external functions from a library at runtime - reset :1, // - clear all variables of a given name - 'return' :1, // - get out of a function early - reverse :1, // - flip a string or a list - rewinddir :1, // - reset directory handle - rindex :1, // - right-to-left substring search - rmdir :1, // - remove a directory - s :null, // - replace a pattern with a string - say :1, // - print with newline - scalar :1, // - force a scalar context - seek :1, // - reposition file pointer for random-access I/O - seekdir :1, // - reposition directory pointer - select :1, // - reset default output or do I/O multiplexing - semctl :1, // - SysV semaphore control operations - semget :1, // - get set of SysV semaphores - semop :1, // - SysV semaphore operations - send :1, // - send a message over a socket - setgrent :1, // - prepare group file for use - sethostent :1, // - prepare hosts file for use - setnetent :1, // - prepare networks file for use - setpgrp :1, // - set the process group of a process - setpriority :1, // - set a process's nice value - setprotoent :1, // - prepare protocols file for use - setpwent :1, // - prepare passwd file for use - setservent :1, // - prepare services file for use - setsockopt :1, // - set some socket options - shift :1, // - remove the first element of an array, and return it - shmctl :1, // - SysV shared memory operations - shmget :1, // - get SysV shared memory segment identifier - shmread :1, // - read SysV shared memory - shmwrite :1, // - write SysV shared memory - shutdown :1, // - close down just half of a socket connection - 'sin' :1, // - return the sine of a number - sleep :1, // - block for some number of seconds - socket :1, // - create a socket - socketpair :1, // - create a pair of sockets - 'sort' :1, // - sort a list of values - splice :1, // - add or remove elements anywhere in an array - 'split' :1, // - split up a string using a regexp delimiter - sprintf :1, // - formatted print into a string - 'sqrt' :1, // - square root function - srand :1, // - seed the random number generator - stat :1, // - get a file's status information - state :1, // - declare and assign a state variable (persistent lexical scoping) - study :1, // - optimize input data for repeated searches - 'sub' :1, // - declare a subroutine, possibly anonymously - 'substr' :1, // - get or alter a portion of a stirng - symlink :1, // - create a symbolic link to a file - syscall :1, // - execute an arbitrary system call - sysopen :1, // - open a file, pipe, or descriptor - sysread :1, // - fixed-length unbuffered input from a filehandle - sysseek :1, // - position I/O pointer on handle used with sysread and syswrite - system :1, // - run a separate program - syswrite :1, // - fixed-length unbuffered output to a filehandle - tell :1, // - get current seekpointer on a filehandle - telldir :1, // - get current seekpointer on a directory handle - tie :1, // - bind a variable to an object class - tied :1, // - get a reference to the object underlying a tied variable - time :1, // - return number of seconds since 1970 - times :1, // - return elapsed time for self and child processes - tr :null, // - transliterate a string - truncate :1, // - shorten a file - uc :1, // - return upper-case version of a string - ucfirst :1, // - return a string with just the next letter in upper case - umask :1, // - set file creation mode mask - undef :1, // - remove a variable or function definition - unlink :1, // - remove one link to a file - unpack :1, // - convert binary structure into normal perl variables - unshift :1, // - prepend more elements to the beginning of a list - untie :1, // - break a tie binding to a variable - use :1, // - load in a module at compile time - utime :1, // - set a file's last access and modify times - values :1, // - return a list of the values in a hash - vec :1, // - test or set particular bits in a string - wait :1, // - wait for any child process to die - waitpid :1, // - wait for a particular child process to die - wantarray :1, // - get void vs scalar vs list context of current subroutine call - warn :1, // - print debugging info - when :1, // - write :1, // - print a picture record - y :null}; // - transliterate a string - - var RXstyle="string-2"; - var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type - - function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) - state.chain=null; // 12 3tail - state.style=null; - state.tail=null; - state.tokenize=function(stream,state){ - var e=false,c,i=0; - while(c=stream.next()){ - if(c===chain[i]&&!e){ - if(chain[++i]!==undefined){ - state.chain=chain[i]; - state.style=style; - state.tail=tail;} - else if(tail) - stream.eatWhile(tail); - state.tokenize=tokenPerl; - return style;} - e=!e&&c=="\\";} - return style;}; - return state.tokenize(stream,state);} - - function tokenSOMETHING(stream,state,string){ - state.tokenize=function(stream,state){ - if(stream.string==string) - state.tokenize=tokenPerl; - stream.skipToEnd(); - return "string";}; - return state.tokenize(stream,state);} - - function tokenPerl(stream,state){ - if(stream.eatSpace()) - return null; - if(state.chain) - return tokenChain(stream,state,state.chain,state.style,state.tail); - if(stream.match(/^\-?[\d\.]/,false)) - if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) - return 'number'; - if(stream.match(/^<<(?=\w)/)){ // NOTE: <"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(c=="q"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],"string");}} - else if(c=="w"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],"bracket");} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],"bracket");} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],"bracket");} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],"bracket");} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],"bracket");}} - else if(c=="r"){ - c=look(stream, 1); - if(c=="("){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - eatSuffix(stream, 2); - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} - if(/[\^'"!~\/]/.test(c)){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} - else if(/[\^'"!~\/(\[{<]/.test(c)){ - if(c=="("){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[")"],"string");} - if(c=="["){ - eatSuffix(stream, 1); - return tokenChain(stream,state,["]"],"string");} - if(c=="{"){ - eatSuffix(stream, 1); - return tokenChain(stream,state,["}"],"string");} - if(c=="<"){ - eatSuffix(stream, 1); - return tokenChain(stream,state,[">"],"string");} - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[stream.eat(c)],"string");}}}} - if(ch=="m"){ - var c=look(stream, -2); - if(!(c&&/\w/.test(c))){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[c],RXstyle,RXmodifiers);} - if(c=="("){ - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} - if(c=="["){ - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} - if(c=="{"){ - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} - if(c=="<"){ - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}} - if(ch=="s"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="y"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} - if(ch=="t"){ - var c=/[\/>\]})\w]/.test(look(stream, -2)); - if(!c){ - c=stream.eat("r");if(c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}} - if(ch=="`"){ - return tokenChain(stream,state,[ch],"variable-2");} - if(ch=="/"){ - if(!/~\s*$/.test(prefix(stream))) - return "operator"; - else - return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);} - if(ch=="$"){ - var p=stream.pos; - if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) - return "variable-2"; - else - stream.pos=p;} - if(/[$@%]/.test(ch)){ - var p=stream.pos; - if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ - var c=stream.current(); - if(PERL[c]) - return "variable-2";} - stream.pos=p;} - if(/[$@%&]/.test(ch)){ - if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ - var c=stream.current(); - if(PERL[c]) - return "variable-2"; - else - return "variable";}} - if(ch=="#"){ - if(look(stream, -2)!="$"){ - stream.skipToEnd(); - return "comment";}} - if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ - var p=stream.pos; - stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); - if(PERL[stream.current()]) - return "operator"; - else - stream.pos=p;} - if(ch=="_"){ - if(stream.pos==1){ - if(suffix(stream, 6)=="_END__"){ - return tokenChain(stream,state,['\0'],"comment");} - else if(suffix(stream, 7)=="_DATA__"){ - return tokenChain(stream,state,['\0'],"variable-2");} - else if(suffix(stream, 7)=="_C__"){ - return tokenChain(stream,state,['\0'],"string");}}} - if(/\w/.test(ch)){ - var p=stream.pos; - if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}")) - return "string"; - else - stream.pos=p;} - if(/[A-Z]/.test(ch)){ - var l=look(stream, -2); - var p=stream.pos; - stream.eatWhile(/[A-Z_]/); - if(/[\da-z]/.test(look(stream, 0))){ - stream.pos=p;} - else{ - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";}} - if(/[a-zA-Z_]/.test(ch)){ - var l=look(stream, -2); - stream.eatWhile(/\w/); - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta";} - else - return "meta";} - return null;} - - return { - startState: function() { - return { - tokenize: tokenPerl, - chain: null, - style: null, - tail: null - }; - }, - token: function(stream, state) { - return (state.tokenize || tokenPerl)(stream, state); - }, - lineComment: '#' - }; -}); - -CodeMirror.registerHelper("wordChars", "perl", /[\w$]/); - -CodeMirror.defineMIME("text/x-perl", "perl"); - -// it's like "peek", but need for look-ahead or look-behind if index < 0 -function look(stream, c){ - return stream.string.charAt(stream.pos+(c||0)); -} - -// return a part of prefix of current stream from current position -function prefix(stream, c){ - if(c){ - var x=stream.pos-c; - return stream.string.substr((x>=0?x:0),c);} - else{ - return stream.string.substr(0,stream.pos-1); - } -} - -// return a part of suffix of current stream from current position -function suffix(stream, c){ - var y=stream.string.length; - var x=y-stream.pos+1; - return stream.string.substr(stream.pos,(c&&c=(y=stream.string.length-1)) - stream.pos=y; - else - stream.pos=x; -} - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/index.html deleted file mode 100644 index adf6b1b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - -CodeMirror: PHP mode - - - - - - - - - - - - - - - -
                -

                PHP mode

                -
                - - - -

                Simple HTML/PHP mode based on - the C-like mode. Depends on XML, - JavaScript, CSS, HTMLMixed, and C-like modes.

                - -

                MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/php.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/php.js deleted file mode 100644 index 0c3f21e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/php.js +++ /dev/null @@ -1,230 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // Helper for phpString - function matchSequence(list, end, escapes) { - if (list.length == 0) return phpString(end); - return function (stream, state) { - var patterns = list[0]; - for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) { - state.tokenize = matchSequence(list.slice(1), end); - return patterns[i][1]; - } - state.tokenize = phpString(end, escapes); - return "string"; - }; - } - function phpString(closing, escapes) { - return function(stream, state) { return phpString_(stream, state, closing, escapes); }; - } - function phpString_(stream, state, closing, escapes) { - // "Complex" syntax - if (escapes !== false && stream.match("${", false) || stream.match("{$", false)) { - state.tokenize = null; - return "string"; - } - - // Simple syntax - if (escapes !== false && stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) { - // After the variable name there may appear array or object operator. - if (stream.match("[", false)) { - // Match array operator - state.tokenize = matchSequence([ - [["[", null]], - [[/\d[\w\.]*/, "number"], - [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"], - [/[\w\$]+/, "variable"]], - [["]", null]] - ], closing, escapes); - } - if (stream.match(/\-\>\w/, false)) { - // Match object operator - state.tokenize = matchSequence([ - [["->", null]], - [[/[\w]+/, "variable"]] - ], closing, escapes); - } - return "variable-2"; - } - - var escaped = false; - // Normal string - while (!stream.eol() && - (escaped || escapes === false || - (!stream.match("{$", false) && - !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) { - if (!escaped && stream.match(closing)) { - state.tokenize = null; - state.tokStack.pop(); state.tokStack.pop(); - break; - } - escaped = stream.next() == "\\" && !escaped; - } - return "string"; - } - - var phpKeywords = "abstract and array as break case catch class clone const continue declare default " + - "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + - "for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw trait try use var while xor " + - "die echo empty exit eval include include_once isset list require require_once return " + - "print unset __halt_compiler self static parent yield insteadof finally"; - var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; - var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; - CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); - CodeMirror.registerHelper("wordChars", "php", /[\w$]/); - - var phpConfig = { - name: "clike", - helperType: "php", - keywords: keywords(phpKeywords), - blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), - defKeywords: keywords("class function interface namespace trait"), - atoms: keywords(phpAtoms), - builtin: keywords(phpBuiltin), - multiLineStrings: true, - hooks: { - "$": function(stream) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - if (stream.match(/<", false)) stream.next(); - return "comment"; - }, - "/": function(stream) { - if (stream.eat("/")) { - while (!stream.eol() && !stream.match("?>", false)) stream.next(); - return "comment"; - } - return false; - }, - '"': function(_stream, state) { - (state.tokStack || (state.tokStack = [])).push('"', 0); - state.tokenize = phpString('"'); - return "string"; - }, - "{": function(_stream, state) { - if (state.tokStack && state.tokStack.length) - state.tokStack[state.tokStack.length - 1]++; - return false; - }, - "}": function(_stream, state) { - if (state.tokStack && state.tokStack.length > 0 && - !--state.tokStack[state.tokStack.length - 1]) { - state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]); - } - return false; - } - } - }; - - CodeMirror.defineMode("php", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, "text/html"); - var phpMode = CodeMirror.getMode(config, phpConfig); - - function dispatch(stream, state) { - var isPHP = state.curMode == phpMode; - if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null; - if (!isPHP) { - if (stream.match(/^<\?\w*/)) { - state.curMode = phpMode; - state.curState = state.php; - return "meta"; - } - if (state.pending == '"' || state.pending == "'") { - while (!stream.eol() && stream.next() != state.pending) {} - var style = "string"; - } else if (state.pending && stream.pos < state.pending.end) { - stream.pos = state.pending.end; - var style = state.pending.style; - } else { - var style = htmlMode.token(stream, state.curState); - } - if (state.pending) state.pending = null; - var cur = stream.current(), openPHP = cur.search(/<\?/), m; - if (openPHP != -1) { - if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0]; - else state.pending = {end: stream.pos, style: style}; - stream.backUp(cur.length - openPHP); - } - return style; - } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { - state.curMode = htmlMode; - state.curState = state.html; - return "meta"; - } else { - return phpMode.token(stream, state.curState); - } - } - - return { - startState: function() { - var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); - return {html: html, - php: php, - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? php : html, - pending: null}; - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; - if (state.curMode == htmlMode) cur = htmlNew; - else cur = phpNew; - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, - pending: state.pending}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", - - innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } - }; - }, "htmlmixed", "clike"); - - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/test.js deleted file mode 100644 index e2ecefc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/php/test.js +++ /dev/null @@ -1,154 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "php"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT('simple_test', - '[meta ]'); - - MT('variable_interpolation_non_alphanumeric', - '[meta $/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]', - '[meta ?>]'); - - MT('variable_interpolation_digits', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_1', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_2', - '[meta ]'); - - MT('variable_interpolation_simple_syntax_3', - '[meta [variable aaaaa][string .aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];', - '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];', - '[meta ?>]'); - - MT('variable_interpolation_escaping', - '[meta aaa.aaa"];', - '[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];', - '[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];', - '[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];', - '[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];', - '[meta ?>]'); - - MT('variable_interpolation_complex_syntax_1', - '[meta aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];', - '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'); - - MT('variable_interpolation_complex_syntax_2', - '[meta } $aaaaaa.aaa"];', - '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];', - '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];'); - - - function build_recursive_monsters(nt, t, n){ - var monsters = [t]; - for (var i = 1; i <= n; ++i) - monsters[i] = nt.join(monsters[i - 1]); - return monsters; - } - - var m1 = build_recursive_monsters( - ['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'], - '[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]', - 10 - ); - - MT('variable_interpolation_complex_syntax_3_1', - '[meta ]'); - - var m2 = build_recursive_monsters( - ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'], - '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', - 5 - ); - - MT('variable_interpolation_complex_syntax_3_2', - '[meta ]'); - - function build_recursive_monsters_2(mf1, mf2, nt, t, n){ - var monsters = [t]; - for (var i = 1; i <= n; ++i) - monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3]; - return monsters; - } - - var m3 = build_recursive_monsters_2( - m1, - m2, - ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'], - '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', - 4 - ); - - MT('variable_interpolation_complex_syntax_3_3', - '[meta ]'); - - MT("variable_interpolation_heredoc", - "[meta - -CodeMirror: Properties files mode - - - - - - - - - -
                -

                Properties files mode

                -
                - - -

                MIME types defined: text/x-properties, - text/x-ini.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/properties/properties.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/properties/properties.js deleted file mode 100644 index 9da5baf..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/properties/properties.js +++ /dev/null @@ -1,78 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("properties", function() { - return { - token: function(stream, state) { - var sol = stream.sol() || state.afterSection; - var eol = stream.eol(); - - state.afterSection = false; - - if (sol) { - if (state.nextMultiline) { - state.inMultiline = true; - state.nextMultiline = false; - } else { - state.position = "def"; - } - } - - if (eol && ! state.nextMultiline) { - state.inMultiline = false; - state.position = "def"; - } - - if (sol) { - while(stream.eatSpace()); - } - - var ch = stream.next(); - - if (sol && (ch === "#" || ch === "!" || ch === ";")) { - state.position = "comment"; - stream.skipToEnd(); - return "comment"; - } else if (sol && ch === "[") { - state.afterSection = true; - stream.skipTo("]"); stream.eat("]"); - return "header"; - } else if (ch === "=" || ch === ":") { - state.position = "quote"; - return null; - } else if (ch === "\\" && state.position === "quote") { - if (stream.eol()) { // end of line? - // Multiline value - state.nextMultiline = true; - } - } - - return state.position; - }, - - startState: function() { - return { - position : "def", // Current position, "def", "quote" or "comment" - nextMultiline : false, // Is the next line multiline value - inMultiline : false, // Is the current line a multiline value - afterSection : false // Did we just open a section - }; - } - - }; -}); - -CodeMirror.defineMIME("text/x-properties", "properties"); -CodeMirror.defineMIME("text/x-ini", "properties"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/python/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/python/index.html deleted file mode 100644 index 86eb3d5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/python/index.html +++ /dev/null @@ -1,198 +0,0 @@ - - -CodeMirror: Python mode - - - - - - - - - - -
                -

                Python mode

                - -
                - - -

                Cython mode

                - -
                - - -

                Configuration Options for Python mode:

                -
                  -
                • version - 2/3 - The version of Python to recognize. Default is 2.
                • -
                • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
                • -
                • hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.
                • -
                -

                Advanced Configuration Options:

                -

                Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help

                -
                  -
                • singleOperators - RegEx - Regular Expression for single operator matching, default :
                  ^[\\+\\-\\*/%&|\\^~<>!]
                  including
                  @
                  on Python 3
                • -
                • singleDelimiters - RegEx - Regular Expression for single delimiter matching, default :
                  ^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]
                • -
                • doubleOperators - RegEx - Regular Expression for double operators matching, default :
                  ^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))
                • -
                • doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default :
                  ^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))
                • -
                • tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default :
                  ^((//=)|(>>=)|(<<=)|(\\*\\*=))
                • -
                • identifiers - RegEx - Regular Expression for identifier, default :
                  ^[_A-Za-z][_A-Za-z0-9]*
                  on Python 2 and
                  ^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*
                  on Python 3.
                • -
                • extra_keywords - list of string - List of extra words ton consider as keywords
                • -
                • extra_builtins - list of string - List of extra words ton consider as builtins
                • -
                - - -

                MIME types defined: text/x-python and text/x-cython.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/python/python.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/python/python.js deleted file mode 100644 index e5a0971..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/python/python.js +++ /dev/null @@ -1,358 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var wordOperators = wordRegexp(["and", "or", "not", "is"]); - var commonKeywords = ["as", "assert", "break", "class", "continue", - "def", "del", "elif", "else", "except", "finally", - "for", "from", "global", "if", "import", - "lambda", "pass", "raise", "return", - "try", "while", "with", "yield", "in"]; - var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr", - "classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod", - "enumerate", "eval", "filter", "float", "format", "frozenset", - "getattr", "globals", "hasattr", "hash", "help", "hex", "id", - "input", "int", "isinstance", "issubclass", "iter", "len", - "list", "locals", "map", "max", "memoryview", "min", "next", - "object", "oct", "open", "ord", "pow", "property", "range", - "repr", "reversed", "round", "set", "setattr", "slice", - "sorted", "staticmethod", "str", "sum", "super", "tuple", - "type", "vars", "zip", "__import__", "NotImplemented", - "Ellipsis", "__debug__"]; - var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile", - "file", "intern", "long", "raw_input", "reduce", "reload", - "unichr", "unicode", "xrange", "False", "True", "None"], - keywords: ["exec", "print"]}; - var py3 = {builtins: ["ascii", "bytes", "exec", "print"], - keywords: ["nonlocal", "False", "True", "None", "async", "await"]}; - - CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins)); - - function top(state) { - return state.scopes[state.scopes.length - 1]; - } - - CodeMirror.defineMode("python", function(conf, parserConf) { - var ERRORCLASS = "error"; - - var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"); - var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - - if (parserConf.version && parseInt(parserConf.version, 10) == 3){ - // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); - } else { - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - } - - var hangingIndent = parserConf.hangingIndent || conf.indentUnit; - - var myKeywords = commonKeywords, myBuiltins = commonBuiltins; - if(parserConf.extra_keywords != undefined){ - myKeywords = myKeywords.concat(parserConf.extra_keywords); - } - if(parserConf.extra_builtins != undefined){ - myBuiltins = myBuiltins.concat(parserConf.extra_builtins); - } - if (parserConf.version && parseInt(parserConf.version, 10) == 3) { - myKeywords = myKeywords.concat(py3.keywords); - myBuiltins = myBuiltins.concat(py3.builtins); - var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); - } else { - myKeywords = myKeywords.concat(py2.keywords); - myBuiltins = myBuiltins.concat(py2.builtins); - var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); - } - var keywords = wordRegexp(myKeywords); - var builtins = wordRegexp(myBuiltins); - - // tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol() && top(state).type == "py") { - var scopeOffset = top(state).offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) - pushScope(stream, state, "py"); - else if (lineOffset < scopeOffset && dedent(stream, state)) - state.errorToken = true; - return null; - } else { - var style = tokenBaseInner(stream, state); - if (scopeOffset > 0 && dedent(stream, state)) - style += " " + ERRORCLASS; - return style; - } - } - return tokenBaseInner(stream, state); - } - - function tokenBaseInner(stream, state) { - if (stream.eatSpace()) return null; - - var ch = stream.peek(); - - // Handle Comments - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return "number"; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true; - // Binary - if (stream.match(/^0b[01]+/i)) intLiteral = true; - // Octal - if (stream.match(/^0o[0-7]+/i)) intLiteral = true; - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) intLiteral = true; - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return "number"; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) - return null; - - if (stream.match(doubleOperators) || stream.match(singleOperators)) - return "operator"; - - if (stream.match(singleDelimiters)) - return null; - - if (stream.match(keywords) || stream.match(wordOperators)) - return "keyword"; - - if (stream.match(builtins)) - return "builtin"; - - if (stream.match(/^(self|cls)\b/)) - return "variable-2"; - - if (stream.match(identifiers)) { - if (state.lastToken == "def" || state.lastToken == "class") - return "def"; - return "variable"; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) - delimiter = delimiter.substr(1); - - var singleline = delimiter.length == 1; - var OUTCLASS = "string"; - - function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); - if (stream.eat("\\")) { - stream.next(); - if (singleline && stream.eol()) - return OUTCLASS; - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) - return ERRORCLASS; - else - state.tokenize = tokenBase; - } - return OUTCLASS; - } - tokenString.isString = true; - return tokenString; - } - - function pushScope(stream, state, type) { - var offset = 0, align = null; - if (type == "py") { - while (top(state).type != "py") - state.scopes.pop(); - } - offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent); - if (type != "py" && !stream.match(/^(\s|#.*)*$/, false)) - align = stream.column() + 1; - state.scopes.push({offset: offset, type: type, align: align}); - } - - function dedent(stream, state) { - var indented = stream.indentation(); - while (top(state).offset > indented) { - if (top(state).type != "py") return true; - state.scopes.pop(); - } - return top(state).offset != indented; - } - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current == ".") { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style == null && state.lastStyle == "meta") { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = "meta"; - } - return style; - } - - // Handle decorators - if (current == "@"){ - if(parserConf.version && parseInt(parserConf.version, 10) == 3){ - return stream.match(identifiers, false) ? "meta" : "operator"; - } else { - return stream.match(identifiers, false) ? "meta" : ERRORCLASS; - } - } - - if ((style == "variable" || style == "builtin") - && state.lastStyle == "meta") - style = "meta"; - - // Handle scope changes. - if (current == "pass" || current == "return") - state.dedent += 1; - - if (current == "lambda") state.lambda = true; - if (current == ":" && !state.lambda && top(state).type == "py") - pushScope(stream, state, "py"); - - var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1; - if (delimiter_index != -1) - pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); - - delimiter_index = "])}".indexOf(current); - if (delimiter_index != -1) { - if (top(state).type == current) state.scopes.pop(); - else return ERRORCLASS; - } - if (state.dedent > 0 && stream.eol() && top(state).type == "py") { - if (state.scopes.length > 1) state.scopes.pop(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset: basecolumn || 0, type: "py", align: null}], - lastStyle: null, - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var addErr = state.errorToken; - if (addErr) state.errorToken = false; - var style = tokenLexer(stream, state); - - state.lastStyle = style; - - var current = stream.current(); - if (current && style) - state.lastToken = current; - - if (stream.eol() && state.lambda) - state.lambda = false; - return addErr ? style + " " + ERRORCLASS : style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) - return state.tokenize.isString ? CodeMirror.Pass : 0; - - var scope = top(state); - var closing = textAfter && textAfter.charAt(0) == scope.type; - if (scope.align != null) - return scope.align - (closing ? 1 : 0); - else if (closing && state.scopes.length > 1) - return state.scopes[state.scopes.length - 2].offset; - else - return scope.offset; - }, - - closeBrackets: {triples: "'\""}, - lineComment: "#", - fold: "indent" - }; - return external; - }); - - CodeMirror.defineMIME("text/x-python", "python"); - - var words = function(str) { return str.split(" "); }; - - CodeMirror.defineMIME("text/x-cython", { - name: "python", - extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+ - "extern gil include nogil property public"+ - "readonly struct union DEF IF ELIF ELSE") - }); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/q/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/q/index.html deleted file mode 100644 index 72785ba..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/q/index.html +++ /dev/null @@ -1,144 +0,0 @@ - - -CodeMirror: Q mode - - - - - - - - - - -
                -

                Q mode

                - - -
                - - - -

                MIME type defined: text/x-q.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/q/q.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/q/q.js deleted file mode 100644 index a4af938..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/q/q.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("q",function(config){ - var indentUnit=config.indentUnit, - curPunc, - keywords=buildRE(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]), - E=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/; - function buildRE(w){return new RegExp("^("+w.join("|")+")$");} - function tokenBase(stream,state){ - var sol=stream.sol(),c=stream.next(); - curPunc=null; - if(sol) - if(c=="/") - return(state.tokenize=tokenLineComment)(stream,state); - else if(c=="\\"){ - if(stream.eol()||/\s/.test(stream.peek())) - return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream, state):state.tokenize=tokenBase,"comment"; - else - return state.tokenize=tokenBase,"builtin"; - } - if(/\s/.test(c)) - return stream.peek()=="/"?(stream.skipToEnd(),"comment"):"whitespace"; - if(c=='"') - return(state.tokenize=tokenString)(stream,state); - if(c=='`') - return stream.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol"; - if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){ - var t=null; - stream.backUp(1); - if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/) - || stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/) - || stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/) - || stream.match(/^\d+[ptuv]{1}/)) - t="temporal"; - else if(stream.match(/^0[NwW]{1}/) - || stream.match(/^0x[\d|a-f|A-F]*/) - || stream.match(/^[0|1]+[b]{1}/) - || stream.match(/^\d+[chijn]{1}/) - || stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/)) - t="number"; - return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error"); - } - if(/[A-Z|a-z]|\./.test(c)) - return stream.eatWhile(/[A-Z|a-z|\.|_|\d]/),keywords.test(stream.current())?"keyword":"variable"; - if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c)) - return null; - if(/[{}\(\[\]\)]/.test(c)) - return null; - return"error"; - } - function tokenLineComment(stream,state){ - return stream.skipToEnd(),/\/\s*$/.test(stream.current())?(state.tokenize=tokenBlockComment)(stream,state):(state.tokenize=tokenBase),"comment"; - } - function tokenBlockComment(stream,state){ - var f=stream.sol()&&stream.peek()=="\\"; - stream.skipToEnd(); - if(f&&/^\\\s*$/.test(stream.current())) - state.tokenize=tokenBase; - return"comment"; - } - function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";} - function tokenString(stream,state){ - var escaped=false,next,end=false; - while((next=stream.next())){ - if(next=="\""&&!escaped){end=true;break;} - escaped=!escaped&&next=="\\"; - } - if(end)state.tokenize=tokenBase; - return"string"; - } - function pushContext(state,type,col){state.context={prev:state.context,indent:state.indent,col:col,type:type};} - function popContext(state){state.indent=state.context.indent;state.context=state.context.prev;} - return{ - startState:function(){ - return{tokenize:tokenBase, - context:null, - indent:0, - col:0}; - }, - token:function(stream,state){ - if(stream.sol()){ - if(state.context&&state.context.align==null) - state.context.align=false; - state.indent=stream.indentation(); - } - //if (stream.eatSpace()) return null; - var style=state.tokenize(stream,state); - if(style!="comment"&&state.context&&state.context.align==null&&state.context.type!="pattern"){ - state.context.align=true; - } - if(curPunc=="(")pushContext(state,")",stream.column()); - else if(curPunc=="[")pushContext(state,"]",stream.column()); - else if(curPunc=="{")pushContext(state,"}",stream.column()); - else if(/[\]\}\)]/.test(curPunc)){ - while(state.context&&state.context.type=="pattern")popContext(state); - if(state.context&&curPunc==state.context.type)popContext(state); - } - else if(curPunc=="."&&state.context&&state.context.type=="pattern")popContext(state); - else if(/atom|string|variable/.test(style)&&state.context){ - if(/[\}\]]/.test(state.context.type)) - pushContext(state,"pattern",stream.column()); - else if(state.context.type=="pattern"&&!state.context.align){ - state.context.align=true; - state.context.col=stream.column(); - } - } - return style; - }, - indent:function(state,textAfter){ - var firstChar=textAfter&&textAfter.charAt(0); - var context=state.context; - if(/[\]\}]/.test(firstChar)) - while (context&&context.type=="pattern")context=context.prev; - var closing=context&&firstChar==context.type; - if(!context) - return 0; - else if(context.type=="pattern") - return context.col; - else if(context.align) - return context.col+(closing?0:1); - else - return context.indent+(closing?0:indentUnit); - } - }; -}); -CodeMirror.defineMIME("text/x-q","q"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/r/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/r/index.html deleted file mode 100644 index 6dd9634..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/r/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - -CodeMirror: R mode - - - - - - - - - -
                -

                R mode

                -
                - - -

                MIME types defined: text/x-rsrc.

                - -

                Development of the CodeMirror R mode was kindly sponsored - by Ubalo.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/r/r.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/r/r.js deleted file mode 100644 index 1ab4a95..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/r/r.js +++ /dev/null @@ -1,162 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("r", function(config) { - function wordObj(str) { - var words = str.split(" "), res = {}; - for (var i = 0; i < words.length; ++i) res[words[i]] = true; - return res; - } - var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); - var builtins = wordObj("list quote bquote eval return call parse deparse"); - var keywords = wordObj("if else repeat while function for in next break"); - var blockkeywords = wordObj("if else repeat while function for"); - var opChars = /[+\-*\/^<>=!&|~$:]/; - var curPunc; - - function tokenBase(stream, state) { - curPunc = null; - var ch = stream.next(); - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "0" && stream.eat("x")) { - stream.eatWhile(/[\da-f]/i); - return "number"; - } else if (ch == "." && stream.eat(/\d/)) { - stream.match(/\d*(?:e[+\-]?\d+)?/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); - return "number"; - } else if (ch == "'" || ch == '"') { - state.tokenize = tokenString(ch); - return "string"; - } else if (ch == "." && stream.match(/.[.\d]+/)) { - return "keyword"; - } else if (/[\w\.]/.test(ch) && ch != "_") { - stream.eatWhile(/[\w\.]/); - var word = stream.current(); - if (atoms.propertyIsEnumerable(word)) return "atom"; - if (keywords.propertyIsEnumerable(word)) { - // Block keywords start new blocks, except 'else if', which only starts - // one new block for the 'if', no block for the 'else'. - if (blockkeywords.propertyIsEnumerable(word) && - !stream.match(/\s*if(\s+|$)/, false)) - curPunc = "block"; - return "keyword"; - } - if (builtins.propertyIsEnumerable(word)) return "builtin"; - return "variable"; - } else if (ch == "%") { - if (stream.skipTo("%")) stream.next(); - return "variable-2"; - } else if (ch == "<" && stream.eat("-")) { - return "arrow"; - } else if (ch == "=" && state.ctx.argList) { - return "arg-is"; - } else if (opChars.test(ch)) { - if (ch == "$") return "dollar"; - stream.eatWhile(opChars); - return "operator"; - } else if (/[\(\){}\[\];]/.test(ch)) { - curPunc = ch; - if (ch == ";") return "semi"; - return null; - } else { - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - if (stream.eat("\\")) { - var ch = stream.next(); - if (ch == "x") stream.match(/^[a-f0-9]{2}/i); - else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); - else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); - else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); - else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); - return "string-2"; - } else { - var next; - while ((next = stream.next()) != null) { - if (next == quote) { state.tokenize = tokenBase; break; } - if (next == "\\") { stream.backUp(1); break; } - } - return "string"; - } - }; - } - - function push(state, type, stream) { - state.ctx = {type: type, - indent: state.indent, - align: null, - column: stream.column(), - prev: state.ctx}; - } - function pop(state) { - state.indent = state.ctx.indent; - state.ctx = state.ctx.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - ctx: {type: "top", - indent: -config.indentUnit, - align: false}, - indent: 0, - afterIdent: false}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.ctx.align == null) state.ctx.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (style != "comment" && state.ctx.align == null) state.ctx.align = true; - - var ctype = state.ctx.type; - if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state); - if (curPunc == "{") push(state, "}", stream); - else if (curPunc == "(") { - push(state, ")", stream); - if (state.afterIdent) state.ctx.argList = true; - } - else if (curPunc == "[") push(state, "]", stream); - else if (curPunc == "block") push(state, "block", stream); - else if (curPunc == ctype) pop(state); - state.afterIdent = style == "variable" || style == "keyword"; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, - closing = firstChar == ctx.type; - if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indent + (closing ? 0 : config.indentUnit); - }, - - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/x-rsrc", "r"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/changes/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/changes/index.html deleted file mode 100644 index 6e5031b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/changes/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: RPM changes mode - - - - - - - - - - - -
                -

                RPM changes mode

                - -
                - - -

                MIME types defined: text/x-rpm-changes.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/index.html deleted file mode 100644 index 9a34e6d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/index.html +++ /dev/null @@ -1,149 +0,0 @@ - - -CodeMirror: RPM changes mode - - - - - - - - - - - -
                -

                RPM changes mode

                - -
                - - -

                RPM spec mode

                - -
                - - -

                MIME types defined: text/x-rpm-spec, text/x-rpm-changes.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/rpm.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/rpm.js deleted file mode 100644 index 3bb7cd2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/rpm/rpm.js +++ /dev/null @@ -1,101 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("rpm-changes", function() { - var headerSeperator = /^-+$/; - var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; - var simpleEmail = /^[\w+.-]+@[\w.-]+/; - - return { - token: function(stream) { - if (stream.sol()) { - if (stream.match(headerSeperator)) { return 'tag'; } - if (stream.match(headerLine)) { return 'tag'; } - } - if (stream.match(simpleEmail)) { return 'string'; } - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes"); - -// Quick and dirty spec file highlighting - -CodeMirror.defineMode("rpm-spec", function() { - var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - - var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; - var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros - var control_flow_simple = /^%(else|endif)/; // rpm control flow macros - var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros - - return { - startState: function () { - return { - controlFlow: false, - macroParameters: false, - section: false - }; - }, - token: function (stream, state) { - var ch = stream.peek(); - if (ch == "#") { stream.skipToEnd(); return "comment"; } - - if (stream.sol()) { - if (stream.match(preamble)) { return "preamble"; } - if (stream.match(section)) { return "section"; } - } - - if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' - if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' - - if (stream.match(control_flow_simple)) { return "keyword"; } - if (stream.match(control_flow_complex)) { - state.controlFlow = true; - return "keyword"; - } - if (state.controlFlow) { - if (stream.match(operators)) { return "operator"; } - if (stream.match(/^(\d+)/)) { return "number"; } - if (stream.eol()) { state.controlFlow = false; } - } - - if (stream.match(arch)) { return "number"; } - - // Macros like '%make_install' or '%attr(0775,root,root)' - if (stream.match(/^%[\w]+/)) { - if (stream.match(/^\(/)) { state.macroParameters = true; } - return "macro"; - } - if (state.macroParameters) { - if (stream.match(/^\d+/)) { return "number";} - if (stream.match(/^\)/)) { - state.macroParameters = false; - return "macro"; - } - } - if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' - - //TODO: Include bash script sub-parser (CodeMirror supports that) - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/index.html deleted file mode 100644 index 97544ba..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/index.html +++ /dev/null @@ -1,183 +0,0 @@ - - -CodeMirror: Ruby mode - - - - - - - - - - -
                -

                Ruby mode

                -
                - - -

                MIME types defined: text/x-ruby.

                - -

                Development of the CodeMirror Ruby mode was kindly sponsored - by Ubalo.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/ruby.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/ruby.js deleted file mode 100644 index 771f855..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/ruby.js +++ /dev/null @@ -1,285 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("ruby", function(config) { - function wordObj(words) { - var o = {}; - for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; - return o; - } - var keywords = wordObj([ - "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", - "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", - "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", - "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", - "caller", "lambda", "proc", "public", "protected", "private", "require", "load", - "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" - ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then", - "catch", "loop", "proc", "begin"]); - var dedentWords = wordObj(["end", "until"]); - var matching = {"[": "]", "{": "}", "(": ")"}; - var curPunc; - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); - return newtok(stream, state); - } - - function tokenBase(stream, state) { - if (stream.sol() && stream.match("=begin") && stream.eol()) { - state.tokenize.push(readBlockComment); - return "comment"; - } - if (stream.eatSpace()) return null; - var ch = stream.next(), m; - if (ch == "`" || ch == "'" || ch == '"') { - return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); - } else if (ch == "/") { - var currentIndex = stream.current().length; - if (stream.skipTo("/")) { - var search_till = stream.current().length; - stream.backUp(stream.current().length - currentIndex); - var balance = 0; // balance brackets - while (stream.current().length < search_till) { - var chchr = stream.next(); - if (chchr == "(") balance += 1; - else if (chchr == ")") balance -= 1; - if (balance < 0) break; - } - stream.backUp(stream.current().length - currentIndex); - if (balance == 0) - return chain(readQuoted(ch, "string-2", true), stream, state); - } - return "operator"; - } else if (ch == "%") { - var style = "string", embed = true; - if (stream.eat("s")) style = "atom"; - else if (stream.eat(/[WQ]/)) style = "string"; - else if (stream.eat(/[r]/)) style = "string-2"; - else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; } - var delim = stream.eat(/[^\w\s=]/); - if (!delim) return "operator"; - if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; - return chain(readQuoted(delim, style, embed, true), stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { - return chain(readHereDoc(m[1]), stream, state); - } else if (ch == "0") { - if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); - else if (stream.eat("b")) stream.eatWhile(/[01]/); - else stream.eatWhile(/[0-7]/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); - return "number"; - } else if (ch == "?") { - while (stream.match(/^\\[CM]-/)) {} - if (stream.eat("\\")) stream.eatWhile(/\w/); - else stream.next(); - return "string"; - } else if (ch == ":") { - if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); - if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); - - // :> :>> :< :<< are valid symbols - if (stream.eat(/[\<\>]/)) { - stream.eat(/[\<\>]/); - return "atom"; - } - - // :+ :- :/ :* :| :& :! are valid symbols - if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) { - return "atom"; - } - - // Symbols can't start by a digit - if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) { - stream.eatWhile(/[\w$\xa1-\uffff]/); - // Only one ? ! = is allowed and only as the last character - stream.eat(/[\?\!\=]/); - return "atom"; - } - return "operator"; - } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) { - stream.eat("@"); - stream.eatWhile(/[\w\xa1-\uffff]/); - return "variable-2"; - } else if (ch == "$") { - if (stream.eat(/[a-zA-Z_]/)) { - stream.eatWhile(/[\w]/); - } else if (stream.eat(/\d/)) { - stream.eat(/\d/); - } else { - stream.next(); // Must be a special global like $: or $! - } - return "variable-3"; - } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) { - stream.eatWhile(/[\w\xa1-\uffff]/); - stream.eat(/[\?\!]/); - if (stream.eat(":")) return "atom"; - return "ident"; - } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { - curPunc = "|"; - return null; - } else if (/[\(\)\[\]{}\\;]/.test(ch)) { - curPunc = ch; - return null; - } else if (ch == "-" && stream.eat(">")) { - return "arrow"; - } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { - var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); - if (ch == "." && !more) curPunc = "."; - return "operator"; - } else { - return null; - } - } - - function tokenBaseUntilBrace(depth) { - if (!depth) depth = 1; - return function(stream, state) { - if (stream.peek() == "}") { - if (depth == 1) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } else { - state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1); - } - } else if (stream.peek() == "{") { - state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1); - } - return tokenBase(stream, state); - }; - } - function tokenBaseOnce() { - var alreadyCalled = false; - return function(stream, state) { - if (alreadyCalled) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - alreadyCalled = true; - return tokenBase(stream, state); - }; - } - function readQuoted(quote, style, embed, unescaped) { - return function(stream, state) { - var escaped = false, ch; - - if (state.context.type === 'read-quoted-paused') { - state.context = state.context.prev; - stream.eat("}"); - } - - while ((ch = stream.next()) != null) { - if (ch == quote && (unescaped || !escaped)) { - state.tokenize.pop(); - break; - } - if (embed && ch == "#" && !escaped) { - if (stream.eat("{")) { - if (quote == "}") { - state.context = {prev: state.context, type: 'read-quoted-paused'}; - } - state.tokenize.push(tokenBaseUntilBrace()); - break; - } else if (/[@\$]/.test(stream.peek())) { - state.tokenize.push(tokenBaseOnce()); - break; - } - } - escaped = !escaped && ch == "\\"; - } - return style; - }; - } - function readHereDoc(phrase) { - return function(stream, state) { - if (stream.match(phrase)) state.tokenize.pop(); - else stream.skipToEnd(); - return "string"; - }; - } - function readBlockComment(stream, state) { - if (stream.sol() && stream.match("=end") && stream.eol()) - state.tokenize.pop(); - stream.skipToEnd(); - return "comment"; - } - - return { - startState: function() { - return {tokenize: [tokenBase], - indented: 0, - context: {type: "top", indented: -config.indentUnit}, - continuedLine: false, - lastTok: null, - varList: false}; - }, - - token: function(stream, state) { - curPunc = null; - if (stream.sol()) state.indented = stream.indentation(); - var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; - var thisTok = curPunc; - if (style == "ident") { - var word = stream.current(); - style = state.lastTok == "." ? "property" - : keywords.propertyIsEnumerable(stream.current()) ? "keyword" - : /^[A-Z]/.test(word) ? "tag" - : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" - : "variable"; - if (style == "keyword") { - thisTok = word; - if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; - else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; - else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) - kwtype = "indent"; - else if (word == "do" && state.context.indented < state.indented) - kwtype = "indent"; - } - } - if (curPunc || (style && style != "comment")) state.lastTok = thisTok; - if (curPunc == "|") state.varList = !state.varList; - - if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) - state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; - else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) - state.context = state.context.prev; - - if (stream.eol()) - state.continuedLine = (curPunc == "\\" || style == "operator"); - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0); - var ct = state.context; - var closing = ct.type == matching[firstChar] || - ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); - return ct.indented + (closing ? 0 : config.indentUnit) + - (state.continuedLine ? config.indentUnit : 0); - }, - - electricChars: "}de", // enD and rescuE - lineComment: "#" - }; -}); - -CodeMirror.defineMIME("text/x-ruby", "ruby"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/test.js deleted file mode 100644 index cade864..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/ruby/test.js +++ /dev/null @@ -1,14 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("divide_equal_operator", - "[variable bar] [operator /=] [variable foo]"); - - MT("divide_equal_operator_no_spacing", - "[variable foo][operator /=][number 42]"); - -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sass/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sass/index.html deleted file mode 100644 index 9f4a790..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sass/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Sass mode - - - - - - - - - - -
                -

                Sass mode

                -
                - - -

                MIME types defined: text/x-sass.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sass/sass.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sass/sass.js deleted file mode 100644 index 6973ece..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sass/sass.js +++ /dev/null @@ -1,414 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sass", function(config) { - function tokenRegexp(words) { - return new RegExp("^" + words.join("|")); - } - - var keywords = ["true", "false", "null", "auto"]; - var keywordsRegexp = new RegExp("^" + keywords.join("|")); - - var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", - "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"]; - var opRegexp = tokenRegexp(operators); - - var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/; - - function urlTokens(stream, state) { - var ch = stream.peek(); - - if (ch === ")") { - stream.next(); - state.tokenizer = tokenBase; - return "operator"; - } else if (ch === "(") { - stream.next(); - stream.eatSpace(); - - return "operator"; - } else if (ch === "'" || ch === '"') { - state.tokenizer = buildStringTokenizer(stream.next()); - return "string"; - } else { - state.tokenizer = buildStringTokenizer(")", false); - return "string"; - } - } - function comment(indentation, multiLine) { - return function(stream, state) { - if (stream.sol() && stream.indentation() <= indentation) { - state.tokenizer = tokenBase; - return tokenBase(stream, state); - } - - if (multiLine && stream.skipTo("*/")) { - stream.next(); - stream.next(); - state.tokenizer = tokenBase; - } else { - stream.skipToEnd(); - } - - return "comment"; - }; - } - - function buildStringTokenizer(quote, greedy) { - if (greedy == null) { greedy = true; } - - function stringTokenizer(stream, state) { - var nextChar = stream.next(); - var peekChar = stream.peek(); - var previousChar = stream.string.charAt(stream.pos-2); - - var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); - - if (endingString) { - if (nextChar !== quote && greedy) { stream.next(); } - state.tokenizer = tokenBase; - return "string"; - } else if (nextChar === "#" && peekChar === "{") { - state.tokenizer = buildInterpolationTokenizer(stringTokenizer); - stream.next(); - return "operator"; - } else { - return "string"; - } - } - - return stringTokenizer; - } - - function buildInterpolationTokenizer(currentTokenizer) { - return function(stream, state) { - if (stream.peek() === "}") { - stream.next(); - state.tokenizer = currentTokenizer; - return "operator"; - } else { - return tokenBase(stream, state); - } - }; - } - - function indent(state) { - if (state.indentCount == 0) { - state.indentCount++; - var lastScopeOffset = state.scopes[0].offset; - var currentOffset = lastScopeOffset + config.indentUnit; - state.scopes.unshift({ offset:currentOffset }); - } - } - - function dedent(state) { - if (state.scopes.length == 1) return; - - state.scopes.shift(); - } - - function tokenBase(stream, state) { - var ch = stream.peek(); - - // Comment - if (stream.match("/*")) { - state.tokenizer = comment(stream.indentation(), true); - return state.tokenizer(stream, state); - } - if (stream.match("//")) { - state.tokenizer = comment(stream.indentation(), false); - return state.tokenizer(stream, state); - } - - // Interpolation - if (stream.match("#{")) { - state.tokenizer = buildInterpolationTokenizer(tokenBase); - return "operator"; - } - - // Strings - if (ch === '"' || ch === "'") { - stream.next(); - state.tokenizer = buildStringTokenizer(ch); - return "string"; - } - - if(!state.cursorHalf){// state.cursorHalf === 0 - // first half i.e. before : for key-value pairs - // including selectors - - if (ch === ".") { - stream.next(); - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } else if (stream.peek() === "#") { - indent(state); - return "atom"; - } - } - - if (ch === "#") { - stream.next(); - // ID selectors - if (stream.match(/^[\w-]+/)) { - indent(state); - return "atom"; - } - if (stream.peek() === "#") { - indent(state); - return "atom"; - } - } - - // Variables - if (ch === "$") { - stream.next(); - stream.eatWhile(/[\w-]/); - return "variable-2"; - } - - // Numbers - if (stream.match(/^-?[0-9\.]+/)) - return "number"; - - // Units - if (stream.match(/^(px|em|in)\b/)) - return "unit"; - - if (stream.match(keywordsRegexp)) - return "keyword"; - - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - return "atom"; - } - - if (ch === "=") { - // Match shortcut mixin definition - if (stream.match(/^=[\w-]+/)) { - indent(state); - return "meta"; - } - } - - if (ch === "+") { - // Match shortcut mixin definition - if (stream.match(/^\+[\w-]+/)){ - return "variable-3"; - } - } - - if(ch === "@"){ - if(stream.match(/@extend/)){ - if(!stream.match(/\s*[\w]/)) - dedent(state); - } - } - - - // Indent Directives - if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { - indent(state); - return "meta"; - } - - // Other Directives - if (ch === "@") { - stream.next(); - stream.eatWhile(/[\w-]/); - return "meta"; - } - - if (stream.eatWhile(/[\w-]/)){ - if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ - return "property"; - } - else if(stream.match(/ *:/,false)){ - indent(state); - state.cursorHalf = 1; - return "atom"; - } - else if(stream.match(/ *,/,false)){ - return "atom"; - } - else{ - indent(state); - return "atom"; - } - } - - if(ch === ":"){ - if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element - return "keyword"; - } - stream.next(); - state.cursorHalf=1; - return "operator"; - } - - } // cursorHalf===0 ends here - else{ - - if (ch === "#") { - stream.next(); - // Hex numbers - if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "number"; - } - } - - // Numbers - if (stream.match(/^-?[0-9\.]+/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "number"; - } - - // Units - if (stream.match(/^(px|em|in)\b/)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "unit"; - } - - if (stream.match(keywordsRegexp)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "keyword"; - } - - if (stream.match(/^url/) && stream.peek() === "(") { - state.tokenizer = urlTokens; - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "atom"; - } - - // Variables - if (ch === "$") { - stream.next(); - stream.eatWhile(/[\w-]/); - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "variable-3"; - } - - // bang character for !important, !default, etc. - if (ch === "!") { - stream.next(); - if(!stream.peek()){ - state.cursorHalf = 0; - } - return stream.match(/^[\w]+/) ? "keyword": "operator"; - } - - if (stream.match(opRegexp)){ - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "operator"; - } - - // attributes - if (stream.eatWhile(/[\w-]/)) { - if(!stream.peek()){ - state.cursorHalf = 0; - } - return "attribute"; - } - - //stream.eatSpace(); - if(!stream.peek()){ - state.cursorHalf = 0; - return null; - } - - } // else ends here - - if (stream.match(opRegexp)) - return "operator"; - - // If we haven't returned by now, we move 1 character - // and return an error - stream.next(); - return null; - } - - function tokenLexer(stream, state) { - if (stream.sol()) state.indentCount = 0; - var style = state.tokenizer(stream, state); - var current = stream.current(); - - if (current === "@return" || current === "}"){ - dedent(state); - } - - if (style !== null) { - var startOfToken = stream.pos - current.length; - - var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); - - var newScopes = []; - - for (var i = 0; i < state.scopes.length; i++) { - var scope = state.scopes[i]; - - if (scope.offset <= withCurrentIndent) - newScopes.push(scope); - } - - state.scopes = newScopes; - } - - - return style; - } - - return { - startState: function() { - return { - tokenizer: tokenBase, - scopes: [{offset: 0, type: "sass"}], - indentCount: 0, - cursorHalf: 0, // cursor half tells us if cursor lies after (1) - // or before (0) colon (well... more or less) - definedVars: [], - definedMixins: [] - }; - }, - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = { style: style, content: stream.current() }; - - return style; - }, - - indent: function(state) { - return state.scopes[0].offset; - } - }; -}); - -CodeMirror.defineMIME("text/x-sass", "sass"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/scheme/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/scheme/index.html deleted file mode 100644 index 04d5c6a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/scheme/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - -CodeMirror: Scheme mode - - - - - - - - - -
                -

                Scheme mode

                -
                - - -

                MIME types defined: text/x-scheme.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/scheme/scheme.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/scheme/scheme.js deleted file mode 100644 index 2234645..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/scheme/scheme.js +++ /dev/null @@ -1,249 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Author: Koh Zi Han, based on implementation by Koh Zi Chun - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("scheme", function () { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket"; - var INDENT_WORD_SKIP = 2; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); - var indentKeys = makeKeywords("define let letrec let* lambda"); - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i); - var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i); - var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i); - var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i); - - function isBinaryNumber (stream) { - return stream.match(binaryMatcher); - } - - function isOctalNumber (stream) { - return stream.match(octalMatcher); - } - - function isDecimalNumber (stream, backup) { - if (backup === true) { - stream.backUp(1); - } - return stream.match(decimalMatcher); - } - - function isHexNumber (stream) { - return stream.match(hexMatcher); - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - sExprComment: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in scheme-string mode - break; - case "comment": // comment parsing mode - var next, maybeEnd = false; - while ((next = stream.next()) != null) { - if (next == "#" && maybeEnd) { - - state.mode = false; - break; - } - maybeEnd = (next == "|"); - } - returnType = COMMENT; - break; - case "s-expr-comment": // s-expr commenting mode - state.mode = false; - if(stream.peek() == "(" || stream.peek() == "["){ - // actually start scheme s-expr commenting mode - state.sExprComment = 0; - }else{ - // if not we just comment the entire of the next token - stream.eatWhile(/[^/s]/); // eat non spaces - returnType = COMMENT; - break; - } - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - - } else if (ch == "'") { - returnType = ATOM; - } else if (ch == '#') { - if (stream.eat("|")) { // Multi-line comment - state.mode = "comment"; // toggle to comment mode - returnType = COMMENT; - } else if (stream.eat(/[tf]/i)) { // #t/#f (atom) - returnType = ATOM; - } else if (stream.eat(';')) { // S-Expr comment - state.mode = "s-expr-comment"; - returnType = COMMENT; - } else { - var numTest = null, hasExactness = false, hasRadix = true; - if (stream.eat(/[ei]/i)) { - hasExactness = true; - } else { - stream.backUp(1); // must be radix specifier - } - if (stream.match(/^#b/i)) { - numTest = isBinaryNumber; - } else if (stream.match(/^#o/i)) { - numTest = isOctalNumber; - } else if (stream.match(/^#x/i)) { - numTest = isHexNumber; - } else if (stream.match(/^#d/i)) { - numTest = isDecimalNumber; - } else if (stream.match(/^[-+0-9.]/, false)) { - hasRadix = false; - numTest = isDecimalNumber; - // re-consume the intial # if all matches failed - } else if (!hasExactness) { - stream.eat('#'); - } - if (numTest != null) { - if (hasRadix && !hasExactness) { - // consume optional exactness after radix - stream.match(/^#[ei]/i); - } - if (numTest(stream)) - returnType = NUMBER; - } - } - } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal - returnType = NUMBER; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(), letter; - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - if(typeof state.sExprComment == "number") state.sExprComment++; - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - - if(typeof state.sExprComment == "number"){ - if(--state.sExprComment == 0){ - returnType = COMMENT; // final closing bracket - state.sExprComment = false; // turn off s-expr commenting mode - } - } - } - } else { - stream.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else returnType = "variable"; - } - } - return (typeof state.sExprComment == "number") ? COMMENT : returnType; - }, - - indent: function (state) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - }, - - closeBrackets: {pairs: "()[]{}\"\""}, - lineComment: ";;" - }; -}); - -CodeMirror.defineMIME("text/x-scheme", "scheme"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/index.html deleted file mode 100644 index 0b56300..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - -CodeMirror: Shell mode - - - - - - - - - - -
                -

                Shell mode

                - - - - - - -

                MIME types defined: text/x-sh.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/shell.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/shell.js deleted file mode 100644 index a684e8c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/shell.js +++ /dev/null @@ -1,139 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode('shell', function() { - - var words = {}; - function define(style, string) { - var split = string.split(' '); - for(var i = 0; i < split.length; i++) { - words[split[i]] = style; - } - }; - - // Atoms - define('atom', 'true false'); - - // Keywords - define('keyword', 'if then do else elif while until for in esac fi fin ' + - 'fil done exit set unset export function'); - - // Commands - define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + - 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + - 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + - 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + - 'touch vi vim wall wc wget who write yes zsh'); - - function tokenBase(stream, state) { - if (stream.eatSpace()) return null; - - var sol = stream.sol(); - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - return null; - } - if (ch === '\'' || ch === '"' || ch === '`') { - state.tokens.unshift(tokenString(ch)); - return tokenize(stream, state); - } - if (ch === '#') { - if (sol && stream.eat('!')) { - stream.skipToEnd(); - return 'meta'; // 'comment'? - } - stream.skipToEnd(); - return 'comment'; - } - if (ch === '$') { - state.tokens.unshift(tokenDollar); - return tokenize(stream, state); - } - if (ch === '+' || ch === '=') { - return 'operator'; - } - if (ch === '-') { - stream.eat('-'); - stream.eatWhile(/\w/); - return 'attribute'; - } - if (/\d/.test(ch)) { - stream.eatWhile(/\d/); - if(stream.eol() || !/\w/.test(stream.peek())) { - return 'number'; - } - } - stream.eatWhile(/[\w-]/); - var cur = stream.current(); - if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; - return words.hasOwnProperty(cur) ? words[cur] : null; - } - - function tokenString(quote) { - return function(stream, state) { - var next, end = false, escaped = false; - while ((next = stream.next()) != null) { - if (next === quote && !escaped) { - end = true; - break; - } - if (next === '$' && !escaped && quote !== '\'') { - escaped = true; - stream.backUp(1); - state.tokens.unshift(tokenDollar); - break; - } - escaped = !escaped && next === '\\'; - } - if (end || !escaped) { - state.tokens.shift(); - } - return (quote === '`' || quote === ')' ? 'quote' : 'string'); - }; - }; - - var tokenDollar = function(stream, state) { - if (state.tokens.length > 1) stream.eat('$'); - var ch = stream.next(), hungry = /\w/; - if (ch === '{') hungry = /[^}]/; - if (ch === '(') { - state.tokens[0] = tokenString(')'); - return tokenize(stream, state); - } - if (!/\d/.test(ch)) { - stream.eatWhile(hungry); - stream.eat('}'); - } - state.tokens.shift(); - return 'def'; - }; - - function tokenize(stream, state) { - return (state.tokens[0] || tokenBase) (stream, state); - }; - - return { - startState: function() {return {tokens:[]};}, - token: function(stream, state) { - return tokenize(stream, state); - }, - lineComment: '#', - fold: "brace" - }; -}); - -CodeMirror.defineMIME('text/x-sh', 'shell'); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/test.js deleted file mode 100644 index a413b5a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/shell/test.js +++ /dev/null @@ -1,58 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({}, "shell"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("var", - "text [def $var] text"); - MT("varBraces", - "text[def ${var}]text"); - MT("varVar", - "text [def $a$b] text"); - MT("varBracesVarBraces", - "text[def ${a}${b}]text"); - - MT("singleQuotedVar", - "[string 'text $var text']"); - MT("singleQuotedVarBraces", - "[string 'text ${var} text']"); - - MT("doubleQuotedVar", - '[string "text ][def $var][string text"]'); - MT("doubleQuotedVarBraces", - '[string "text][def ${var}][string text"]'); - MT("doubleQuotedVarPunct", - '[string "text ][def $@][string text"]'); - MT("doubleQuotedVarVar", - '[string "][def $a$b][string "]'); - MT("doubleQuotedVarBracesVarBraces", - '[string "][def ${a}${b}][string "]'); - - MT("notAString", - "text\\'text"); - MT("escapes", - "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); - - MT("subshell", - "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); - MT("doubleQuotedSubshell", - "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); - - MT("hashbang", - "[meta #!/bin/bash]"); - MT("comment", - "text [comment # Blurb]"); - - MT("numbers", - "[number 0] [number 1] [number 2]"); - MT("keywords", - "[keyword while] [atom true]; [keyword do]", - " [builtin sleep] [number 3]", - "[keyword done]"); - MT("options", - "[builtin ls] [attribute -l] [attribute --human-readable]"); - MT("operator", - "[def var][operator =]value"); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sparql/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sparql/index.html deleted file mode 100644 index 84ef4d3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sparql/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - -CodeMirror: SPARQL mode - - - - - - - - - - -
                -

                SPARQL mode

                -
                - - -

                MIME types defined: application/sparql-query.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sparql/sparql.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sparql/sparql.js deleted file mode 100644 index bbf8a76..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sparql/sparql.js +++ /dev/null @@ -1,174 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sparql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "iri", "uri", "bnode", "count", "sum", "min", "max", "avg", "sample", - "group_concat", "rand", "abs", "ceil", "floor", "round", "concat", "substr", "strlen", - "replace", "ucase", "lcase", "encode_for_uri", "contains", "strstarts", "strends", - "strbefore", "strafter", "year", "month", "day", "hours", "minutes", "seconds", - "timezone", "tz", "now", "uuid", "struuid", "md5", "sha1", "sha256", "sha384", - "sha512", "coalesce", "if", "strlang", "strdt", "isnumeric", "regex", "exists", - "isblank", "isliteral", "a"]); - var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", - "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", - "graph", "by", "asc", "desc", "as", "having", "undef", "values", "group", - "minus", "in", "not", "service", "silent", "using", "insert", "delete", "union", - "true", "false", "with", - "data", "copy", "to", "move", "add", "create", "drop", "clear", "load"]); - var operatorChars = /[*+\-<>=&|\^\/!\?]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - if(ch == "?" && stream.match(/\s/, false)){ - return "operator"; - } - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return "bracket"; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return "operator"; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else if (ch == "@") { - stream.eatWhile(/[a-z\d\-]/i); - return "meta"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(); - if (ops.test(word)) - return "builtin"; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("application/sparql-query", "sparql"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sql/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sql/index.html deleted file mode 100644 index a0d8d9e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sql/index.html +++ /dev/null @@ -1,84 +0,0 @@ - - -CodeMirror: SQL Mode for CodeMirror - - - - - - - - - - - - -
                -

                SQL Mode for CodeMirror

                -
                - -
                -

                MIME types defined: - text/x-sql, - text/x-mysql, - text/x-mariadb, - text/x-cassandra, - text/x-plsql, - text/x-mssql, - text/x-hive. -

                - - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sql/sql.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sql/sql.js deleted file mode 100644 index a908277..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/sql/sql.js +++ /dev/null @@ -1,391 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("sql", function(config, parserConfig) { - "use strict"; - - var client = parserConfig.client || {}, - atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, - builtin = parserConfig.builtin || {}, - keywords = parserConfig.keywords || {}, - operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, - support = parserConfig.support || {}, - hooks = parserConfig.hooks || {}, - dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; - - function tokenBase(stream, state) { - var ch = stream.next(); - - // call hooks from the mime type - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - - if (support.hexNumber == true && - ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) - || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { - // hex - // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html - return "number"; - } else if (support.binaryNumber == true && - (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) - || (ch == "0" && stream.match(/^b[01]+/)))) { - // bitstring - // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html - return "number"; - } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { - // numbers - // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html - stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/); - support.decimallessFloat == true && stream.eat('.'); - return "number"; - } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { - // placeholders - return "variable-3"; - } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { - // strings - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } else if ((((support.nCharCast == true && (ch == "n" || ch == "N")) - || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) - && (stream.peek() == "'" || stream.peek() == '"'))) { - // charset casting: _utf8'str', N'str', n'str' - // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html - return "keyword"; - } else if (/^[\(\),\;\[\]]/.test(ch)) { - // no highlightning - return null; - } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { - // 1-line comment - stream.skipToEnd(); - return "comment"; - } else if ((support.commentHash && ch == "#") - || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { - // 1-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - stream.skipToEnd(); - return "comment"; - } else if (ch == "/" && stream.eat("*")) { - // multi-line comments - // ref: https://kb.askmonty.org/en/comment-syntax/ - state.tokenize = tokenComment; - return state.tokenize(stream, state); - } else if (ch == ".") { - // .1 for 0.1 - if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) { - return "number"; - } - // .table_name (ODBC) - // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) { - return "variable-2"; - } - } else if (operatorChars.test(ch)) { - // operators - stream.eatWhile(operatorChars); - return null; - } else if (ch == '{' && - (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { - // dates (weird ODBC syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - return "number"; - } else { - stream.eatWhile(/^[_\w\d]/); - var word = stream.current().toLowerCase(); - // dates (standard SQL syntax) - // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html - if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) - return "number"; - if (atoms.hasOwnProperty(word)) return "atom"; - if (builtin.hasOwnProperty(word)) return "builtin"; - if (keywords.hasOwnProperty(word)) return "keyword"; - if (client.hasOwnProperty(word)) return "string-2"; - return null; - } - } - - // 'string', with char specified in quote escaped by '\' - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - function tokenComment(stream, state) { - while (true) { - if (stream.skipTo("*")) { - stream.next(); - if (stream.eat("/")) { - state.tokenize = tokenBase; - break; - } - } else { - stream.skipToEnd(); - break; - } - } - return "comment"; - } - - function pushContext(stream, state, type) { - state.context = { - prev: state.context, - indent: stream.indentation(), - col: stream.column(), - type: type - }; - } - - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function() { - return {tokenize: tokenBase, context: null}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) - state.context.align = false; - } - if (stream.eatSpace()) return null; - - var style = state.tokenize(stream, state); - if (style == "comment") return style; - - if (state.context && state.context.align == null) - state.context.align = true; - - var tok = stream.current(); - if (tok == "(") - pushContext(stream, state, ")"); - else if (tok == "[") - pushContext(stream, state, "]"); - else if (state.context && state.context.type == tok) - popContext(state); - return style; - }, - - indent: function(state, textAfter) { - var cx = state.context; - if (!cx) return CodeMirror.Pass; - var closing = textAfter.charAt(0) == cx.type; - if (cx.align) return cx.col + (closing ? 0 : 1); - else return cx.indent + (closing ? 0 : config.indentUnit); - }, - - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null - }; -}); - -(function() { - "use strict"; - - // `identifier` - function hookIdentifier(stream) { - // MySQL/MariaDB identifiers - // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html - var ch; - while ((ch = stream.next()) != null) { - if (ch == "`" && !stream.eat("`")) return "variable-2"; - } - stream.backUp(stream.current().length - 1); - return stream.eatWhile(/\w/) ? "variable-2" : null; - } - - // variable token - function hookVar(stream) { - // variables - // @@prefix.varName @varName - // varName can be quoted with ` or ' or " - // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html - if (stream.eat("@")) { - stream.match(/^session\./); - stream.match(/^local\./); - stream.match(/^global\./); - } - - if (stream.eat("'")) { - stream.match(/^.*'/); - return "variable-2"; - } else if (stream.eat('"')) { - stream.match(/^.*"/); - return "variable-2"; - } else if (stream.eat("`")) { - stream.match(/^.*`/); - return "variable-2"; - } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { - return "variable-2"; - } - return null; - }; - - // short client keyword token - function hookClient(stream) { - // \N means NULL - // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html - if (stream.eat("N")) { - return "atom"; - } - // \g, etc - // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html - return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; - } - - // these keywords are used by all SQL dialects (however, a mode can still overwrite it) - var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where "; - - // turn a space-separated list into an array - function set(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - // A generic SQL Mode. It's not a standard, it just try to support what is generally supported - CodeMirror.defineMIME("text/x-sql", { - name: "sql", - keywords: set(sqlKeywords + "begin"), - builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); - - CodeMirror.defineMIME("text/x-mssql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"), - builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), - hooks: { - "@": hookVar - } - }); - - CodeMirror.defineMIME("text/x-mysql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - CodeMirror.defineMIME("text/x-mariadb", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), - keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), - builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, - dateSQL: set("date time timestamp"), - support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), - hooks: { - "@": hookVar, - "`": hookIdentifier, - "\\": hookClient - } - }); - - // the query language used by Apache Cassandra is called CQL, but this mime type - // is called Cassandra to avoid confusion with Contextual Query Language - CodeMirror.defineMIME("text/x-cassandra", { - name: "sql", - client: { }, - keywords: set("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"), - builtin: set("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"), - atoms: set("false true infinity NaN"), - operatorChars: /^[<>=]/, - dateSQL: { }, - support: set("commentSlashSlash decimallessFloat"), - hooks: { } - }); - - // this is based on Peter Raganitsch's 'plsql' mode - CodeMirror.defineMIME("text/x-plsql", { - name: "sql", - client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), - keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), - builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), - operatorChars: /^[*+\-%<>!=~]/, - dateSQL: set("date time timestamp"), - support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") - }); - - // Created to support specific hive keywords - CodeMirror.defineMIME("text/x-hive", { - name: "sql", - keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"), - builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"), - atoms: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, - dateSQL: set("date timestamp"), - support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") - }); -}()); - -}); - -/* - How Properties of Mime Types are used by SQL Mode - ================================================= - - keywords: - A list of keywords you want to be highlighted. - builtin: - A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). - operatorChars: - All characters that must be handled as operators. - client: - Commands parsed and executed by the client (not the server). - support: - A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. - * ODBCdotTable: .tableName - * zerolessFloat: .1 - * doubleQuote - * nCharCast: N'string' - * charsetCast: _utf8'string' - * commentHash: use # char for comments - * commentSlashSlash: use // for comments - * commentSpaceRequired: require a space after -- for comments - atoms: - Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: - UNKNOWN, INFINITY, UNDERFLOW, NaN... - dateSQL: - Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. -*/ diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/tcl/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/tcl/index.html deleted file mode 100644 index ce4ad34..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/tcl/index.html +++ /dev/null @@ -1,142 +0,0 @@ - - -CodeMirror: Tcl mode - - - - - - - - - - -
                -

                Tcl mode

                -
                - - -

                MIME types defined: text/x-tcl.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/tcl/tcl.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/tcl/tcl.js deleted file mode 100644 index 056accb..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/tcl/tcl.js +++ /dev/null @@ -1,147 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -//tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("tcl", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = parseWords("Tcl safe after append array auto_execok auto_import auto_load " + - "auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror " + - "binary break catch cd close concat continue dde eof encoding error " + - "eval exec exit expr fblocked fconfigure fcopy file fileevent filename " + - "filename flush for foreach format gets glob global history http if " + - "incr info interp join lappend lindex linsert list llength load lrange " + - "lreplace lsearch lset lsort memory msgcat namespace open package parray " + - "pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp " + - "registry regsub rename resource return scan seek set socket source split " + - "string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord " + - "tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest " + - "tclvars tell time trace unknown unset update uplevel upvar variable " + - "vwait"); - var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); - var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - if ((ch == '"' || ch == "'") && state.inParams) - return chain(stream, state, tokenString(ch)); - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - else if (ch == "#" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - return chain(stream, state, tokenUnparsed); - } - else if (ch == "#" && stream.eat("#")) { - stream.skipToEnd(); - return "comment"; - } - else if (ch == '"') { - stream.skipTo(/"/); - return "comment"; - } - else if (ch == "$") { - stream.eatWhile(/[$_a-z0-9A-Z\.{:]/); - stream.eatWhile(/}/); - state.beforeParams = true; - return "builtin"; - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "comment"; - } - else { - stream.eatWhile(/[\w\$_{}\xa1-\uffff]/); - var word = stream.current().toLowerCase(); - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - if (functions && functions.propertyIsEnumerable(word)) { - state.beforeParams = true; - return "keyword"; - } - return null; - } - } - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); -CodeMirror.defineMIME("text/x-tcl", "tcl"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vb/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vb/index.html deleted file mode 100644 index adcc44f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vb/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - -CodeMirror: VB.NET mode - - - - - - - - - - - -
                -

                VB.NET mode

                - - - -
                - -
                -
                
                -  

                MIME type defined: text/x-vb.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vb/vb.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vb/vb.js deleted file mode 100644 index d78f91f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vb/vb.js +++ /dev/null @@ -1,276 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("vb", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try']; - var middleKeywords = ['else','elseif','case', 'catch']; - var endKeywords = ['next','loop']; - - var operatorKeywords = ['and', 'or', 'not', 'xor', 'in']; - var wordOperators = wordRegexp(operatorKeywords); - var commonKeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', - 'goto', 'byval','byref','new','handles','property', 'return', - 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; - var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; - - var keywords = wordRegexp(commonKeywords); - var types = wordRegexp(commontypes); - var stringPrefixes = '"'; - - var opening = wordRegexp(openingKeywords); - var middle = wordRegexp(middleKeywords); - var closing = wordRegexp(endKeywords); - var doubleClosing = wordRegexp(['end']); - var doOpening = wordRegexp(['do']); - - var indentInfo = null; - - CodeMirror.registerHelper("hintWords", "vb", openingKeywords.concat(middleKeywords).concat(endKeywords) - .concat(operatorKeywords).concat(commonKeywords).concat(commontypes)); - - function indent(_stream, state) { - state.currentIndent++; - } - - function dedent(_stream, state) { - state.currentIndent--; - } - // tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === "'") { - stream.skipToEnd(); - return 'comment'; - } - - - // Handle Number Literals - if (stream.match(/^((&H)|(&O))?[0-9\.a-f]/i, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+F?/i)) { floatLiteral = true; } - else if (stream.match(/^\d+\.\d*F?/)) { floatLiteral = true; } - else if (stream.match(/^\.\d+F?/)) { floatLiteral = true; } - - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } - // Octal - else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } - // Decimal - else if (stream.match(/^[1-9]\d*F?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return null; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - if (stream.match(doOpening)) { - indent(stream,state); - state.doInCurrentLine = true; - return 'keyword'; - } - if (stream.match(opening)) { - if (! state.doInCurrentLine) - indent(stream,state); - else - state.doInCurrentLine = false; - return 'keyword'; - } - if (stream.match(middle)) { - return 'keyword'; - } - - if (stream.match(doubleClosing)) { - dedent(stream,state); - dedent(stream,state); - return 'keyword'; - } - if (stream.match(closing)) { - dedent(stream,state); - return 'keyword'; - } - - if (stream.match(types)) { - return 'keyword'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"]/); - if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state ); - } - if (indentInfo === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - - return style; - } - - var external = { - electricChars:"dDpPtTfFeE ", - startState: function() { - return { - tokenize: tokenBase, - lastToken: null, - currentIndent: 0, - nextLineIndent: 0, - doInCurrentLine: false - - - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.currentIndent += state.nextLineIndent; - state.nextLineIndent = 0; - state.doInCurrentLine = 0; - } - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - - - return style; - }, - - indent: function(state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; - if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); - if(state.currentIndent < 0) return 0; - return state.currentIndent * conf.indentUnit; - }, - - lineComment: "'" - }; - return external; -}); - -CodeMirror.defineMIME("text/x-vb", "vb"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vbscript/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vbscript/index.html deleted file mode 100644 index ad7532d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vbscript/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - -CodeMirror: VBScript mode - - - - - - - - - -
                -

                VBScript mode

                - - -
                - - - -

                MIME types defined: text/vbscript.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vbscript/vbscript.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vbscript/vbscript.js deleted file mode 100644 index b66df22..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/vbscript/vbscript.js +++ /dev/null @@ -1,350 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/* -For extra ASP classic objects, initialize CodeMirror instance with this option: - isASP: true - -E.G.: - var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - lineNumbers: true, - isASP: true - }); -*/ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("vbscript", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"); - var doubleOperators = new RegExp("^((<>)|(<=)|(>=))"); - var singleDelimiters = new RegExp('^[\\.,]'); - var brakets = new RegExp('^[\\(\\)]'); - var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*"); - - var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for']; - var middleKeywords = ['else','elseif','case']; - var endKeywords = ['next','loop','wend']; - - var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'is', 'mod', 'eqv', 'imp']); - var commonkeywords = ['dim', 'redim', 'then', 'until', 'randomize', - 'byval','byref','new','property', 'exit', 'in', - 'const','private', 'public', - 'get','set','let', 'stop', 'on error resume next', 'on error goto 0', 'option explicit', 'call', 'me']; - - //This list was from: http://msdn.microsoft.com/en-us/library/f8tbc79x(v=vs.84).aspx - var atomWords = ['true', 'false', 'nothing', 'empty', 'null']; - //This list was from: http://msdn.microsoft.com/en-us/library/3ca8tfek(v=vs.84).aspx - var builtinFuncsWords = ['abs', 'array', 'asc', 'atn', 'cbool', 'cbyte', 'ccur', 'cdate', 'cdbl', 'chr', 'cint', 'clng', 'cos', 'csng', 'cstr', 'date', 'dateadd', 'datediff', 'datepart', - 'dateserial', 'datevalue', 'day', 'escape', 'eval', 'execute', 'exp', 'filter', 'formatcurrency', 'formatdatetime', 'formatnumber', 'formatpercent', 'getlocale', 'getobject', - 'getref', 'hex', 'hour', 'inputbox', 'instr', 'instrrev', 'int', 'fix', 'isarray', 'isdate', 'isempty', 'isnull', 'isnumeric', 'isobject', 'join', 'lbound', 'lcase', 'left', - 'len', 'loadpicture', 'log', 'ltrim', 'rtrim', 'trim', 'maths', 'mid', 'minute', 'month', 'monthname', 'msgbox', 'now', 'oct', 'replace', 'rgb', 'right', 'rnd', 'round', - 'scriptengine', 'scriptenginebuildversion', 'scriptenginemajorversion', 'scriptengineminorversion', 'second', 'setlocale', 'sgn', 'sin', 'space', 'split', 'sqr', 'strcomp', - 'string', 'strreverse', 'tan', 'time', 'timer', 'timeserial', 'timevalue', 'typename', 'ubound', 'ucase', 'unescape', 'vartype', 'weekday', 'weekdayname', 'year']; - - //This list was from: http://msdn.microsoft.com/en-us/library/ydz4cfk3(v=vs.84).aspx - var builtinConsts = ['vbBlack', 'vbRed', 'vbGreen', 'vbYellow', 'vbBlue', 'vbMagenta', 'vbCyan', 'vbWhite', 'vbBinaryCompare', 'vbTextCompare', - 'vbSunday', 'vbMonday', 'vbTuesday', 'vbWednesday', 'vbThursday', 'vbFriday', 'vbSaturday', 'vbUseSystemDayOfWeek', 'vbFirstJan1', 'vbFirstFourDays', 'vbFirstFullWeek', - 'vbGeneralDate', 'vbLongDate', 'vbShortDate', 'vbLongTime', 'vbShortTime', 'vbObjectError', - 'vbOKOnly', 'vbOKCancel', 'vbAbortRetryIgnore', 'vbYesNoCancel', 'vbYesNo', 'vbRetryCancel', 'vbCritical', 'vbQuestion', 'vbExclamation', 'vbInformation', 'vbDefaultButton1', 'vbDefaultButton2', - 'vbDefaultButton3', 'vbDefaultButton4', 'vbApplicationModal', 'vbSystemModal', 'vbOK', 'vbCancel', 'vbAbort', 'vbRetry', 'vbIgnore', 'vbYes', 'vbNo', - 'vbCr', 'VbCrLf', 'vbFormFeed', 'vbLf', 'vbNewLine', 'vbNullChar', 'vbNullString', 'vbTab', 'vbVerticalTab', 'vbUseDefault', 'vbTrue', 'vbFalse', - 'vbEmpty', 'vbNull', 'vbInteger', 'vbLong', 'vbSingle', 'vbDouble', 'vbCurrency', 'vbDate', 'vbString', 'vbObject', 'vbError', 'vbBoolean', 'vbVariant', 'vbDataObject', 'vbDecimal', 'vbByte', 'vbArray']; - //This list was from: http://msdn.microsoft.com/en-us/library/hkc375ea(v=vs.84).aspx - var builtinObjsWords = ['WScript', 'err', 'debug', 'RegExp']; - var knownProperties = ['description', 'firstindex', 'global', 'helpcontext', 'helpfile', 'ignorecase', 'length', 'number', 'pattern', 'source', 'value', 'count']; - var knownMethods = ['clear', 'execute', 'raise', 'replace', 'test', 'write', 'writeline', 'close', 'open', 'state', 'eof', 'update', 'addnew', 'end', 'createobject', 'quit']; - - var aspBuiltinObjsWords = ['server', 'response', 'request', 'session', 'application']; - var aspKnownProperties = ['buffer', 'cachecontrol', 'charset', 'contenttype', 'expires', 'expiresabsolute', 'isclientconnected', 'pics', 'status', //response - 'clientcertificate', 'cookies', 'form', 'querystring', 'servervariables', 'totalbytes', //request - 'contents', 'staticobjects', //application - 'codepage', 'lcid', 'sessionid', 'timeout', //session - 'scripttimeout']; //server - var aspKnownMethods = ['addheader', 'appendtolog', 'binarywrite', 'end', 'flush', 'redirect', //response - 'binaryread', //request - 'remove', 'removeall', 'lock', 'unlock', //application - 'abandon', //session - 'getlasterror', 'htmlencode', 'mappath', 'transfer', 'urlencode']; //server - - var knownWords = knownMethods.concat(knownProperties); - - builtinObjsWords = builtinObjsWords.concat(builtinConsts); - - if (conf.isASP){ - builtinObjsWords = builtinObjsWords.concat(aspBuiltinObjsWords); - knownWords = knownWords.concat(aspKnownMethods, aspKnownProperties); - }; - - var keywords = wordRegexp(commonkeywords); - var atoms = wordRegexp(atomWords); - var builtinFuncs = wordRegexp(builtinFuncsWords); - var builtinObjs = wordRegexp(builtinObjsWords); - var known = wordRegexp(knownWords); - var stringPrefixes = '"'; - - var opening = wordRegexp(openingKeywords); - var middle = wordRegexp(middleKeywords); - var closing = wordRegexp(endKeywords); - var doubleClosing = wordRegexp(['end']); - var doOpening = wordRegexp(['do']); - var noIndentWords = wordRegexp(['on error resume next', 'exit']); - var comment = wordRegexp(['rem']); - - - function indent(_stream, state) { - state.currentIndent++; - } - - function dedent(_stream, state) { - state.currentIndent--; - } - // tokenizers - function tokenBase(stream, state) { - if (stream.eatSpace()) { - return 'space'; - //return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === "'") { - stream.skipToEnd(); - return 'comment'; - } - if (stream.match(comment)){ - stream.skipToEnd(); - return 'comment'; - } - - - // Handle Number Literals - if (stream.match(/^((&H)|(&O))?[0-9\.]/i, false) && !stream.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+/i)) { floatLiteral = true; } - else if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - else if (stream.match(/^\.\d+/)) { floatLiteral = true; } - - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } - // Octal - else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } - // Decimal - else if (stream.match(/^[1-9]\d*F?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - - if (stream.match(brakets)) { - return "bracket"; - } - - if (stream.match(noIndentWords)) { - state.doInCurrentLine = true; - - return 'keyword'; - } - - if (stream.match(doOpening)) { - indent(stream,state); - state.doInCurrentLine = true; - - return 'keyword'; - } - if (stream.match(opening)) { - if (! state.doInCurrentLine) - indent(stream,state); - else - state.doInCurrentLine = false; - - return 'keyword'; - } - if (stream.match(middle)) { - return 'keyword'; - } - - - if (stream.match(doubleClosing)) { - dedent(stream,state); - dedent(stream,state); - - return 'keyword'; - } - if (stream.match(closing)) { - if (! state.doInCurrentLine) - dedent(stream,state); - else - state.doInCurrentLine = false; - - return 'keyword'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(atoms)) { - return 'atom'; - } - - if (stream.match(known)) { - return 'variable-2'; - } - - if (stream.match(builtinFuncs)) { - return 'builtin'; - } - - if (stream.match(builtinObjs)){ - return 'variable-2'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"]/); - if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - - current = stream.current(); - if (style && (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword')){//|| knownWords.indexOf(current.substring(1)) > -1) { - if (style === 'builtin' || style === 'keyword') style='variable'; - if (knownWords.indexOf(current.substr(1)) > -1) style='variable-2'; - - return style; - } else { - return ERRORCLASS; - } - } - - return style; - } - - var external = { - electricChars:"dDpPtTfFeE ", - startState: function() { - return { - tokenize: tokenBase, - lastToken: null, - currentIndent: 0, - nextLineIndent: 0, - doInCurrentLine: false, - ignoreKeyword: false - - - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.currentIndent += state.nextLineIndent; - state.nextLineIndent = 0; - state.doInCurrentLine = 0; - } - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (style==='space') style=null; - - return style; - }, - - indent: function(state, textAfter) { - var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; - if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); - if(state.currentIndent < 0) return 0; - return state.currentIndent * conf.indentUnit; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/vbscript", "vbscript"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/velocity/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/velocity/index.html deleted file mode 100644 index 2747878..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/velocity/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - -CodeMirror: Velocity mode - - - - - - - - - - -
                -

                Velocity mode

                -
                - - -

                MIME types defined: text/velocity.

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/velocity/velocity.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/velocity/velocity.js deleted file mode 100644 index 8fc4f95..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/velocity/velocity.js +++ /dev/null @@ -1,201 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("velocity", function() { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = parseWords("#end #else #break #stop #[[ #]] " + - "#{end} #{else} #{break} #{stop}"); - var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + - "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); - var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"); - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - // start of unparsed string? - if ((ch == "'") && state.inParams) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenString(ch)); - } - // start of parsed string? - else if ((ch == '"')) { - state.lastTokenWasBuiltin = false; - if (state.inString) { - state.inString = false; - return "string"; - } - else if (state.inParams) - return chain(stream, state, tokenString(ch)); - } - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) - state.inParams = true; - else if (ch == ")") { - state.inParams = false; - state.lastTokenWasBuiltin = true; - } - return null; - } - // start of a number value? - else if (/\d/.test(ch)) { - state.lastTokenWasBuiltin = false; - stream.eatWhile(/[\w\.]/); - return "number"; - } - // multi line comment? - else if (ch == "#" && stream.eat("*")) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenComment); - } - // unparsed content? - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - state.lastTokenWasBuiltin = false; - return chain(stream, state, tokenUnparsed); - } - // single line comment? - else if (ch == "#" && stream.eat("#")) { - state.lastTokenWasBuiltin = false; - stream.skipToEnd(); - return "comment"; - } - // variable? - else if (ch == "$") { - stream.eatWhile(/[\w\d\$_\.{}]/); - // is it one of the specials? - if (specials && specials.propertyIsEnumerable(stream.current())) { - return "keyword"; - } - else { - state.lastTokenWasBuiltin = true; - state.beforeParams = true; - return "builtin"; - } - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - state.lastTokenWasBuiltin = false; - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - // get the whole word - stream.eatWhile(/[\w\$_{}@]/); - var word = stream.current(); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(word) || - (stream.current().match(/^#@?[a-z0-9_]+ *$/i) && stream.peek()=="(") && - !(functions && functions.propertyIsEnumerable(word.toLowerCase()))) { - state.beforeParams = true; - state.lastTokenWasBuiltin = false; - return "keyword"; - } - if (state.inString) { - state.lastTokenWasBuiltin = false; - return "string"; - } - if (stream.pos > word.length && stream.string.charAt(stream.pos-word.length-1)=="." && state.lastTokenWasBuiltin) - return "builtin"; - // default: just a "word" - state.lastTokenWasBuiltin = false; - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if ((next == quote) && !escaped) { - end = true; - break; - } - if (quote=='"' && stream.peek() == '$' && !escaped) { - state.inString = true; - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - // Interface - - return { - startState: function() { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false, - inString: false, - lastTokenWasBuiltin: false - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - }, - blockCommentStart: "#*", - blockCommentEnd: "*#", - lineComment: "##", - fold: "velocity" - }; -}); - -CodeMirror.defineMIME("text/velocity", "velocity"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/index.html deleted file mode 100644 index 7149f06..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - -CodeMirror: XML mode - - - - - - - - - -
                -

                XML mode

                -
                - -

                The XML mode supports two configuration parameters:

                -
                -
                htmlMode (boolean)
                -
                This switches the mode to parse HTML instead of XML. This - means attributes do not have to be quoted, and some elements - (such as br) do not require a closing tag.
                -
                alignCDATA (boolean)
                -
                Setting this to true will force the opening tag of CDATA - blocks to not be indented.
                -
                - -

                MIME types defined: application/xml, text/html.

                -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/test.js deleted file mode 100644 index f48156b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/test.js +++ /dev/null @@ -1,51 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function() { - var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } - - MT("matching", - "[tag&bracket <][tag top][tag&bracket >]", - " text", - " [tag&bracket <][tag inner][tag&bracket />]", - "[tag&bracket ]"); - - MT("nonmatching", - "[tag&bracket <][tag top][tag&bracket >]", - " [tag&bracket <][tag inner][tag&bracket />]", - " [tag&bracket ]"); - - MT("doctype", - "[meta ]", - "[tag&bracket <][tag top][tag&bracket />]"); - - MT("cdata", - "[tag&bracket <][tag top][tag&bracket >]", - " [atom ]", - "[tag&bracket ]"); - - // HTML tests - mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); - - MT("selfclose", - "[tag&bracket <][tag html][tag&bracket >]", - " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", - "[tag&bracket ]"); - - MT("list", - "[tag&bracket <][tag ol][tag&bracket >]", - " [tag&bracket <][tag li][tag&bracket >]one", - " [tag&bracket <][tag li][tag&bracket >]two", - "[tag&bracket ]"); - - MT("valueless", - "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); - - MT("pThenArticle", - "[tag&bracket <][tag p][tag&bracket >]", - " foo", - "[tag&bracket <][tag article][tag&bracket >]bar"); - -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/xml.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/xml.js deleted file mode 100644 index 5ad2172..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xml/xml.js +++ /dev/null @@ -1,385 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("xml", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1; - var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag; - if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true; - - var Kludges = parserConfig.htmlMode ? { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true, 'menuitem': true}, - implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, - 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, - 'th': true, 'tr': true}, - contextGrabbers: { - 'dd': {'dd': true, 'dt': true}, - 'dt': {'dd': true, 'dt': true}, - 'li': {'li': true}, - 'option': {'option': true, 'optgroup': true}, - 'optgroup': {'optgroup': true}, - 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, - 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, - 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, - 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, - 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, - 'rp': {'rp': true, 'rt': true}, - 'rt': {'rp': true, 'rt': true}, - 'tbody': {'tbody': true, 'tfoot': true}, - 'td': {'td': true, 'th': true}, - 'tfoot': {'tbody': true}, - 'th': {'td': true, 'th': true}, - 'thead': {'tbody': true, 'tfoot': true}, - 'tr': {'tr': true} - }, - doNotIndent: {"pre": true}, - allowUnquoted: true, - allowMissing: true, - caseFold: true - } : { - autoSelfClosers: {}, - implicitlyClosed: {}, - contextGrabbers: {}, - doNotIndent: {}, - allowUnquoted: false, - allowMissing: false, - caseFold: false - }; - var alignCDATA = parserConfig.alignCDATA; - - // Return variables for tokenizers - var type, setStyle; - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var ch = stream.next(); - if (ch == "<") { - if (stream.eat("!")) { - if (stream.eat("[")) { - if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); - else return null; - } else if (stream.match("--")) { - return chain(inBlock("comment", "-->")); - } else if (stream.match("DOCTYPE", true, true)) { - stream.eatWhile(/[\w\._\-]/); - return chain(doctype(1)); - } else { - return null; - } - } else if (stream.eat("?")) { - stream.eatWhile(/[\w\._\-]/); - state.tokenize = inBlock("meta", "?>"); - return "meta"; - } else { - type = stream.eat("/") ? "closeTag" : "openTag"; - state.tokenize = inTag; - return "tag bracket"; - } - } else if (ch == "&") { - var ok; - if (stream.eat("#")) { - if (stream.eat("x")) { - ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); - } else { - ok = stream.eatWhile(/[\d]/) && stream.eat(";"); - } - } else { - ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); - } - return ok ? "atom" : "error"; - } else { - stream.eatWhile(/[^&<]/); - return null; - } - } - inText.isInText = true; - - function inTag(stream, state) { - var ch = stream.next(); - if (ch == ">" || (ch == "/" && stream.eat(">"))) { - state.tokenize = inText; - type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag bracket"; - } else if (ch == "=") { - type = "equals"; - return null; - } else if (ch == "<") { - state.tokenize = inText; - state.state = baseState; - state.tagName = state.tagStart = null; - var next = state.tokenize(stream, state); - return next ? next + " tag error" : "tag error"; - } else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - state.stringStartCol = stream.column(); - return state.tokenize(stream, state); - } else { - stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); - return "word"; - } - } - - function inAttribute(quote) { - var closure = function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inTag; - break; - } - } - return "string"; - }; - closure.isInAttribute = true; - return closure; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - return style; - }; - } - function doctype(depth) { - return function(stream, state) { - var ch; - while ((ch = stream.next()) != null) { - if (ch == "<") { - state.tokenize = doctype(depth + 1); - return state.tokenize(stream, state); - } else if (ch == ">") { - if (depth == 1) { - state.tokenize = inText; - break; - } else { - state.tokenize = doctype(depth - 1); - return state.tokenize(stream, state); - } - } - } - return "meta"; - }; - } - - function Context(state, tagName, startOfLine) { - this.prev = state.context; - this.tagName = tagName; - this.indent = state.indented; - this.startOfLine = startOfLine; - if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) - this.noIndent = true; - } - function popContext(state) { - if (state.context) state.context = state.context.prev; - } - function maybePopContext(state, nextTagName) { - var parentTagName; - while (true) { - if (!state.context) { - return; - } - parentTagName = state.context.tagName; - if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || - !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { - return; - } - popContext(state); - } - } - - function baseState(type, stream, state) { - if (type == "openTag") { - state.tagStart = stream.column(); - return tagNameState; - } else if (type == "closeTag") { - return closeTagNameState; - } else { - return baseState; - } - } - function tagNameState(type, stream, state) { - if (type == "word") { - state.tagName = stream.current(); - setStyle = "tag"; - return attrState; - } else { - setStyle = "error"; - return tagNameState; - } - } - function closeTagNameState(type, stream, state) { - if (type == "word") { - var tagName = stream.current(); - if (state.context && state.context.tagName != tagName && - Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName)) - popContext(state); - if (state.context && state.context.tagName == tagName) { - setStyle = "tag"; - return closeState; - } else { - setStyle = "tag error"; - return closeStateErr; - } - } else { - setStyle = "error"; - return closeStateErr; - } - } - - function closeState(type, _stream, state) { - if (type != "endTag") { - setStyle = "error"; - return closeState; - } - popContext(state); - return baseState; - } - function closeStateErr(type, stream, state) { - setStyle = "error"; - return closeState(type, stream, state); - } - - function attrState(type, _stream, state) { - if (type == "word") { - setStyle = "attribute"; - return attrEqState; - } else if (type == "endTag" || type == "selfcloseTag") { - var tagName = state.tagName, tagStart = state.tagStart; - state.tagName = state.tagStart = null; - if (type == "selfcloseTag" || - Kludges.autoSelfClosers.hasOwnProperty(tagName)) { - maybePopContext(state, tagName); - } else { - maybePopContext(state, tagName); - state.context = new Context(state, tagName, tagStart == state.indented); - } - return baseState; - } - setStyle = "error"; - return attrState; - } - function attrEqState(type, stream, state) { - if (type == "equals") return attrValueState; - if (!Kludges.allowMissing) setStyle = "error"; - return attrState(type, stream, state); - } - function attrValueState(type, stream, state) { - if (type == "string") return attrContinuedState; - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;} - setStyle = "error"; - return attrState(type, stream, state); - } - function attrContinuedState(type, stream, state) { - if (type == "string") return attrContinuedState; - return attrState(type, stream, state); - } - - return { - startState: function() { - return {tokenize: inText, - state: baseState, - indented: 0, - tagName: null, tagStart: null, - context: null}; - }, - - token: function(stream, state) { - if (!state.tagName && stream.sol()) - state.indented = stream.indentation(); - - if (stream.eatSpace()) return null; - type = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - setStyle = null; - state.state = state.state(type || style, stream, state); - if (setStyle) - style = setStyle == "error" ? style + " error" : setStyle; - } - return style; - }, - - indent: function(state, textAfter, fullLine) { - var context = state.context; - // Indent multi-line strings (e.g. css). - if (state.tokenize.isInAttribute) { - if (state.tagStart == state.indented) - return state.stringStartCol + 1; - else - return state.indented + indentUnit; - } - if (context && context.noIndent) return CodeMirror.Pass; - if (state.tokenize != inTag && state.tokenize != inText) - return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; - // Indent the starts of attribute names. - if (state.tagName) { - if (multilineTagIndentPastTag) - return state.tagStart + state.tagName.length + 2; - else - return state.tagStart + indentUnit * multilineTagIndentFactor; - } - if (alignCDATA && /$/, - blockCommentStart: "", - - configuration: parserConfig.htmlMode ? "html" : "xml", - helperType: parserConfig.htmlMode ? "html" : "xml" - }; -}); - -CodeMirror.defineMIME("text/xml", "xml"); -CodeMirror.defineMIME("application/xml", "xml"); -if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) - CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/index.html deleted file mode 100644 index 7ac5aae..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - -CodeMirror: XQuery mode - - - - - - - - - - -
                -

                XQuery mode

                - - -
                - -
                - - - -

                MIME types defined: application/xquery.

                - -

                Development of the CodeMirror XQuery mode was sponsored by - MarkLogic and developed by - Mike Brevoort. -

                - -
                diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/test.js deleted file mode 100644 index 1f148cd..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/test.js +++ /dev/null @@ -1,67 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Don't take these too seriously -- the expected results appear to be -// based on the results of actual runs without any serious manual -// verification. If a change you made causes them to fail, the test is -// as likely to wrong as the code. - -(function() { - var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); - function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } - - MT("eviltest", - "[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]", - " [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]", - " [keyword let] [variable $joe][keyword :=][atom 1]", - " [keyword return] [keyword element] [variable element] {", - " [keyword attribute] [variable attribute] { [atom 1] },", - " [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },", - " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", - " [keyword //][variable x] } [comment (: a more 'evil' test :)]", - " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]", - " [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]", - " [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]", - " [keyword return] [keyword element] [variable element] {", - " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", - " [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },", - " [keyword element] [variable text] { [keyword text] { [variable "text"] } },", - " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", - " [keyword //][variable fn:doc]", - " }"); - - MT("testEmptySequenceKeyword", - "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); - - MT("testMultiAttr", - "[tag

                ][variable hello] [variable world][tag

                ]"); - - MT("test namespaced variable", - "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); - - MT("test EQName variable", - "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", - "[tag ]{[variable $\"http://www.example.com/ns/my\":var]}[tag ]"); - - MT("test EQName function", - "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", - " [variable $a] [keyword +] [atom 2]", - "}[variable ;]", - "[tag ]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag ]"); - - MT("test EQName function with single quotes", - "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", - " [variable $a] [keyword +] [atom 2]", - "}[variable ;]", - "[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"); - - MT("testProcessingInstructions", - "[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"); - - MT("testQuoteEscapeDouble", - "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", - "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); -})(); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/xquery.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/xquery.js deleted file mode 100644 index c642ee5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/mode/xquery/xquery.js +++ /dev/null @@ -1,437 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("xquery", function() { - - // The keywords object is set to the result of this self executing - // function. Each keyword is a property of the keywords object whose - // value is {type: atype, style: astyle} - var keywords = function(){ - // conveinence functions used to build keywords object - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a") - , B = kw("keyword b") - , C = kw("keyword c") - , operator = kw("operator") - , atom = {type: "atom", style: "atom"} - , punctuation = {type: "punctuation", style: null} - , qualifier = {type: "axis_specifier", style: "qualifier"}; - - // kwObj is what is return from this function at the end - var kwObj = { - 'if': A, 'switch': A, 'while': A, 'for': A, - 'else': B, 'then': B, 'try': B, 'finally': B, 'catch': B, - 'element': C, 'attribute': C, 'let': C, 'implements': C, 'import': C, 'module': C, 'namespace': C, - 'return': C, 'super': C, 'this': C, 'throws': C, 'where': C, 'private': C, - ',': punctuation, - 'null': atom, 'fn:false()': atom, 'fn:true()': atom - }; - - // a list of 'basic' keywords. For each add a property to kwObj with the value of - // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"} - var basic = ['after','ancestor','ancestor-or-self','and','as','ascending','assert','attribute','before', - 'by','case','cast','child','comment','declare','default','define','descendant','descendant-or-self', - 'descending','document','document-node','element','else','eq','every','except','external','following', - 'following-sibling','follows','for','function','if','import','in','instance','intersect','item', - 'let','module','namespace','node','node','of','only','or','order','parent','precedes','preceding', - 'preceding-sibling','processing-instruction','ref','return','returns','satisfies','schema','schema-element', - 'self','some','sortby','stable','text','then','to','treat','typeswitch','union','variable','version','where', - 'xquery', 'empty-sequence']; - for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i]);}; - - // a list of types. For each add a property to kwObj with the value of - // {type: "atom", style: "atom"} - var types = ['xs:string', 'xs:float', 'xs:decimal', 'xs:double', 'xs:integer', 'xs:boolean', 'xs:date', 'xs:dateTime', - 'xs:time', 'xs:duration', 'xs:dayTimeDuration', 'xs:time', 'xs:yearMonthDuration', 'numeric', 'xs:hexBinary', - 'xs:base64Binary', 'xs:anyURI', 'xs:QName', 'xs:byte','xs:boolean','xs:anyURI','xf:yearMonthDuration']; - for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;}; - - // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"} - var operators = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', ':=', '=', '>', '>=', '<', '<=', '.', '|', '?', 'and', 'or', 'div', 'idiv', 'mod', '*', '/', '+', '-']; - for(var i=0, l=operators.length; i < l; i++) { kwObj[operators[i]] = operator;}; - - // each axis_specifiers will add a property to kwObj with value of {type: "axis_specifier", style: "qualifier"} - var axis_specifiers = ["self::", "attribute::", "child::", "descendant::", "descendant-or-self::", "parent::", - "ancestor::", "ancestor-or-self::", "following::", "preceding::", "following-sibling::", "preceding-sibling::"]; - for(var i=0, l=axis_specifiers.length; i < l; i++) { kwObj[axis_specifiers[i]] = qualifier; }; - - return kwObj; - }(); - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // the primary mode tokenizer - function tokenBase(stream, state) { - var ch = stream.next(), - mightBeFunction = false, - isEQName = isEQNameAhead(stream); - - // an XML tag (if not in some sub, chained tokenizer) - if (ch == "<") { - if(stream.match("!--", true)) - return chain(stream, state, tokenXMLComment); - - if(stream.match("![CDATA", false)) { - state.tokenize = tokenCDATA; - return "tag"; - } - - if(stream.match("?", false)) { - return chain(stream, state, tokenPreProcessing); - } - - var isclose = stream.eat("/"); - stream.eatSpace(); - var tagName = "", c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - - return chain(stream, state, tokenTag(tagName, isclose)); - } - // start code block - else if(ch == "{") { - pushStateStack(state,{ type: "codeblock"}); - return null; - } - // end code block - else if(ch == "}") { - popStateStack(state); - return null; - } - // if we're in an XML block - else if(isInXmlBlock(state)) { - if(ch == ">") - return "tag"; - else if(ch == "/" && stream.eat(">")) { - popStateStack(state); - return "tag"; - } - else - return "variable"; - } - // if a number - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); - return "atom"; - } - // comment start - else if (ch === "(" && stream.eat(":")) { - pushStateStack(state, { type: "comment"}); - return chain(stream, state, tokenComment); - } - // quoted string - else if ( !isEQName && (ch === '"' || ch === "'")) - return chain(stream, state, tokenString(ch)); - // variable - else if(ch === "$") { - return chain(stream, state, tokenVariable); - } - // assignment - else if(ch ===":" && stream.eat("=")) { - return "keyword"; - } - // open paren - else if(ch === "(") { - pushStateStack(state, { type: "paren"}); - return null; - } - // close paren - else if(ch === ")") { - popStateStack(state); - return null; - } - // open paren - else if(ch === "[") { - pushStateStack(state, { type: "bracket"}); - return null; - } - // close paren - else if(ch === "]") { - popStateStack(state); - return null; - } - else { - var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; - - // if there's a EQName ahead, consume the rest of the string portion, it's likely a function - if(isEQName && ch === '\"') while(stream.next() !== '"'){} - if(isEQName && ch === '\'') while(stream.next() !== '\''){} - - // gobble up a word if the character is not known - if(!known) stream.eatWhile(/[\w\$_-]/); - - // gobble a colon in the case that is a lib func type call fn:doc - var foundColon = stream.eat(":"); - - // if there's not a second colon, gobble another word. Otherwise, it's probably an axis specifier - // which should get matched as a keyword - if(!stream.eat(":") && foundColon) { - stream.eatWhile(/[\w\$_-]/); - } - // if the next non whitespace character is an open paren, this is probably a function (if not a keyword of other sort) - if(stream.match(/^[ \t]*\(/, false)) { - mightBeFunction = true; - } - // is the word a keyword? - var word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - // if we think it's a function call but not yet known, - // set style to variable for now for lack of something better - if(mightBeFunction && !known) known = {type: "function_call", style: "variable def"}; - - // if the previous word was element, attribute, axis specifier, this word should be the name of that - if(isInXmlConstructor(state)) { - popStateStack(state); - return "variable"; - } - // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and - // push the stack so we know to look for it on the next word - if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); - - // if the word is known, return the details of that else just call this a generic 'word' - return known ? known.style : "variable"; - } - } - - // handle comments, including nested - function tokenComment(stream, state) { - var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - if(nestedCount > 0) - nestedCount--; - else { - popStateStack(state); - break; - } - } - else if(ch == ":" && maybeNested) { - nestedCount++; - } - maybeEnd = (ch == ":"); - maybeNested = (ch == "("); - } - - return "comment"; - } - - // tokenizer for string literals - // optionally pass a tokenizer function to set state.tokenize back to when finished - function tokenString(quote, f) { - return function(stream, state) { - var ch; - - if(isInString(state) && stream.current() == quote) { - popStateStack(state); - if(f) state.tokenize = f; - return "string"; - } - - pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); - - // if we're in a string and in an XML block, allow an embedded code block - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return "string"; - } - - - while (ch = stream.next()) { - if (ch == quote) { - popStateStack(state); - if(f) state.tokenize = f; - break; - } - else { - // if we're in a string and in an XML block, allow an embedded code block in an attribute - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; - return "string"; - } - - } - } - - return "string"; - }; - } - - // tokenizer for variables - function tokenVariable(stream, state) { - var isVariableChar = /[\w\$_-]/; - - // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote - if(stream.eat("\"")) { - while(stream.next() !== '\"'){}; - stream.eat(":"); - } else { - stream.eatWhile(isVariableChar); - if(!stream.match(":=", false)) stream.eat(":"); - } - stream.eatWhile(isVariableChar); - state.tokenize = tokenBase; - return "variable"; - } - - // tokenizer for XML tags - function tokenTag(name, isclose) { - return function(stream, state) { - stream.eatSpace(); - if(isclose && stream.eat(">")) { - popStateStack(state); - state.tokenize = tokenBase; - return "tag"; - } - // self closing tag without attributes? - if(!stream.eat("/")) - pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); - if(!stream.eat(">")) { - state.tokenize = tokenAttribute; - return "tag"; - } - else { - state.tokenize = tokenBase; - } - return "tag"; - }; - } - - // tokenizer for XML attributes - function tokenAttribute(stream, state) { - var ch = stream.next(); - - if(ch == "/" && stream.eat(">")) { - if(isInXmlAttributeBlock(state)) popStateStack(state); - if(isInXmlBlock(state)) popStateStack(state); - return "tag"; - } - if(ch == ">") { - if(isInXmlAttributeBlock(state)) popStateStack(state); - return "tag"; - } - if(ch == "=") - return null; - // quoted string - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch, tokenAttribute)); - - if(!isInXmlAttributeBlock(state)) - pushStateStack(state, { type: "attribute", tokenize: tokenAttribute}); - - stream.eat(/[a-zA-Z_:]/); - stream.eatWhile(/[-a-zA-Z0-9_:.]/); - stream.eatSpace(); - - // the case where the attribute has not value and the tag was closed - if(stream.match(">", false) || stream.match("/", false)) { - popStateStack(state); - state.tokenize = tokenBase; - } - - return "attribute"; - } - - // handle comments, including nested - function tokenXMLComment(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "-" && stream.match("->", true)) { - state.tokenize = tokenBase; - return "comment"; - } - } - } - - - // handle CDATA - function tokenCDATA(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "]" && stream.match("]", true)) { - state.tokenize = tokenBase; - return "comment"; - } - } - } - - // handle preprocessing instructions - function tokenPreProcessing(stream, state) { - var ch; - while (ch = stream.next()) { - if (ch == "?" && stream.match(">", true)) { - state.tokenize = tokenBase; - return "comment meta"; - } - } - } - - - // functions to test the current context of the state - function isInXmlBlock(state) { return isIn(state, "tag"); } - function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); } - function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"); } - function isInString(state) { return isIn(state, "string"); } - - function isEQNameAhead(stream) { - // assume we've already eaten a quote (") - if(stream.current() === '"') - return stream.match(/^[^\"]+\"\:/, false); - else if(stream.current() === '\'') - return stream.match(/^[^\"]+\'\:/, false); - else - return false; - } - - function isIn(state, type) { - return (state.stack.length && state.stack[state.stack.length - 1].type == type); - } - - function pushStateStack(state, newState) { - state.stack.push(newState); - } - - function popStateStack(state) { - state.stack.pop(); - var reinstateTokenize = state.stack.length && state.stack[state.stack.length-1].tokenize; - state.tokenize = reinstateTokenize || tokenBase; - } - - // the interface for the mode API - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - stack: [] - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - }, - - blockCommentStart: "(:", - blockCommentEnd: ":)" - - }; - -}); - -CodeMirror.defineMIME("application/xquery", "xquery"); - -}); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/package.json b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/package.json deleted file mode 100644 index 5c02fc1..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "codemirror", - "version":"5.5.0", - "main": "lib/codemirror.js", - "description": "In-browser code editing made bearable", - "license": "MIT", - "directories": {"lib": "./lib"}, - "scripts": {"test": "node ./test/run.js"}, - "devDependencies": {"node-static": "0.6.0", - "phantomjs": "1.9.2-5", - "blint": ">=0.1.1"}, - "bugs": "http://github.com/codemirror/CodeMirror/issues", - "keywords": ["JavaScript", "CodeMirror", "Editor"], - "homepage": "http://codemirror.net", - "maintainers":[{"name": "Marijn Haverbeke", - "email": "marijnh@gmail.com", - "web": "http://marijnhaverbeke.nl"}], - "repository": {"type": "git", - "url": "https://github.com/codemirror/CodeMirror.git"} -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/3024-day.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/3024-day.css deleted file mode 100644 index 1eb109e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/3024-day.css +++ /dev/null @@ -1,41 +0,0 @@ -/* - - Name: 3024 day - Author: Jan T. Sott (http://github.com/idleberg) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;} -.cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;} - -.cm-s-3024-day .CodeMirror-line::selection, .cm-s-3024-day .CodeMirror-line > span::selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d6d5d4; } -.cm-s-3024-day .CodeMirror-line::-moz-selection, .cm-s-3024-day .CodeMirror-line > span::-moz-selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d9d9d9; } - -.cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;} -.cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } -.cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; } -.cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;} - -.cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;} - -.cm-s-3024-day span.cm-comment {color: #cdab53;} -.cm-s-3024-day span.cm-atom {color: #a16a94;} -.cm-s-3024-day span.cm-number {color: #a16a94;} - -.cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;} -.cm-s-3024-day span.cm-keyword {color: #db2d20;} -.cm-s-3024-day span.cm-string {color: #fded02;} - -.cm-s-3024-day span.cm-variable {color: #01a252;} -.cm-s-3024-day span.cm-variable-2 {color: #01a0e4;} -.cm-s-3024-day span.cm-def {color: #e8bbd0;} -.cm-s-3024-day span.cm-bracket {color: #3a3432;} -.cm-s-3024-day span.cm-tag {color: #db2d20;} -.cm-s-3024-day span.cm-link {color: #a16a94;} -.cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;} - -.cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/3024-night.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/3024-night.css deleted file mode 100644 index 36bb8b4..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/3024-night.css +++ /dev/null @@ -1,39 +0,0 @@ -/* - - Name: 3024 night - Author: Jan T. Sott (http://github.com/idleberg) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;} -.cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;} -.cm-s-3024-night .CodeMirror-line::selection, .cm-s-3024-night .CodeMirror-line > span::selection, .cm-s-3024-night .CodeMirror-line > span > span::selection { background: rgba(58, 52, 50, .99); } -.cm-s-3024-night .CodeMirror-line::-moz-selection, .cm-s-3024-night .CodeMirror-line > span::-moz-selection, .cm-s-3024-night .CodeMirror-line > span > span::-moz-selection { background: rgba(58, 52, 50, .99); } -.cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;} -.cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } -.cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } -.cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;} - -.cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;} - -.cm-s-3024-night span.cm-comment {color: #cdab53;} -.cm-s-3024-night span.cm-atom {color: #a16a94;} -.cm-s-3024-night span.cm-number {color: #a16a94;} - -.cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;} -.cm-s-3024-night span.cm-keyword {color: #db2d20;} -.cm-s-3024-night span.cm-string {color: #fded02;} - -.cm-s-3024-night span.cm-variable {color: #01a252;} -.cm-s-3024-night span.cm-variable-2 {color: #01a0e4;} -.cm-s-3024-night span.cm-def {color: #e8bbd0;} -.cm-s-3024-night span.cm-bracket {color: #d6d5d4;} -.cm-s-3024-night span.cm-tag {color: #db2d20;} -.cm-s-3024-night span.cm-link {color: #a16a94;} -.cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;} - -.cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;} -.cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ambiance-mobile.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ambiance-mobile.css deleted file mode 100644 index 88d332e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ambiance-mobile.css +++ /dev/null @@ -1,5 +0,0 @@ -.cm-s-ambiance.CodeMirror { - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ambiance.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ambiance.css deleted file mode 100644 index 0e68f75..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ambiance.css +++ /dev/null @@ -1,76 +0,0 @@ -/* ambiance theme for codemirror */ - -/* Color scheme */ - -.cm-s-ambiance .cm-header {color: blue;} -.cm-s-ambiance .cm-quote { color: #24C2C7; } - -.cm-s-ambiance .cm-keyword { color: #cda869; } -.cm-s-ambiance .cm-atom { color: #CF7EA9; } -.cm-s-ambiance .cm-number { color: #78CF8A; } -.cm-s-ambiance .cm-def { color: #aac6e3; } -.cm-s-ambiance .cm-variable { color: #ffb795; } -.cm-s-ambiance .cm-variable-2 { color: #eed1b3; } -.cm-s-ambiance .cm-variable-3 { color: #faded3; } -.cm-s-ambiance .cm-property { color: #eed1b3; } -.cm-s-ambiance .cm-operator {color: #fa8d6a;} -.cm-s-ambiance .cm-comment { color: #555; font-style:italic; } -.cm-s-ambiance .cm-string { color: #8f9d6a; } -.cm-s-ambiance .cm-string-2 { color: #9d937c; } -.cm-s-ambiance .cm-meta { color: #D2A8A1; } -.cm-s-ambiance .cm-qualifier { color: yellow; } -.cm-s-ambiance .cm-builtin { color: #9999cc; } -.cm-s-ambiance .cm-bracket { color: #24C2C7; } -.cm-s-ambiance .cm-tag { color: #fee4ff } -.cm-s-ambiance .cm-attribute { color: #9B859D; } -.cm-s-ambiance .cm-hr { color: pink; } -.cm-s-ambiance .cm-link { color: #F4C20B; } -.cm-s-ambiance .cm-special { color: #FF9D00; } -.cm-s-ambiance .cm-error { color: #AF2018; } - -.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; } -.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; } - -.cm-s-ambiance .CodeMirror-selected { background: rgba(255, 255, 255, 0.15); } -.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } -.cm-s-ambiance .CodeMirror-line::selection, .cm-s-ambiance .CodeMirror-line > span::selection, .cm-s-ambiance .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } -.cm-s-ambiance .CodeMirror-line::-moz-selection, .cm-s-ambiance .CodeMirror-line > span::-moz-selection, .cm-s-ambiance .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } - -/* Editor styling */ - -.cm-s-ambiance.CodeMirror { - line-height: 1.40em; - color: #E6E1DC; - background-color: #202020; - -webkit-box-shadow: inset 0 0 10px black; - -moz-box-shadow: inset 0 0 10px black; - box-shadow: inset 0 0 10px black; -} - -.cm-s-ambiance .CodeMirror-gutters { - background: #3D3D3D; - border-right: 1px solid #4D4D4D; - box-shadow: 0 10px 20px black; -} - -.cm-s-ambiance .CodeMirror-linenumber { - text-shadow: 0px 1px 1px #4d4d4d; - color: #111; - padding: 0 5px; -} - -.cm-s-ambiance .CodeMirror-guttermarker { color: #aaa; } -.cm-s-ambiance .CodeMirror-guttermarker-subtle { color: #111; } - -.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor { - border-left: 1px solid #7991E8; -} - -.cm-s-ambiance .CodeMirror-activeline-background { - background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031); -} - -.cm-s-ambiance.CodeMirror, -.cm-s-ambiance .CodeMirror-gutters { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/base16-dark.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/base16-dark.css deleted file mode 100644 index fb79fae..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/base16-dark.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Base16 Default Dark - Author: Chris Kempson (http://chriskempson.com) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;} -.cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;} -.cm-s-base16-dark .CodeMirror-line::selection, .cm-s-base16-dark .CodeMirror-line > span::selection, .cm-s-base16-dark .CodeMirror-line > span > span::selection { background: rgba(48, 48, 48, .99); } -.cm-s-base16-dark .CodeMirror-line::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span::-moz-selection, .cm-s-base16-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(48, 48, 48, .99); } -.cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;} -.cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; } -.cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; } -.cm-s-base16-dark .CodeMirror-linenumber {color: #505050;} -.cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;} - -.cm-s-base16-dark span.cm-comment {color: #8f5536;} -.cm-s-base16-dark span.cm-atom {color: #aa759f;} -.cm-s-base16-dark span.cm-number {color: #aa759f;} - -.cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;} -.cm-s-base16-dark span.cm-keyword {color: #ac4142;} -.cm-s-base16-dark span.cm-string {color: #f4bf75;} - -.cm-s-base16-dark span.cm-variable {color: #90a959;} -.cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;} -.cm-s-base16-dark span.cm-def {color: #d28445;} -.cm-s-base16-dark span.cm-bracket {color: #e0e0e0;} -.cm-s-base16-dark span.cm-tag {color: #ac4142;} -.cm-s-base16-dark span.cm-link {color: #aa759f;} -.cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;} - -.cm-s-base16-dark .CodeMirror-activeline-background {background: #202020 !important;} -.cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/base16-light.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/base16-light.css deleted file mode 100644 index 46508e0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/base16-light.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Base16 Default Light - Author: Chris Kempson (http://chriskempson.com) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;} -.cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;} -.cm-s-base16-light .CodeMirror-line::selection, .cm-s-base16-light .CodeMirror-line > span::selection, .cm-s-base16-light .CodeMirror-line > span > span::selection { background: #e0e0e0; } -.cm-s-base16-light .CodeMirror-line::-moz-selection, .cm-s-base16-light .CodeMirror-line > span::-moz-selection, .cm-s-base16-light .CodeMirror-line > span > span::-moz-selection { background: #e0e0e0; } -.cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;} -.cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; } -.cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; } -.cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;} -.cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;} - -.cm-s-base16-light span.cm-comment {color: #8f5536;} -.cm-s-base16-light span.cm-atom {color: #aa759f;} -.cm-s-base16-light span.cm-number {color: #aa759f;} - -.cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;} -.cm-s-base16-light span.cm-keyword {color: #ac4142;} -.cm-s-base16-light span.cm-string {color: #f4bf75;} - -.cm-s-base16-light span.cm-variable {color: #90a959;} -.cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;} -.cm-s-base16-light span.cm-def {color: #d28445;} -.cm-s-base16-light span.cm-bracket {color: #202020;} -.cm-s-base16-light span.cm-tag {color: #ac4142;} -.cm-s-base16-light span.cm-link {color: #aa759f;} -.cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;} - -.cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;} -.cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/blackboard.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/blackboard.css deleted file mode 100644 index 6de11dd..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/blackboard.css +++ /dev/null @@ -1,32 +0,0 @@ -/* Port of TextMate's Blackboard theme */ - -.cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } -.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } -.cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); } -.cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); } -.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } -.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } -.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } -.cm-s-blackboard .CodeMirror-linenumber { color: #888; } -.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } - -.cm-s-blackboard .cm-keyword { color: #FBDE2D; } -.cm-s-blackboard .cm-atom { color: #D8FA3C; } -.cm-s-blackboard .cm-number { color: #D8FA3C; } -.cm-s-blackboard .cm-def { color: #8DA6CE; } -.cm-s-blackboard .cm-variable { color: #FF6400; } -.cm-s-blackboard .cm-operator { color: #FBDE2D;} -.cm-s-blackboard .cm-comment { color: #AEAEAE; } -.cm-s-blackboard .cm-string { color: #61CE3C; } -.cm-s-blackboard .cm-string-2 { color: #61CE3C; } -.cm-s-blackboard .cm-meta { color: #D8FA3C; } -.cm-s-blackboard .cm-builtin { color: #8DA6CE; } -.cm-s-blackboard .cm-tag { color: #8DA6CE; } -.cm-s-blackboard .cm-attribute { color: #8DA6CE; } -.cm-s-blackboard .cm-header { color: #FF6400; } -.cm-s-blackboard .cm-hr { color: #AEAEAE; } -.cm-s-blackboard .cm-link { color: #8DA6CE; } -.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } - -.cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;} -.cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/cobalt.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/cobalt.css deleted file mode 100644 index b6eebcf..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/cobalt.css +++ /dev/null @@ -1,25 +0,0 @@ -.cm-s-cobalt.CodeMirror { background: #002240; color: white; } -.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } -.cm-s-cobalt .CodeMirror-line::selection, .cm-s-cobalt .CodeMirror-line > span::selection, .cm-s-cobalt .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); } -.cm-s-cobalt .CodeMirror-line::-moz-selection, .cm-s-cobalt .CodeMirror-line > span::-moz-selection, .cm-s-cobalt .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); } -.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } -.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-cobalt span.cm-comment { color: #08f; } -.cm-s-cobalt span.cm-atom { color: #845dc4; } -.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } -.cm-s-cobalt span.cm-keyword { color: #ffee80; } -.cm-s-cobalt span.cm-string { color: #3ad900; } -.cm-s-cobalt span.cm-meta { color: #ff9d00; } -.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } -.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } -.cm-s-cobalt span.cm-bracket { color: #d8d8d8; } -.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } -.cm-s-cobalt span.cm-link { color: #845dc4; } -.cm-s-cobalt span.cm-error { color: #9d1e15; } - -.cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;} -.cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/colorforth.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/colorforth.css deleted file mode 100644 index 73fbf80..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/colorforth.css +++ /dev/null @@ -1,33 +0,0 @@ -.cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; } -.cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; } -.cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; } -.cm-s-colorforth .CodeMirror-linenumber { color: #bababa; } -.cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-colorforth span.cm-comment { color: #ededed; } -.cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; } -.cm-s-colorforth span.cm-keyword { color: #ffd900; } -.cm-s-colorforth span.cm-builtin { color: #00d95a; } -.cm-s-colorforth span.cm-variable { color: #73ff00; } -.cm-s-colorforth span.cm-string { color: #007bff; } -.cm-s-colorforth span.cm-number { color: #00c4ff; } -.cm-s-colorforth span.cm-atom { color: #606060; } - -.cm-s-colorforth span.cm-variable-2 { color: #EEE; } -.cm-s-colorforth span.cm-variable-3 { color: #DDD; } -.cm-s-colorforth span.cm-property {} -.cm-s-colorforth span.cm-operator {} - -.cm-s-colorforth span.cm-meta { color: yellow; } -.cm-s-colorforth span.cm-qualifier { color: #FFF700; } -.cm-s-colorforth span.cm-bracket { color: #cc7; } -.cm-s-colorforth span.cm-tag { color: #FFBD40; } -.cm-s-colorforth span.cm-attribute { color: #FFF700; } -.cm-s-colorforth span.cm-error { color: #f00; } - -.cm-s-colorforth .CodeMirror-selected { background: #333d53 !important; } - -.cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); } - -.cm-s-colorforth .CodeMirror-activeline-background {background: #253540 !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/dracula.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/dracula.css deleted file mode 100644 index 5badef2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/dracula.css +++ /dev/null @@ -1,87 +0,0 @@ -/* - - Name: dracula - Author: Michael Kaminsky (http://github.com/mkaminsky11) - - Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme) - -*/ - - -.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters { - background-color: #282a36 !important; - color: #f8f8f2 !important; - border: none; -} -.cm-s-dracula .CodeMirror-gutters{ - color: #282a36; -} -.cm-s-dracula .CodeMirror-cursor { - border-left: solid thin #f8f8f0 !important; -} -.cm-s-dracula .CodeMirror-linenumber { - color: #6D8A88; -} -.cm-s-dracula.CodeMirror-focused .CodeMirror-selected { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-dracula span.cm-comment { - color: #6272a4; -} -.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { - color: #f1fa8c; -} -.cm-s-dracula span.cm-number { - color: #bd93f9; -} -.cm-s-dracula span.cm-variable { - color: #50fa7b; -} -.cm-s-dracula span.cm-variable-2 { - color: white; -} -.cm-s-dracula span.cm-def { - color: #ffb86c; -} -.cm-s-dracula span.cm-keyword { - color: #ff79c6; -} -.cm-s-dracula span.cm-operator { - color: #ff79c6; -} -.cm-s-dracula span.cm-keyword { - color: #ff79c6; -} -.cm-s-dracula span.cm-atom { - color: #bd93f9; -} -.cm-s-dracula span.cm-meta { - color: #f8f8f2; -} -.cm-s-dracula span.cm-tag { - color: #ff79c6; -} -.cm-s-dracula span.cm-attribute { - color: #50fa7b; -} -.cm-s-dracula span.cm-qualifier { - color: #50fa7b; -} -.cm-s-dracula span.cm-property { - color: #66d9ef; -} -.cm-s-dracula span.cm-builtin { - color: #50fa7b; -} -.cm-s-dracula span.cm-variable-3 { - color: #50fa7b; -} - -.cm-s-dracula .CodeMirror-activeline-background {background: rgba(255,255,255,0.1) !important;} -.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/eclipse.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/eclipse.css deleted file mode 100644 index 317218e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/eclipse.css +++ /dev/null @@ -1,23 +0,0 @@ -.cm-s-eclipse span.cm-meta {color: #FF1717;} -.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } -.cm-s-eclipse span.cm-atom {color: #219;} -.cm-s-eclipse span.cm-number {color: #164;} -.cm-s-eclipse span.cm-def {color: #00f;} -.cm-s-eclipse span.cm-variable {color: black;} -.cm-s-eclipse span.cm-variable-2 {color: #0000C0;} -.cm-s-eclipse span.cm-variable-3 {color: #0000C0;} -.cm-s-eclipse span.cm-property {color: black;} -.cm-s-eclipse span.cm-operator {color: black;} -.cm-s-eclipse span.cm-comment {color: #3F7F5F;} -.cm-s-eclipse span.cm-string {color: #2A00FF;} -.cm-s-eclipse span.cm-string-2 {color: #f50;} -.cm-s-eclipse span.cm-qualifier {color: #555;} -.cm-s-eclipse span.cm-builtin {color: #30a;} -.cm-s-eclipse span.cm-bracket {color: #cc7;} -.cm-s-eclipse span.cm-tag {color: #170;} -.cm-s-eclipse span.cm-attribute {color: #00c;} -.cm-s-eclipse span.cm-link {color: #219;} -.cm-s-eclipse span.cm-error {color: #f00;} - -.cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/elegant.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/elegant.css deleted file mode 100644 index dd7df7b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/elegant.css +++ /dev/null @@ -1,13 +0,0 @@ -.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} -.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} -.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} -.cm-s-elegant span.cm-variable {color: black;} -.cm-s-elegant span.cm-variable-2 {color: #b11;} -.cm-s-elegant span.cm-qualifier {color: #555;} -.cm-s-elegant span.cm-keyword {color: #730;} -.cm-s-elegant span.cm-builtin {color: #30a;} -.cm-s-elegant span.cm-link {color: #762;} -.cm-s-elegant span.cm-error {background-color: #fdd;} - -.cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/erlang-dark.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/erlang-dark.css deleted file mode 100644 index 48552f8..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/erlang-dark.css +++ /dev/null @@ -1,34 +0,0 @@ -.cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } -.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } -.cm-s-erlang-dark .CodeMirror-line::selection, .cm-s-erlang-dark .CodeMirror-line > span::selection, .cm-s-erlang-dark .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); } -.cm-s-erlang-dark .CodeMirror-line::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span::-moz-selection, .cm-s-erlang-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); } -.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-erlang-dark .CodeMirror-guttermarker { color: white; } -.cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-erlang-dark span.cm-quote { color: #ccc; } -.cm-s-erlang-dark span.cm-atom { color: #f133f1; } -.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; } -.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; } -.cm-s-erlang-dark span.cm-builtin { color: #eaa; } -.cm-s-erlang-dark span.cm-comment { color: #77f; } -.cm-s-erlang-dark span.cm-def { color: #e7a; } -.cm-s-erlang-dark span.cm-keyword { color: #ffee80; } -.cm-s-erlang-dark span.cm-meta { color: #50fefe; } -.cm-s-erlang-dark span.cm-number { color: #ffd0d0; } -.cm-s-erlang-dark span.cm-operator { color: #d55; } -.cm-s-erlang-dark span.cm-property { color: #ccc; } -.cm-s-erlang-dark span.cm-qualifier { color: #ccc; } -.cm-s-erlang-dark span.cm-special { color: #ffbbbb; } -.cm-s-erlang-dark span.cm-string { color: #3ad900; } -.cm-s-erlang-dark span.cm-string-2 { color: #ccc; } -.cm-s-erlang-dark span.cm-tag { color: #9effff; } -.cm-s-erlang-dark span.cm-variable { color: #50fe50; } -.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; } -.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; } -.cm-s-erlang-dark span.cm-error { color: #9d1e15; } - -.cm-s-erlang-dark .CodeMirror-activeline-background {background: #013461 !important;} -.cm-s-erlang-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/icecoder.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/icecoder.css deleted file mode 100644 index 5ec3743..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/icecoder.css +++ /dev/null @@ -1,42 +0,0 @@ -/* -ICEcoder default theme by Matt Pass, used in code editor available at https://icecoder.net -*/ - -.cm-s-icecoder {color: #666; background: #141612} - -.cm-s-icecoder span.cm-keyword {color: #eee; font-weight:bold} /* off-white 1 */ -.cm-s-icecoder span.cm-atom {color: #e1c76e} /* yellow */ -.cm-s-icecoder span.cm-number {color: #6cb5d9} /* blue */ -.cm-s-icecoder span.cm-def {color: #b9ca4a} /* green */ - -.cm-s-icecoder span.cm-variable {color: #6cb5d9} /* blue */ -.cm-s-icecoder span.cm-variable-2 {color: #cc1e5c} /* pink */ -.cm-s-icecoder span.cm-variable-3 {color: #f9602c} /* orange */ - -.cm-s-icecoder span.cm-property {color: #eee} /* off-white 1 */ -.cm-s-icecoder span.cm-operator {color: #9179bb} /* purple */ -.cm-s-icecoder span.cm-comment {color: #97a3aa} /* grey-blue */ - -.cm-s-icecoder span.cm-string {color: #b9ca4a} /* green */ -.cm-s-icecoder span.cm-string-2 {color: #6cb5d9} /* blue */ - -.cm-s-icecoder span.cm-meta {color: #555} /* grey */ - -.cm-s-icecoder span.cm-qualifier {color: #555} /* grey */ -.cm-s-icecoder span.cm-builtin {color: #214e7b} /* bright blue */ -.cm-s-icecoder span.cm-bracket {color: #cc7} /* grey-yellow */ - -.cm-s-icecoder span.cm-tag {color: #e8e8e8} /* off-white 2 */ -.cm-s-icecoder span.cm-attribute {color: #099} /* teal */ - -.cm-s-icecoder span.cm-header {color: #6a0d6a} /* purple-pink */ -.cm-s-icecoder span.cm-quote {color: #186718} /* dark green */ -.cm-s-icecoder span.cm-hr {color: #888} /* mid-grey */ -.cm-s-icecoder span.cm-link {color: #e1c76e} /* yellow */ -.cm-s-icecoder span.cm-error {color: #d00} /* red */ - -.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important} -.cm-s-icecoder .CodeMirror-selected {color: #fff !important; background: #037 !important} -.cm-s-icecoder .CodeMirror-gutters {background: #141612; min-width: 41px; border-right: 0} -.cm-s-icecoder .CodeMirror-linenumber {color: #555; cursor: default} -.cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/lesser-dark.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/lesser-dark.css deleted file mode 100644 index 0573c06..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/lesser-dark.css +++ /dev/null @@ -1,47 +0,0 @@ -/* -http://lesscss.org/ dark theme -Ported to CodeMirror by Peter Kroon -*/ -.cm-s-lesser-dark { - line-height: 1.3em; -} -.cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } -.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ -.cm-s-lesser-dark .CodeMirror-line::selection, .cm-s-lesser-dark .CodeMirror-line > span::selection, .cm-s-lesser-dark .CodeMirror-line > span > span::selection { background: rgba(69, 68, 59, .99); } -.cm-s-lesser-dark .CodeMirror-line::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span::-moz-selection, .cm-s-lesser-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(69, 68, 59, .99); } -.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } -.cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ - -.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ - -.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; } -.cm-s-lesser-dark .CodeMirror-guttermarker { color: #599eff; } -.cm-s-lesser-dark .CodeMirror-guttermarker-subtle { color: #777; } -.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; } - -.cm-s-lesser-dark span.cm-header {color: #a0a;} -.cm-s-lesser-dark span.cm-quote {color: #090;} -.cm-s-lesser-dark span.cm-keyword { color: #599eff; } -.cm-s-lesser-dark span.cm-atom { color: #C2B470; } -.cm-s-lesser-dark span.cm-number { color: #B35E4D; } -.cm-s-lesser-dark span.cm-def {color: white;} -.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } -.cm-s-lesser-dark span.cm-variable-2 { color: #669199; } -.cm-s-lesser-dark span.cm-variable-3 { color: white; } -.cm-s-lesser-dark span.cm-property {color: #92A75C;} -.cm-s-lesser-dark span.cm-operator {color: #92A75C;} -.cm-s-lesser-dark span.cm-comment { color: #666; } -.cm-s-lesser-dark span.cm-string { color: #BCD279; } -.cm-s-lesser-dark span.cm-string-2 {color: #f50;} -.cm-s-lesser-dark span.cm-meta { color: #738C73; } -.cm-s-lesser-dark span.cm-qualifier {color: #555;} -.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } -.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } -.cm-s-lesser-dark span.cm-tag { color: #669199; } -.cm-s-lesser-dark span.cm-attribute {color: #00c;} -.cm-s-lesser-dark span.cm-hr {color: #999;} -.cm-s-lesser-dark span.cm-link {color: #00c;} -.cm-s-lesser-dark span.cm-error { color: #9d1e15; } - -.cm-s-lesser-dark .CodeMirror-activeline-background {background: #3C3A3A !important;} -.cm-s-lesser-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/liquibyte.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/liquibyte.css deleted file mode 100644 index a6e070c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/liquibyte.css +++ /dev/null @@ -1,95 +0,0 @@ -.cm-s-liquibyte.CodeMirror { - background-color: #000; - color: #fff; - line-height: 1.2em; - font-size: 1em; -} -.CodeMirror-focused .cm-matchhighlight { - text-decoration: underline; - text-decoration-color: #0f0; - text-decoration-style: wavy; -} -.cm-trailingspace { - text-decoration: line-through; - text-decoration-color: #f00; - text-decoration-style: dotted; -} -.cm-tab { - text-decoration: line-through; - text-decoration-color: #404040; - text-decoration-style: dotted; -} -.cm-s-liquibyte .CodeMirror-gutters { background-color: #262626; border-right: 1px solid #505050; padding-right: 0.8em; } -.cm-s-liquibyte .CodeMirror-gutter-elt div{ font-size: 1.2em; } -.cm-s-liquibyte .CodeMirror-guttermarker { } -.cm-s-liquibyte .CodeMirror-guttermarker-subtle { } -.cm-s-liquibyte .CodeMirror-linenumber { color: #606060; padding-left: 0;} -.cm-s-liquibyte .CodeMirror-cursor { border-left: 1px solid #eee !important; } - -.cm-s-liquibyte span.cm-comment { color: #008000; } -.cm-s-liquibyte span.cm-def { color: #ffaf40; font-weight: bold; } -.cm-s-liquibyte span.cm-keyword { color: #c080ff; font-weight: bold; } -.cm-s-liquibyte span.cm-builtin { color: #ffaf40; font-weight: bold; } -.cm-s-liquibyte span.cm-variable { color: #5967ff; font-weight: bold; } -.cm-s-liquibyte span.cm-string { color: #ff8000; } -.cm-s-liquibyte span.cm-number { color: #0f0; font-weight: bold; } -.cm-s-liquibyte span.cm-atom { color: #bf3030; font-weight: bold; } - -.cm-s-liquibyte span.cm-variable-2 { color: #007f7f; font-weight: bold; } -.cm-s-liquibyte span.cm-variable-3 { color: #c080ff; font-weight: bold; } -.cm-s-liquibyte span.cm-property { color: #999; font-weight: bold; } -.cm-s-liquibyte span.cm-operator { color: #fff; } - -.cm-s-liquibyte span.cm-meta { color: #0f0; } -.cm-s-liquibyte span.cm-qualifier { color: #fff700; font-weight: bold; } -.cm-s-liquibyte span.cm-bracket { color: #cc7; } -.cm-s-liquibyte span.cm-tag { color: #ff0; font-weight: bold; } -.cm-s-liquibyte span.cm-attribute { color: #c080ff; font-weight: bold; } -.cm-s-liquibyte span.cm-error { color: #f00; } - -.cm-s-liquibyte .CodeMirror-selected { background-color: rgba(255, 0, 0, 0.25) !important; } - -.cm-s-liquibyte span.cm-compilation { background-color: rgba(255, 255, 255, 0.12); } - -.cm-s-liquibyte .CodeMirror-activeline-background {background-color: rgba(0, 255, 0, 0.15) !important;} - -/* Default styles for common addons */ -div.CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; } -div.CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; } -.CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); } -/* Scrollbars */ -/* Simple */ -div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover { - background-color: rgba(80, 80, 80, .7); -} -div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div { - background-color: rgba(80, 80, 80, .3); - border: 1px solid #404040; - border-radius: 5px; -} -div.CodeMirror-simplescroll-vertical div { - border-top: 1px solid #404040; - border-bottom: 1px solid #404040; -} -div.CodeMirror-simplescroll-horizontal div { - border-left: 1px solid #404040; - border-right: 1px solid #404040; -} -div.CodeMirror-simplescroll-vertical { - background-color: #262626; -} -div.CodeMirror-simplescroll-horizontal { - background-color: #262626; - border-top: 1px solid #404040; -} -/* Overlay */ -div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div { - background-color: #404040; - border-radius: 5px; -} -div.CodeMirror-overlayscroll-vertical div { - border: 1px solid #404040; -} -div.CodeMirror-overlayscroll-horizontal div { - border: 1px solid #404040; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/material.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/material.css deleted file mode 100644 index 85e1f18..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/material.css +++ /dev/null @@ -1,105 +0,0 @@ -/* - - Name: material - Author: Michael Kaminsky (http://github.com/mkaminsky11) - - Original material color scheme by Mattia Astorino (https://github.com/equinusocio/material-theme) - -*/ - -.cm-s-material { - background-color: #263238; - color: rgba(233, 237, 237, 1); -} -.cm-s-material .CodeMirror-gutters { - background: #263238; - color: rgb(83,127,126); - border: none; -} -.cm-s-material .CodeMirror-guttermarker, .cm-s-material .CodeMirror-guttermarker-subtle, .cm-s-material .CodeMirror-linenumber { - color: rgb(83,127,126); -} -.cm-s-material .CodeMirror-cursor { - border-left: 1px solid #f8f8f0 !important; -} -.cm-s-material .CodeMirror-selected { - background: rgba(255, 255, 255, 0.15); -} -.cm-s-material.CodeMirror-focused .CodeMirror-selected { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-material .CodeMirror-line::selection, .cm-s-material .CodeMirror-line > span::selection, .cm-s-material .CodeMirror-line > span > span::selection { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-material .CodeMirror-line::-moz-selection, .cm-s-material .CodeMirror-line > span::-moz-selection, .cm-s-material .CodeMirror-line > span > span::-moz-selection { - background: rgba(255, 255, 255, 0.10); -} - -.CodeMirror-activeline-background { - background: rgba(0, 0, 0, 0) !important; -} -.cm-s-material span.cm-keyword { - color: rgba(199, 146, 234, 1); -} -.cm-s-material span.cm-operator { - color: rgba(233, 237, 237, 1); -} -.cm-s-material span.cm-variable-2 { - color: #80CBC4; -} -.cm-s-material span.cm-variable-3 { - color: #82B1FF; -} -.cm-s-material span.cm-builtin { - color: #DECB6B; -} -.cm-s-material span.cm-atom { - color: #F77669; -} -.cm-s-material span.cm-number { - color: #F77669; -} -.cm-s-material span.cm-def { - color: rgba(233, 237, 237, 1); -} -.cm-s-material span.cm-error { - color: rgba(255, 255, 255, 1.0); - background-color: #EC5F67; -} -.cm-s-material span.cm-string { - color: #C3E88D; -} -.cm-s-material span.cm-string-2 { - color: #80CBC4; -} -.cm-s-material span.cm-comment { - color: #546E7A; -} -.cm-s-material span.cm-variable { - color: #82B1FF; -} -.cm-s-material span.cm-tag { - color: #80CBC4; -} -.cm-s-material span.cm-meta{ - color: #80CBC4; -} -.cm-s-material span.cm-attribute { - color: #FFCB6B; -} -.cm-s-material span.cm-property { - color: #80CBAE; -} -.cm-s-material span.cm-qualifier { - color: #DECB6B; -} -.cm-s-material span.cm-variable-3{ - color: #DECB6B; -} -.cm-s-material span.cm-tag { - color: rgba(255, 83, 112, 1); -} -.cm-s-material .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/mbo.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/mbo.css deleted file mode 100644 index cc9032e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/mbo.css +++ /dev/null @@ -1,37 +0,0 @@ -/****************************************************************/ -/* Based on mbonaci's Brackets mbo theme */ -/* https://github.com/mbonaci/global/blob/master/Mbo.tmTheme */ -/* Create your own: http://tmtheme-editor.herokuapp.com */ -/****************************************************************/ - -.cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;} -.cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;} -.cm-s-mbo .CodeMirror-line::selection, .cm-s-mbo .CodeMirror-line > span::selection, .cm-s-mbo .CodeMirror-line > span > span::selection { background: rgba(113, 108, 98, .99); } -.cm-s-mbo .CodeMirror-line::-moz-selection, .cm-s-mbo .CodeMirror-line > span::-moz-selection, .cm-s-mbo .CodeMirror-line > span > span::-moz-selection { background: rgba(113, 108, 98, .99); } -.cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;} -.cm-s-mbo .CodeMirror-guttermarker { color: white; } -.cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; } -.cm-s-mbo .CodeMirror-linenumber {color: #dadada;} -.cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;} - -.cm-s-mbo span.cm-comment {color: #95958a;} -.cm-s-mbo span.cm-atom {color: #00a8c6;} -.cm-s-mbo span.cm-number {color: #00a8c6;} - -.cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;} -.cm-s-mbo span.cm-keyword {color: #ffb928;} -.cm-s-mbo span.cm-string {color: #ffcf6c;} -.cm-s-mbo span.cm-string.cm-property {color: #ffffec;} - -.cm-s-mbo span.cm-variable {color: #ffffec;} -.cm-s-mbo span.cm-variable-2 {color: #00a8c6;} -.cm-s-mbo span.cm-def {color: #ffffec;} -.cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;} -.cm-s-mbo span.cm-tag {color: #9ddfe9;} -.cm-s-mbo span.cm-link {color: #f54b07;} -.cm-s-mbo span.cm-error {border-bottom: #636363; color: #ffffec;} -.cm-s-mbo span.cm-qualifier {color: #ffffec;} - -.cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;} -.cm-s-mbo .CodeMirror-matchingbracket {color: #222 !important;} -.cm-s-mbo .CodeMirror-matchingtag {background: rgba(255, 255, 255, .37);} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/mdn-like.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/mdn-like.css deleted file mode 100644 index 771d447..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/mdn-like.css +++ /dev/null @@ -1,46 +0,0 @@ -/* - MDN-LIKE Theme - Mozilla - Ported to CodeMirror by Peter Kroon - Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues - GitHub: @peterkroon - - The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation - -*/ -.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; } -.cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; } -.cm-s-mdn-like .CodeMirror-line::selection, .cm-s-mdn-like .CodeMirror-line > span::selection, .cm-s-mdn-like .CodeMirror-line > span > span::selection { background: #cfc; } -.cm-s-mdn-like .CodeMirror-line::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span > span::-moz-selection { background: #cfc; } - -.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } -.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; } -div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; } - -.cm-s-mdn-like .cm-keyword { color: #6262FF; } -.cm-s-mdn-like .cm-atom { color: #F90; } -.cm-s-mdn-like .cm-number { color: #ca7841; } -.cm-s-mdn-like .cm-def { color: #8DA6CE; } -.cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; } -.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def { color: #07a; } - -.cm-s-mdn-like .cm-variable { color: #07a; } -.cm-s-mdn-like .cm-property { color: #905; } -.cm-s-mdn-like .cm-qualifier { color: #690; } - -.cm-s-mdn-like .cm-operator { color: #cda869; } -.cm-s-mdn-like .cm-comment { color:#777; font-weight:normal; } -.cm-s-mdn-like .cm-string { color:#07a; font-style:italic; } -.cm-s-mdn-like .cm-string-2 { color:#bd6b18; } /*?*/ -.cm-s-mdn-like .cm-meta { color: #000; } /*?*/ -.cm-s-mdn-like .cm-builtin { color: #9B7536; } /*?*/ -.cm-s-mdn-like .cm-tag { color: #997643; } -.cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/ -.cm-s-mdn-like .cm-header { color: #FF6400; } -.cm-s-mdn-like .cm-hr { color: #AEAEAE; } -.cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } -.cm-s-mdn-like .cm-error { border-bottom: 1px solid red; } - -div.cm-s-mdn-like .CodeMirror-activeline-background {background: #efefff;} -div.cm-s-mdn-like span.CodeMirror-matchingbracket {outline:1px solid grey; color: inherit;} - -.cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2XOQmcGmoACCLydx7nToa23ATaSIY2ichfOdPTGxlasXMLaL0MLZAOwAKIM+y8CmicobGdCcbbK9DzN+yYGVoNNI5iUKTMyYOjPse4A8SM1MmcXgU0toOq1yO/v8FOxlASyc7TgeYaAMBJHcY1CcCwGI/TK4AmDbDyKYBBtFUkRwto8gygiQEaByFgJ00BH2M8JWwQS1nafDXQCidWyOI8AcjDCSjCLk8ngObuAm3JAHAdubAmOaK06V8MNEsKPJOhobSprwQa6gD7DclRQdqcwL4zxqgBrQcabUiBLclRDKAlWp+etPkBaNMA0AKlrHwTdEByZAA4GM+SNluSY6wAzcMNewxmgig5Ks0nkrSpBvSaQHMdKTBAnLojOdYyGpQ254602ZILPdTD1hdlggdIm74jbTp8vDwF5ZYUeLWGJpWsh6XNyXgcYwVoJQTEhhTYkxzZjiU5npU2TaB979TQehlaAVq4kaGpiPwwwLkYUuBbQwocyQTv1tA0+1UFWoJF3iv1oq+qoSk8EQdJmwHkziIF7oOZk14EGitibAdjLYYK78H5vZOhtWpoI0ATGHs0Q8OMb4Ey+2bU2UYztCtA0wFAs7TplGLRVQCcqaFdGSPCeTI1QNIC52iWNzof6Uib7xjEp07mNNoUYmVosVItHrHzRlLgBn9LFyRHaQCtVUMbtTNhoXWiTOO9k/V8BdAc1Oq0ArSQs6/5SU0hckNy9NnXqQY0PGYo5dWJ7nINaN6o958FWin27aBaWRka1r5myvLOAm0j30eBJqCxHLReVclxhxOEN2JfDWjxBtAC7MIH1fVaGdoOp4qJYDgKtKPSFNID2gSnGldrCqkFZ+5UeQXQBIRrSwocbdZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=); } diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/midnight.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/midnight.css deleted file mode 100644 index 9e9825b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/midnight.css +++ /dev/null @@ -1,47 +0,0 @@ -/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ - -/**/ -.cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } -.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } - -/**/ -.cm-s-midnight .CodeMirror-activeline-background {background: #253540 !important;} - -.cm-s-midnight.CodeMirror { - background: #0F192A; - color: #D1EDFF; -} - -.cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} - -.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} -.cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); } -.cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); } -.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} -.cm-s-midnight .CodeMirror-guttermarker { color: white; } -.cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;} -.cm-s-midnight .CodeMirror-cursor { - border-left: 1px solid #F8F8F0 !important; -} - -.cm-s-midnight span.cm-comment {color: #428BDD;} -.cm-s-midnight span.cm-atom {color: #AE81FF;} -.cm-s-midnight span.cm-number {color: #D1EDFF;} - -.cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;} -.cm-s-midnight span.cm-keyword {color: #E83737;} -.cm-s-midnight span.cm-string {color: #1DC116;} - -.cm-s-midnight span.cm-variable {color: #FFAA3E;} -.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;} -.cm-s-midnight span.cm-def {color: #4DD;} -.cm-s-midnight span.cm-bracket {color: #D1EDFF;} -.cm-s-midnight span.cm-tag {color: #449;} -.cm-s-midnight span.cm-link {color: #AE81FF;} -.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;} - -.cm-s-midnight .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/monokai.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/monokai.css deleted file mode 100644 index e11e80c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/monokai.css +++ /dev/null @@ -1,35 +0,0 @@ -/* Based on Sublime Text's Monokai theme */ - -.cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} -.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} -.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); } -.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); } -.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} -.cm-s-monokai .CodeMirror-guttermarker { color: white; } -.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;} -.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} - -.cm-s-monokai span.cm-comment {color: #75715e;} -.cm-s-monokai span.cm-atom {color: #ae81ff;} -.cm-s-monokai span.cm-number {color: #ae81ff;} - -.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} -.cm-s-monokai span.cm-keyword {color: #f92672;} -.cm-s-monokai span.cm-string {color: #e6db74;} - -.cm-s-monokai span.cm-variable {color: #f8f8f2;} -.cm-s-monokai span.cm-variable-2 {color: #9effff;} -.cm-s-monokai span.cm-variable-3 {color: #66d9ef;} -.cm-s-monokai span.cm-def {color: #fd971f;} -.cm-s-monokai span.cm-bracket {color: #f8f8f2;} -.cm-s-monokai span.cm-tag {color: #f92672;} -.cm-s-monokai span.cm-header {color: #ae81ff;} -.cm-s-monokai span.cm-link {color: #ae81ff;} -.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} - -.cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;} -.cm-s-monokai .CodeMirror-matchingbracket { - text-decoration: underline; - color: white !important; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/neat.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/neat.css deleted file mode 100644 index 115083b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/neat.css +++ /dev/null @@ -1,12 +0,0 @@ -.cm-s-neat span.cm-comment { color: #a86; } -.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } -.cm-s-neat span.cm-string { color: #a22; } -.cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } -.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } -.cm-s-neat span.cm-variable { color: black; } -.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } -.cm-s-neat span.cm-meta {color: #555;} -.cm-s-neat span.cm-link { color: #3a3; } - -.cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/neo.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/neo.css deleted file mode 100644 index cecaaf2..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/neo.css +++ /dev/null @@ -1,43 +0,0 @@ -/* neo theme for codemirror */ - -/* Color scheme */ - -.cm-s-neo.CodeMirror { - background-color:#ffffff; - color:#2e383c; - line-height:1.4375; -} -.cm-s-neo .cm-comment {color:#75787b} -.cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3} -.cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a} -.cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328} -.cm-s-neo .cm-string {color:#b35e14} -.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65} - - -/* Editor styling */ - -.cm-s-neo pre { - padding:0; -} - -.cm-s-neo .CodeMirror-gutters { - border:none; - border-right:10px solid transparent; - background-color:transparent; -} - -.cm-s-neo .CodeMirror-linenumber { - padding:0; - color:#e0e2e5; -} - -.cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } -.cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } - -.cm-s-neo div.CodeMirror-cursor { - width: auto; - border: 0; - background: rgba(155,157,162,0.37); - z-index: 1; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/night.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/night.css deleted file mode 100644 index 6fbbcaa..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/night.css +++ /dev/null @@ -1,28 +0,0 @@ -/* Loosely based on the Midnight Textmate theme */ - -.cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } -.cm-s-night div.CodeMirror-selected { background: #447 !important; } -.cm-s-night .CodeMirror-line::selection, .cm-s-night .CodeMirror-line > span::selection, .cm-s-night .CodeMirror-line > span > span::selection { background: rgba(68, 68, 119, .99); } -.cm-s-night .CodeMirror-line::-moz-selection, .cm-s-night .CodeMirror-line > span::-moz-selection, .cm-s-night .CodeMirror-line > span > span::-moz-selection { background: rgba(68, 68, 119, .99); } -.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-night .CodeMirror-guttermarker { color: white; } -.cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } -.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } -.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-night span.cm-comment { color: #6900a1; } -.cm-s-night span.cm-atom { color: #845dc4; } -.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } -.cm-s-night span.cm-keyword { color: #599eff; } -.cm-s-night span.cm-string { color: #37f14a; } -.cm-s-night span.cm-meta { color: #7678e2; } -.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } -.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } -.cm-s-night span.cm-bracket { color: #8da6ce; } -.cm-s-night span.cm-comment { color: #6900a1; } -.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } -.cm-s-night span.cm-link { color: #845dc4; } -.cm-s-night span.cm-error { color: #9d1e15; } - -.cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;} -.cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/paraiso-dark.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/paraiso-dark.css deleted file mode 100644 index 2b6a797..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/paraiso-dark.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Paraíso (Dark) - Author: Jan T. Sott - - Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) - Inspired by the art of Rubens LP (http://www.rubenslp.com.br) - -*/ - -.cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} -.cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} -.cm-s-paraiso-dark .CodeMirror-line::selection, .cm-s-paraiso-dark .CodeMirror-line > span::selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::selection { background: rgba(65, 50, 63, .99); } -.cm-s-paraiso-dark .CodeMirror-line::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(65, 50, 63, .99); } -.cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} -.cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } -.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } -.cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;} -.cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;} - -.cm-s-paraiso-dark span.cm-comment {color: #e96ba8;} -.cm-s-paraiso-dark span.cm-atom {color: #815ba4;} -.cm-s-paraiso-dark span.cm-number {color: #815ba4;} - -.cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;} -.cm-s-paraiso-dark span.cm-keyword {color: #ef6155;} -.cm-s-paraiso-dark span.cm-string {color: #fec418;} - -.cm-s-paraiso-dark span.cm-variable {color: #48b685;} -.cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;} -.cm-s-paraiso-dark span.cm-def {color: #f99b15;} -.cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;} -.cm-s-paraiso-dark span.cm-tag {color: #ef6155;} -.cm-s-paraiso-dark span.cm-link {color: #815ba4;} -.cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;} - -.cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;} -.cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/paraiso-light.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/paraiso-light.css deleted file mode 100644 index 01d2e11..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/paraiso-light.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Paraíso (Light) - Author: Jan T. Sott - - Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) - Inspired by the art of Rubens LP (http://www.rubenslp.com.br) - -*/ - -.cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} -.cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} -.cm-s-paraiso-light .CodeMirror-line::selection, .cm-s-paraiso-light .CodeMirror-line > span::selection, .cm-s-paraiso-light .CodeMirror-line > span > span::selection { background: #b9b6b0; } -.cm-s-paraiso-light .CodeMirror-line::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span::-moz-selection, .cm-s-paraiso-light .CodeMirror-line > span > span::-moz-selection { background: #b9b6b0; } -.cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} -.cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } -.cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } -.cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;} -.cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;} - -.cm-s-paraiso-light span.cm-comment {color: #e96ba8;} -.cm-s-paraiso-light span.cm-atom {color: #815ba4;} -.cm-s-paraiso-light span.cm-number {color: #815ba4;} - -.cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;} -.cm-s-paraiso-light span.cm-keyword {color: #ef6155;} -.cm-s-paraiso-light span.cm-string {color: #fec418;} - -.cm-s-paraiso-light span.cm-variable {color: #48b685;} -.cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;} -.cm-s-paraiso-light span.cm-def {color: #f99b15;} -.cm-s-paraiso-light span.cm-bracket {color: #41323f;} -.cm-s-paraiso-light span.cm-tag {color: #ef6155;} -.cm-s-paraiso-light span.cm-link {color: #815ba4;} -.cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;} - -.cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;} -.cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/pastel-on-dark.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/pastel-on-dark.css deleted file mode 100644 index 1c7f84c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/pastel-on-dark.css +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Pastel On Dark theme ported from ACE editor - * @license MIT - * @copyright AtomicPages LLC 2014 - * @author Dennis Thompson, AtomicPages LLC - * @version 1.1 - * @source https://github.com/atomicpages/codemirror-pastel-on-dark-theme - */ - -.cm-s-pastel-on-dark.CodeMirror { - background: #2c2827; - color: #8F938F; - line-height: 1.5; - font-size: 14px; -} -.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; } -.cm-s-pastel-on-dark .CodeMirror-line::selection, .cm-s-pastel-on-dark .CodeMirror-line > span::selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::selection { background: rgba(221,240,255,0.2); } -.cm-s-pastel-on-dark .CodeMirror-line::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span::-moz-selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(221,240,255,0.2); } - -.cm-s-pastel-on-dark .CodeMirror-gutters { - background: #34302f; - border-right: 0px; - padding: 0 3px; -} -.cm-s-pastel-on-dark .CodeMirror-guttermarker { color: white; } -.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle { color: #8F938F; } -.cm-s-pastel-on-dark .CodeMirror-linenumber { color: #8F938F; } -.cm-s-pastel-on-dark .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } -.cm-s-pastel-on-dark span.cm-comment { color: #A6C6FF; } -.cm-s-pastel-on-dark span.cm-atom { color: #DE8E30; } -.cm-s-pastel-on-dark span.cm-number { color: #CCCCCC; } -.cm-s-pastel-on-dark span.cm-property { color: #8F938F; } -.cm-s-pastel-on-dark span.cm-attribute { color: #a6e22e; } -.cm-s-pastel-on-dark span.cm-keyword { color: #AEB2F8; } -.cm-s-pastel-on-dark span.cm-string { color: #66A968; } -.cm-s-pastel-on-dark span.cm-variable { color: #AEB2F8; } -.cm-s-pastel-on-dark span.cm-variable-2 { color: #BEBF55; } -.cm-s-pastel-on-dark span.cm-variable-3 { color: #DE8E30; } -.cm-s-pastel-on-dark span.cm-def { color: #757aD8; } -.cm-s-pastel-on-dark span.cm-bracket { color: #f8f8f2; } -.cm-s-pastel-on-dark span.cm-tag { color: #C1C144; } -.cm-s-pastel-on-dark span.cm-link { color: #ae81ff; } -.cm-s-pastel-on-dark span.cm-qualifier,.cm-s-pastel-on-dark span.cm-builtin { color: #C1C144; } -.cm-s-pastel-on-dark span.cm-error { - background: #757aD8; - color: #f8f8f0; -} -.cm-s-pastel-on-dark .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.031) !important; } -.cm-s-pastel-on-dark .CodeMirror-matchingbracket { - border: 1px solid rgba(255,255,255,0.25); - color: #8F938F !important; - margin: -1px -1px 0 -1px; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/rubyblue.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/rubyblue.css deleted file mode 100644 index 064f192..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/rubyblue.css +++ /dev/null @@ -1,25 +0,0 @@ -.cm-s-rubyblue.CodeMirror { background: #112435; color: white; } -.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } -.cm-s-rubyblue .CodeMirror-line::selection, .cm-s-rubyblue .CodeMirror-line > span::selection, .cm-s-rubyblue .CodeMirror-line > span > span::selection { background: rgba(56, 86, 111, 0.99); } -.cm-s-rubyblue .CodeMirror-line::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span::-moz-selection, .cm-s-rubyblue .CodeMirror-line > span > span::-moz-selection { background: rgba(56, 86, 111, 0.99); } -.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } -.cm-s-rubyblue .CodeMirror-guttermarker { color: white; } -.cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } -.cm-s-rubyblue .CodeMirror-linenumber { color: white; } -.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } -.cm-s-rubyblue span.cm-atom { color: #F4C20B; } -.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } -.cm-s-rubyblue span.cm-keyword { color: #F0F; } -.cm-s-rubyblue span.cm-string { color: #F08047; } -.cm-s-rubyblue span.cm-meta { color: #F0F; } -.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } -.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } -.cm-s-rubyblue span.cm-bracket { color: #F0F; } -.cm-s-rubyblue span.cm-link { color: #F4C20B; } -.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } -.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } -.cm-s-rubyblue span.cm-error { color: #AF2018; } - -.cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/seti.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/seti.css deleted file mode 100644 index ea27d5e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/seti.css +++ /dev/null @@ -1,88 +0,0 @@ -/* - - Name: seti - Author: Michael Kaminsky (http://github.com/mkaminsky11) - - Original seti color scheme by Jesse Weed (https://github.com/jesseweed/seti-syntax) - -*/ - - -.cm-s-seti.CodeMirror { - background-color: #151718 !important; - color: #CFD2D1 !important; - border: none; -} -.cm-s-seti .CodeMirror-gutters{ - color: #404b53; - background-color: #0E1112; - border: none; -} -.cm-s-seti .CodeMirror-cursor { - border-left: solid thin #f8f8f0 !important; -} -.cm-s-seti .CodeMirror-linenumber { - color: #6D8A88; -} -.cm-s-seti.CodeMirror-focused .CodeMirror-selected { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-seti .CodeMirror-line::selection, .cm-s-seti .CodeMirror-line > span::selection, .cm-s-seti .CodeMirror-line > span > span::selection { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-seti .CodeMirror-line::-moz-selection, .cm-s-seti .CodeMirror-line > span::-moz-selection, .cm-s-seti .CodeMirror-line > span > span::-moz-selection { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-seti span.cm-comment { - color: #41535b; -} -.cm-s-seti span.cm-string, .cm-s-seti span.cm-string-2 { - color: #55b5db; -} -.cm-s-seti span.cm-number { - color: #cd3f45; -} -.cm-s-seti span.cm-variable { - color: #55b5db; -} -.cm-s-seti span.cm-variable-2 { - color: #a074c4; -} -.cm-s-seti span.cm-def { - color: #55b5db; -} -.cm-s-seti span.cm-keyword { - color: #ff79c6; -} -.cm-s-seti span.cm-operator { - color: #9fca56; -} -.cm-s-seti span.cm-keyword { - color: #e6cd69; -} -.cm-s-seti span.cm-atom { - color: #cd3f45; -} -.cm-s-seti span.cm-meta { - color: #55b5db; -} -.cm-s-seti span.cm-tag { - color: #55b5db; -} -.cm-s-seti span.cm-attribute { - color: #9fca56; -} -.cm-s-seti span.cm-qualifier { - color: #9fca56; -} -.cm-s-seti span.cm-property { - color: #a074c4; -} -.cm-s-seti span.cm-variable-3 { - color: #9fca56; -} -.cm-s-seti span.cm-builtin { - color: #9fca56; -} -.cm-s-seti .CodeMirror-activeline-background {background: #101213 !important;} -.cm-s-seti .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/solarized.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/solarized.css deleted file mode 100644 index 18ed6de..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/solarized.css +++ /dev/null @@ -1,165 +0,0 @@ -/* -Solarized theme for code-mirror -http://ethanschoonover.com/solarized -*/ - -/* -Solarized color pallet -http://ethanschoonover.com/solarized/img/solarized-palette.png -*/ - -.solarized.base03 { color: #002b36; } -.solarized.base02 { color: #073642; } -.solarized.base01 { color: #586e75; } -.solarized.base00 { color: #657b83; } -.solarized.base0 { color: #839496; } -.solarized.base1 { color: #93a1a1; } -.solarized.base2 { color: #eee8d5; } -.solarized.base3 { color: #fdf6e3; } -.solarized.solar-yellow { color: #b58900; } -.solarized.solar-orange { color: #cb4b16; } -.solarized.solar-red { color: #dc322f; } -.solarized.solar-magenta { color: #d33682; } -.solarized.solar-violet { color: #6c71c4; } -.solarized.solar-blue { color: #268bd2; } -.solarized.solar-cyan { color: #2aa198; } -.solarized.solar-green { color: #859900; } - -/* Color scheme for code-mirror */ - -.cm-s-solarized { - line-height: 1.45em; - color-profile: sRGB; - rendering-intent: auto; -} -.cm-s-solarized.cm-s-dark { - color: #839496; - background-color: #002b36; - text-shadow: #002b36 0 1px; -} -.cm-s-solarized.cm-s-light { - background-color: #fdf6e3; - color: #657b83; - text-shadow: #eee8d5 0 1px; -} - -.cm-s-solarized .CodeMirror-widget { - text-shadow: none; -} - -.cm-s-solarized .cm-header { color: #586e75; } -.cm-s-solarized .cm-quote { color: #93a1a1; } - -.cm-s-solarized .cm-keyword { color: #cb4b16 } -.cm-s-solarized .cm-atom { color: #d33682; } -.cm-s-solarized .cm-number { color: #d33682; } -.cm-s-solarized .cm-def { color: #2aa198; } - -.cm-s-solarized .cm-variable { color: #839496; } -.cm-s-solarized .cm-variable-2 { color: #b58900; } -.cm-s-solarized .cm-variable-3 { color: #6c71c4; } - -.cm-s-solarized .cm-property { color: #2aa198; } -.cm-s-solarized .cm-operator {color: #6c71c4;} - -.cm-s-solarized .cm-comment { color: #586e75; font-style:italic; } - -.cm-s-solarized .cm-string { color: #859900; } -.cm-s-solarized .cm-string-2 { color: #b58900; } - -.cm-s-solarized .cm-meta { color: #859900; } -.cm-s-solarized .cm-qualifier { color: #b58900; } -.cm-s-solarized .cm-builtin { color: #d33682; } -.cm-s-solarized .cm-bracket { color: #cb4b16; } -.cm-s-solarized .CodeMirror-matchingbracket { color: #859900; } -.cm-s-solarized .CodeMirror-nonmatchingbracket { color: #dc322f; } -.cm-s-solarized .cm-tag { color: #93a1a1 } -.cm-s-solarized .cm-attribute { color: #2aa198; } -.cm-s-solarized .cm-hr { - color: transparent; - border-top: 1px solid #586e75; - display: block; -} -.cm-s-solarized .cm-link { color: #93a1a1; cursor: pointer; } -.cm-s-solarized .cm-special { color: #6c71c4; } -.cm-s-solarized .cm-em { - color: #999; - text-decoration: underline; - text-decoration-style: dotted; -} -.cm-s-solarized .cm-strong { color: #eee; } -.cm-s-solarized .cm-error, -.cm-s-solarized .cm-invalidchar { - color: #586e75; - border-bottom: 1px dotted #dc322f; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; } -.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); } -.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection, .cm-s-dark .CodeMirror-line > span::-moz-selection, .cm-s-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(7, 54, 66, 0.99); } - -.cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; } -.cm-s-solarized.cm-s-light .CodeMirror-line::selection, .cm-s-light .CodeMirror-line > span::selection, .cm-s-light .CodeMirror-line > span > span::selection { background: #eee8d5; } -.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection, .cm-s-ligh .CodeMirror-line > span::-moz-selection, .cm-s-ligh .CodeMirror-line > span > span::-moz-selection { background: #eee8d5; } - -/* Editor styling */ - - - -/* Little shadow on the view-port of the buffer view */ -.cm-s-solarized.CodeMirror { - -moz-box-shadow: inset 7px 0 12px -6px #000; - -webkit-box-shadow: inset 7px 0 12px -6px #000; - box-shadow: inset 7px 0 12px -6px #000; -} - -/* Gutter border and some shadow from it */ -.cm-s-solarized .CodeMirror-gutters { - border-right: 1px solid; -} - -/* Gutter colors and line number styling based of color scheme (dark / light) */ - -/* Dark */ -.cm-s-solarized.cm-s-dark .CodeMirror-gutters { - background-color: #002b36; - border-color: #00232c; -} - -.cm-s-solarized.cm-s-dark .CodeMirror-linenumber { - text-shadow: #021014 0 -1px; -} - -/* Light */ -.cm-s-solarized.cm-s-light .CodeMirror-gutters { - background-color: #fdf6e3; - border-color: #eee8d5; -} - -/* Common */ -.cm-s-solarized .CodeMirror-linenumber { - color: #586e75; - padding: 0 5px; -} -.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; } -.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker { color: #ddd; } -.cm-s-solarized.cm-s-light .CodeMirror-guttermarker { color: #cb4b16; } - -.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text { - color: #586e75; -} - -.cm-s-solarized .CodeMirror-lines .CodeMirror-cursor { - border-left: 1px solid #819090; -} - -/* -Active line. Negative margin compensates left padding of the text in the -view-port -*/ -.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background { - background: rgba(255, 255, 255, 0.10); -} -.cm-s-solarized.cm-s-light .CodeMirror-activeline-background { - background: rgba(0, 0, 0, 0.10); -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/the-matrix.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/the-matrix.css deleted file mode 100644 index ec6046a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/the-matrix.css +++ /dev/null @@ -1,30 +0,0 @@ -.cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } -.cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } -.cm-s-the-matrix .CodeMirror-line::selection, .cm-s-the-matrix .CodeMirror-line > span::selection, .cm-s-the-matrix .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-the-matrix .CodeMirror-line::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span::-moz-selection, .cm-s-the-matrix .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } -.cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } -.cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } -.cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } -.cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; } - -.cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;} -.cm-s-the-matrix span.cm-atom {color: #3FF;} -.cm-s-the-matrix span.cm-number {color: #FFB94F;} -.cm-s-the-matrix span.cm-def {color: #99C;} -.cm-s-the-matrix span.cm-variable {color: #F6C;} -.cm-s-the-matrix span.cm-variable-2 {color: #C6F;} -.cm-s-the-matrix span.cm-variable-3 {color: #96F;} -.cm-s-the-matrix span.cm-property {color: #62FFA0;} -.cm-s-the-matrix span.cm-operator {color: #999} -.cm-s-the-matrix span.cm-comment {color: #CCCCCC;} -.cm-s-the-matrix span.cm-string {color: #39C;} -.cm-s-the-matrix span.cm-meta {color: #C9F;} -.cm-s-the-matrix span.cm-qualifier {color: #FFF700;} -.cm-s-the-matrix span.cm-builtin {color: #30a;} -.cm-s-the-matrix span.cm-bracket {color: #cc7;} -.cm-s-the-matrix span.cm-tag {color: #FFBD40;} -.cm-s-the-matrix span.cm-attribute {color: #FFF700;} -.cm-s-the-matrix span.cm-error {color: #FF0000;} - -.cm-s-the-matrix .CodeMirror-activeline-background {background: #040;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/tomorrow-night-bright.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/tomorrow-night-bright.css deleted file mode 100644 index decb82d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/tomorrow-night-bright.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - - Name: Tomorrow Night - Bright - Author: Chris Kempson - - Port done by Gerard Braad - -*/ - -.cm-s-tomorrow-night-bright.CodeMirror {background: #000000; color: #eaeaea;} -.cm-s-tomorrow-night-bright div.CodeMirror-selected {background: #424242 !important;} -.cm-s-tomorrow-night-bright .CodeMirror-gutters {background: #000000; border-right: 0px;} -.cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } -.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } -.cm-s-tomorrow-night-bright .CodeMirror-linenumber {color: #424242;} -.cm-s-tomorrow-night-bright .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} - -.cm-s-tomorrow-night-bright span.cm-comment {color: #d27b53;} -.cm-s-tomorrow-night-bright span.cm-atom {color: #a16a94;} -.cm-s-tomorrow-night-bright span.cm-number {color: #a16a94;} - -.cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute {color: #99cc99;} -.cm-s-tomorrow-night-bright span.cm-keyword {color: #d54e53;} -.cm-s-tomorrow-night-bright span.cm-string {color: #e7c547;} - -.cm-s-tomorrow-night-bright span.cm-variable {color: #b9ca4a;} -.cm-s-tomorrow-night-bright span.cm-variable-2 {color: #7aa6da;} -.cm-s-tomorrow-night-bright span.cm-def {color: #e78c45;} -.cm-s-tomorrow-night-bright span.cm-bracket {color: #eaeaea;} -.cm-s-tomorrow-night-bright span.cm-tag {color: #d54e53;} -.cm-s-tomorrow-night-bright span.cm-link {color: #a16a94;} -.cm-s-tomorrow-night-bright span.cm-error {background: #d54e53; color: #6A6A6A;} - -.cm-s-tomorrow-night-bright .CodeMirror-activeline-background {background: #2a2a2a !important;} -.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/tomorrow-night-eighties.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/tomorrow-night-eighties.css deleted file mode 100644 index a8ee8f5..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/tomorrow-night-eighties.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - - Name: Tomorrow Night - Eighties - Author: Chris Kempson - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} -.cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} -.cm-s-tomorrow-night-eighties .CodeMirror-line::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span::-moz-selection, .cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); } -.cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} -.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } -.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } -.cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;} -.cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} - -.cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;} -.cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;} -.cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;} - -.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;} -.cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;} -.cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;} - -.cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;} -.cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;} -.cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;} -.cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;} -.cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;} -.cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;} -.cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;} - -.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;} -.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ttcn.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ttcn.css deleted file mode 100644 index 9c2e9a6..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/ttcn.css +++ /dev/null @@ -1,65 +0,0 @@ -.cm-quote {color: #090;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} -.cm-header {color: #00f; font-weight: bold;} - -.cm-atom {color: #219;} -.cm-attribute {color: #00c;} -.cm-bracket {color: #997;} -.cm-comment {color: #333333;} -.cm-def {color: #00f;} -.cm-em {font-style: italic;} -.cm-error {color: #f00;} -.cm-hr {color: #999;} -.cm-invalidchar {color: #f00;} -.cm-keyword {font-weight:bold} -.cm-link {color: #00c; text-decoration: underline;} -.cm-meta {color: #555;} -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-qualifier {color: #555;} -.cm-strikethrough {text-decoration: line-through;} -.cm-string {color: #006400;} -.cm-string-2 {color: #f50;} -.cm-strong {font-weight: bold;} -.cm-tag {color: #170;} -.cm-variable {color: #8B2252;} -.cm-variable-2 {color: #05a;} -.cm-variable-3 {color: #085;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -/* ASN */ -.cm-s-ttcn .cm-accessTypes, -.cm-s-ttcn .cm-compareTypes {color: #27408B} -.cm-s-ttcn .cm-cmipVerbs {color: #8B2252} -.cm-s-ttcn .cm-modifier {color:#D2691E} -.cm-s-ttcn .cm-status {color:#8B4545} -.cm-s-ttcn .cm-storage {color:#A020F0} -.cm-s-ttcn .cm-tags {color:#006400} - -/* CFG */ -.cm-s-ttcn .cm-externalCommands {color: #8B4545; font-weight:bold} -.cm-s-ttcn .cm-fileNCtrlMaskOptions, -.cm-s-ttcn .cm-sectionTitle {color: #2E8B57; font-weight:bold} - -/* TTCN */ -.cm-s-ttcn .cm-booleanConsts, -.cm-s-ttcn .cm-otherConsts, -.cm-s-ttcn .cm-verdictConsts {color: #006400} -.cm-s-ttcn .cm-configOps, -.cm-s-ttcn .cm-functionOps, -.cm-s-ttcn .cm-portOps, -.cm-s-ttcn .cm-sutOps, -.cm-s-ttcn .cm-timerOps, -.cm-s-ttcn .cm-verdictOps {color: #0000FF} -.cm-s-ttcn .cm-preprocessor, -.cm-s-ttcn .cm-templateMatch, -.cm-s-ttcn .cm-ttcn3Macros {color: #27408B} -.cm-s-ttcn .cm-types {color: #A52A2A; font-weight:bold} -.cm-s-ttcn .cm-visibilityModifiers {font-weight:bold} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/twilight.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/twilight.css deleted file mode 100644 index 360d44a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/twilight.css +++ /dev/null @@ -1,32 +0,0 @@ -.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ -.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ -.cm-s-twilight .CodeMirror-line::selection, .cm-s-twilight .CodeMirror-line > span::selection, .cm-s-twilight .CodeMirror-line > span > span::selection { background: rgba(50, 50, 50, 0.99); } -.cm-s-twilight .CodeMirror-line::-moz-selection, .cm-s-twilight .CodeMirror-line > span::-moz-selection, .cm-s-twilight .CodeMirror-line > span > span::-moz-selection { background: rgba(50, 50, 50, 0.99); } - -.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } -.cm-s-twilight .CodeMirror-guttermarker { color: white; } -.cm-s-twilight .CodeMirror-guttermarker-subtle { color: #aaa; } -.cm-s-twilight .CodeMirror-linenumber { color: #aaa; } -.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/ -.cm-s-twilight .cm-atom { color: #FC0; } -.cm-s-twilight .cm-number { color: #ca7841; } /**/ -.cm-s-twilight .cm-def { color: #8DA6CE; } -.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/ -.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/ -.cm-s-twilight .cm-operator { color: #cda869; } /**/ -.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/ -.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/ -.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/ -.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/ -.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/ -.cm-s-twilight .cm-tag { color: #997643; } /**/ -.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/ -.cm-s-twilight .cm-header { color: #FF6400; } -.cm-s-twilight .cm-hr { color: #AEAEAE; } -.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/ -.cm-s-twilight .cm-error { border-bottom: 1px solid red; } - -.cm-s-twilight .CodeMirror-activeline-background {background: #27282E !important;} -.cm-s-twilight .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/vibrant-ink.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/vibrant-ink.css deleted file mode 100644 index 8d3e99d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/vibrant-ink.css +++ /dev/null @@ -1,34 +0,0 @@ -/* Taken from the popular Visual Studio Vibrant Ink Schema */ - -.cm-s-vibrant-ink.CodeMirror { background: black; color: white; } -.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } -.cm-s-vibrant-ink .CodeMirror-line::selection, .cm-s-vibrant-ink .CodeMirror-line > span::selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::selection { background: rgba(53, 73, 60, 0.99); } -.cm-s-vibrant-ink .CodeMirror-line::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span::-moz-selection, .cm-s-vibrant-ink .CodeMirror-line > span > span::-moz-selection { background: rgba(53, 73, 60, 0.99); } - -.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } -.cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; } -.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle { color: #d0d0d0; } -.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; } -.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-vibrant-ink .cm-keyword { color: #CC7832; } -.cm-s-vibrant-ink .cm-atom { color: #FC0; } -.cm-s-vibrant-ink .cm-number { color: #FFEE98; } -.cm-s-vibrant-ink .cm-def { color: #8DA6CE; } -.cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D } -.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D } -.cm-s-vibrant-ink .cm-operator { color: #888; } -.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } -.cm-s-vibrant-ink .cm-string { color: #A5C25C } -.cm-s-vibrant-ink .cm-string-2 { color: red } -.cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } -.cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } -.cm-s-vibrant-ink .cm-header { color: #FF6400; } -.cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } -.cm-s-vibrant-ink .cm-link { color: blue; } -.cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } - -.cm-s-vibrant-ink .CodeMirror-activeline-background {background: #27282E !important;} -.cm-s-vibrant-ink .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/xq-dark.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/xq-dark.css deleted file mode 100644 index 5cdfe8f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/xq-dark.css +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } -.cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; } -.cm-s-xq-dark .CodeMirror-line::selection, .cm-s-xq-dark .CodeMirror-line > span::selection, .cm-s-xq-dark .CodeMirror-line > span > span::selection { background: rgba(39, 0, 122, 0.99); } -.cm-s-xq-dark .CodeMirror-line::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span::-moz-selection, .cm-s-xq-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(39, 0, 122, 0.99); } -.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } -.cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; } -.cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; } -.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; } -.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; } - -.cm-s-xq-dark span.cm-keyword {color: #FFBD40;} -.cm-s-xq-dark span.cm-atom {color: #6C8CD5;} -.cm-s-xq-dark span.cm-number {color: #164;} -.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;} -.cm-s-xq-dark span.cm-variable {color: #FFF;} -.cm-s-xq-dark span.cm-variable-2 {color: #EEE;} -.cm-s-xq-dark span.cm-variable-3 {color: #DDD;} -.cm-s-xq-dark span.cm-property {} -.cm-s-xq-dark span.cm-operator {} -.cm-s-xq-dark span.cm-comment {color: gray;} -.cm-s-xq-dark span.cm-string {color: #9FEE00;} -.cm-s-xq-dark span.cm-meta {color: yellow;} -.cm-s-xq-dark span.cm-qualifier {color: #FFF700;} -.cm-s-xq-dark span.cm-builtin {color: #30a;} -.cm-s-xq-dark span.cm-bracket {color: #cc7;} -.cm-s-xq-dark span.cm-tag {color: #FFBD40;} -.cm-s-xq-dark span.cm-attribute {color: #FFF700;} -.cm-s-xq-dark span.cm-error {color: #f00;} - -.cm-s-xq-dark .CodeMirror-activeline-background {background: #27282E !important;} -.cm-s-xq-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/xq-light.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/xq-light.css deleted file mode 100644 index 20b5c79..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/xq-light.css +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright (C) 2011 by MarkLogic Corporation -Author: Mike Brevoort - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -.cm-s-xq-light span.cm-keyword {line-height: 1em; font-weight: bold; color: #5A5CAD; } -.cm-s-xq-light span.cm-atom {color: #6C8CD5;} -.cm-s-xq-light span.cm-number {color: #164;} -.cm-s-xq-light span.cm-def {text-decoration:underline;} -.cm-s-xq-light span.cm-variable {color: black; } -.cm-s-xq-light span.cm-variable-2 {color:black;} -.cm-s-xq-light span.cm-variable-3 {color: black; } -.cm-s-xq-light span.cm-property {} -.cm-s-xq-light span.cm-operator {} -.cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;} -.cm-s-xq-light span.cm-string {color: red;} -.cm-s-xq-light span.cm-meta {color: yellow;} -.cm-s-xq-light span.cm-qualifier {color: grey} -.cm-s-xq-light span.cm-builtin {color: #7EA656;} -.cm-s-xq-light span.cm-bracket {color: #cc7;} -.cm-s-xq-light span.cm-tag {color: #3F7F7F;} -.cm-s-xq-light span.cm-attribute {color: #7F007F;} -.cm-s-xq-light span.cm-error {color: #f00;} - -.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;} -.cm-s-xq-light .CodeMirror-matchingbracket {outline:1px solid grey;color:black !important;background:yellow;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/yeti.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/yeti.css deleted file mode 100644 index dce3258..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/yeti.css +++ /dev/null @@ -1,86 +0,0 @@ -/* - - Name: yeti - Author: Michael Kaminsky (http://github.com/mkaminsky11) - - Original yeti color scheme by Jesse Weed (https://github.com/jesseweed/yeti-syntax) - -*/ - - -.cm-s-yeti.CodeMirror { - background-color: #ECEAE8 !important; - color: #d1c9c0 !important; - border: none; -} - -.cm-s-yeti .CodeMirror-gutters{ - color: #adaba6; - background-color: #E5E1DB; - border: none; -} -.cm-s-yeti .CodeMirror-cursor { - border-left: solid thin #d1c9c0 !important; -} -.cm-s-yeti .CodeMirror-linenumber { - color: #adaba6; -} -.cm-s-yeti.CodeMirror-focused .CodeMirror-selected { - background: #DCD8D2; -} -.cm-s-yeti .CodeMirror-line::selection, .cm-s-yeti .CodeMirror-line > span::selection, .cm-s-yeti .CodeMirror-line > span > span::selection { - background: #DCD8D2; -} -.cm-s-yeti .CodeMirror-line::-moz-selection, .cm-s-yeti .CodeMirror-line > span::-moz-selection, .cm-s-yeti .CodeMirror-line > span > span::-moz-selection { - background: #DCD8D2; -} -.cm-s-yeti span.cm-comment { - color: #d4c8be; -} -.cm-s-yeti span.cm-string, .cm-s-yeti span.cm-string-2 { - color: #96c0d8; -} -.cm-s-yeti span.cm-number { - color: #a074c4; -} -.cm-s-yeti span.cm-variable { - color: #55b5db; -} -.cm-s-yeti span.cm-variable-2 { - color: #a074c4; -} -.cm-s-yeti span.cm-def { - color: #55b5db; -} -.cm-s-yeti span.cm-operator { - color: #9fb96e; -} -.cm-s-yeti span.cm-keyword { - color: #9fb96e; -} -.cm-s-yeti span.cm-atom { - color:##a074c4; -} -.cm-s-yeti span.cm-meta { - color: #96c0d8; -} -.cm-s-yeti span.cm-tag { - color: #96c0d8; -} -.cm-s-yeti span.cm-attribute { - color: #9fb96e; -} -.cm-s-yeti span.cm-qualifier { - color: #96c0d8; -} -.cm-s-yeti span.cm-property { - color: #a074c4; -} -.cm-s-yeti span.cm-builtin { - color: #a074c4; -} -.cm-s-yeti span.cm-variable-3 { - color: #96c0d8; -} -.cm-s-yeti .CodeMirror-activeline-background {background: #E7E4E0 !important;} -.cm-s-yeti .CodeMirror-matchingbracket { text-decoration: underline;} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/zenburn.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/zenburn.css deleted file mode 100644 index f817198..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/theme/zenburn.css +++ /dev/null @@ -1,37 +0,0 @@ -/** - * " - * Using Zenburn color palette from the Emacs Zenburn Theme - * https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el - * - * Also using parts of https://github.com/xavi/coderay-lighttable-theme - * " - * From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css - */ - -.cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; } -.cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; } -.cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white !important; } -.cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; } -.cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; } -.cm-s-zenburn span.cm-comment { color: #7f9f7f; } -.cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; } -.cm-s-zenburn span.cm-atom { color: #bfebbf; } -.cm-s-zenburn span.cm-def { color: #dcdccc; } -.cm-s-zenburn span.cm-variable { color: #dfaf8f; } -.cm-s-zenburn span.cm-variable-2 { color: #dcdccc; } -.cm-s-zenburn span.cm-string { color: #cc9393; } -.cm-s-zenburn span.cm-string-2 { color: #cc9393; } -.cm-s-zenburn span.cm-number { color: #dcdccc; } -.cm-s-zenburn span.cm-tag { color: #93e0e3; } -.cm-s-zenburn span.cm-property { color: #dfaf8f; } -.cm-s-zenburn span.cm-attribute { color: #dfaf8f; } -.cm-s-zenburn span.cm-qualifier { color: #7cb8bb; } -.cm-s-zenburn span.cm-meta { color: #f0dfaf; } -.cm-s-zenburn span.cm-header { color: #f0efd0; } -.cm-s-zenburn span.cm-operator { color: #f0efd0; } -.cm-s-zenburn span.CodeMirror-matchingbracket { box-sizing: border-box; background: transparent; border-bottom: 1px solid; } -.cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; } -.cm-s-zenburn .CodeMirror-activeline { background: #000000; } -.cm-s-zenburn .CodeMirror-activeline-background { background: #000000; } -.cm-s-zenburn .CodeMirror-selected { background: #545454; } -.cm-s-zenburn .CodeMirror-focused .CodeMirror-selected { background: #4f4f4f; } diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/icl_editor_addon_plugin.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/icl_editor_addon_plugin.js deleted file mode 100644 index f24c834..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/icl_editor_addon_plugin.js +++ /dev/null @@ -1,1157 +0,0 @@ -/** - * @version 1.2 - * @type {{}|WPV_Toolset} - * @revision: 25/09/2015 22:31 - */ -var WPV_Toolset = WPV_Toolset || {}; - -WPV_Toolset.activeUrlEditor = null; - -if ( typeof WPV_Toolset.CodeMirror_instance === "undefined" ) { - WPV_Toolset.CodeMirror_instance = []; -} - -if ( typeof WPV_Toolset.add_qt_editor_buttons !== 'function' ) { - WPV_Toolset.add_qt_editor_buttons = function( qt_instance, editor_instance ) { - QTags._buttonsInit(); - WPV_Toolset.CodeMirror_instance[qt_instance.id] = editor_instance; - - for ( var button_name in qt_instance.theButtons ) { - if ( qt_instance.theButtons.hasOwnProperty( button_name ) ) { - qt_instance.theButtons[button_name].old_callback = qt_instance.theButtons[button_name].callback; - if ( qt_instance.theButtons[button_name].id == 'img' ){ - qt_instance.theButtons[button_name].callback = function( element, canvas, ed ) { - var t = this, - id = jQuery( canvas ).attr( 'id' ), - selection = WPV_Toolset.CodeMirror_instance[id].getSelection(), - e = "http://", - g = prompt( quicktagsL10n.enterImageURL, e ), - f = prompt( quicktagsL10n.enterImageDescription, "" ); - t.tagStart = '' + f + ''; - selection = t.tagStart; - t.closeTag( element, ed ); - WPV_Toolset.CodeMirror_instance[id].replaceSelection( selection, 'end' ); - WPV_Toolset.CodeMirror_instance[id].focus(); - } - } - else if ( qt_instance.theButtons[button_name].id == 'wpv_conditional' ) { - qt_instance.theButtons[button_name].callback = function ( e, c, ed ) { - if ( typeof WPViews === "undefined" ) { - return; - } - if ( typeof WPViews.shortcodes_gui === "undefined" ) { - return; - } - WPV_Toolset.activeUrlEditor = ed; - var id = jQuery( c ).attr( 'id' ), - t = this; - window.wpcfActiveEditor = id; - WPV_Toolset.CodeMirror_instance[id].focus(); - selection = WPV_Toolset.CodeMirror_instance[id].getSelection(); - var current_editor_object = {}; - if ( selection ) { - //When texty selected - current_editor_object = {'e' : e, 'c' : c, 'ed' : ed, 't' : t, 'post_id' : '', 'close_tag' : true, 'codemirror' : id}; - WPViews.shortcodes_gui.wpv_insert_popup_conditional('wpv-conditional', icl_editor_localization_texts.wpv_insert_conditional_shortcode, {}, icl_editor_localization_texts.wpv_editor_callback_nonce, current_editor_object ); - } else if ( ed.openTags ) { - // if we have an open tag, see if it's ours - var ret = false, i = 0, t = this; - while ( i < ed.openTags.length ) { - ret = ed.openTags[i] == t.id ? i : false; - i ++; - } - if ( ret === false ) { - t.tagStart = ''; - t.tagEnd = false; - if ( ! ed.openTags ) { - ed.openTags = []; - } - ed.openTags.push(t.id); - e.value = '/' + e.value; - current_editor_object = {'e' : e, 'c' : c, 'ed' : ed, 't' : t, 'post_id' : '', 'close_tag' : false, 'codemirror' : id}; - WPViews.shortcodes_gui.wpv_insert_popup_conditional('wpv-conditional', icl_editor_localization_texts.wpv_insert_conditional_shortcode, {},icl_editor_localization_texts.wpv_editor_callback_nonce, current_editor_object ); - } else { - // close tag - ed.openTags.splice(ret, 1); - t.tagStart = '[/wpv-conditional]'; - e.value = t.display; - window.icl_editor.insert( t.tagStart ); - } - } else { - // last resort, no selection and no open tags - // so prompt for input and just open the tag - t.tagStart = ''; - t.tagEnd = false; - if ( ! ed.openTags ) { - ed.openTags = []; - } - ed.openTags.push(t.id); - e.value = '/' + e.value; - current_editor_object = {'e' : e, 'c' : c, 'ed' : ed, 't' : t, 'post_id' : '', 'close_tag' : false, 'codemirror' : id}; - WPViews.shortcodes_gui.wpv_insert_popup_conditional('wpv-conditional', icl_editor_localization_texts.wpv_insert_conditional_shortcode, {}, icl_editor_localization_texts.wpv_editor_callback_nonce, current_editor_object ); - } - } - } - else if ( qt_instance.theButtons[button_name].id == 'close' ) { - - } else if ( qt_instance.theButtons[button_name].id == 'link' ) { - var t = this; - qt_instance.theButtons[button_name].callback = function ( b, c, d, e ) { - WPV_Toolset.activeUrlEditor = c;var f,g=this;return"undefined"!=typeof wpLink?void wpLink.open(d.id):(e||(e="http://"),void(g.isOpen(d)===!1?(f=prompt(quicktagsL10n.enterURL,e),f&&(g.tagStart='',a.TagButton.prototype.callback.call(g,b,c,d))):a.TagButton.prototype.callback.call(g,b,c,d))) - }; - jQuery( '#wp-link-submit' ).off(); - jQuery( '#wp-link-submit' ).on( 'click', function( event ) { - event.preventDefault(); - if ( wpLink.isMCE() ) { - wpLink.mceUpdate(); - } else { - var id = jQuery( WPV_Toolset.activeUrlEditor ).attr('id'), - selection = WPV_Toolset.CodeMirror_instance[id].getSelection(), - inputs = {}, - attrs, text, title, html; - inputs.wrap = jQuery('#wp-link-wrap'); - inputs.backdrop = jQuery( '#wp-link-backdrop' ); - if ( jQuery( '#link-target-checkbox' ).length > 0 ) { - // Backwards compatibility - before WordPress 4.2 - inputs.text = jQuery( '#link-title-field' ); - attrs = wpLink.getAttrs(); - text = inputs.text.val(); - if ( ! attrs.href ) { - return; - } - // Build HTML - html = '/g, '>' ).replace( /"/g, '"' ); - html += ' title="' + title + '"'; - } - html += '>'; - html += text || selection; - html += ''; - t.tagStart = html; - selection = t.tagStart; - } else { - // WordPress 4.2+ - inputs.text = jQuery( '#wp-link-text' ); - attrs = wpLink.getAttrs(); - text = inputs.text.val(); - if ( ! attrs.href ) { - return; - } - // Build HTML - html = ' 0 ) { - if ( !t.tagEnd ) { - selection = selection + t.tagStart; - } else { - selection = t.tagStart + selection + t.tagEnd; - } - } else { - if ( !t.tagEnd ) { - selection = t.tagStart; - } else if ( t.isOpen( ed ) === false ) { - selection = t.tagStart; - t.openTag( element, ed ); - } else { - selection = t.tagEnd; - t.closeTag( element, ed ); - } - } - WPV_Toolset.CodeMirror_instance[id].replaceSelection(selection, 'end'); - WPV_Toolset.CodeMirror_instance[id].focus(); - } - } - } - } - } -} - -var iclEditorWidth = 550; -var iclEditorWidthMin = 195; -var iclEditorHeight = 420; -var iclEditorHeightMin = 195; -var iclCodemirror = new Array(); - -jQuery(document).ready(function(){ - /* - * Set active editor - * Important when switching between editor instances. - * - * Used on WP editor, Types WYSIWYG, Views Filter Meta HTML, - * Views Layout Meta HTML, CRED form. - */ - window.wpcfActiveEditor = 'content'; - jQuery('.wp-media-buttons a, .wpcf-wysiwyg .editor_addon_dropdown .item, .wpt-wysiwyg .editor_addon_dropdown .item, #postdivrich .editor_addon_dropdown .item, #js-visual-editor-codemirror .editor_addon_dropdown .item,#wpv_filter_meta_html_admin_edit .item, #wpv_layout_meta_html_admin_edit .item').on('click', function(){ - window.wpcfActiveEditor = jQuery(this).parents('.wpt-wysiwyg, .wpcf-wysiwyg, #postdivrich, #wpv_layout_meta_html_admin, #wpv_filter_meta_html_admin, #js-visual-editor-codemirror') - .find('textarea#content, textarea.wpcf-wysiwyg, textarea.wpt-wysiwyg, textarea#wpv_layout_meta_html_content, textarea#wpv_filter_meta_html_content, textarea#visual-editor-html-editor').attr('id'); - - /* - * - * TODO 1.3 Why we do not have saving cookie in common? - */ - // document.cookie = "wpcfActiveEditor="+window.wpcfActiveEditor+"; expires=Monday, 31-Dec-2020 23:59:59 GMT; path="+wpcf_cookiepath+"; domain="+wpcf_cookiedomain+";"; - }); - // CRED notifications V icon - set active editor - needed for notifications V icons - jQuery(document).on('click','input[id^="credmailsubject"]', function(){ - window.wpcfActiveEditor = jQuery(this).attr('id'); - }); - jQuery(document).on('click', 'div[id^="wp-credmailbody"] .editor_addon_dropdown img', function(){ - window.wpcfActiveEditor = jQuery(this).parents('div[id^="wp-credmailbody"]').find('textarea[id^="credmailbody"]').attr('id'); - }); - /* - * Handle the "Add Field" boxes - some layout changes. - */ - jQuery('.wpv_add_fields_button').on('click', function(e) { - - - // Set dropdown - var dropdown_list = jQuery('#add_field_popup .editor_addon_dropdown'); - - if (dropdown_list.css('visibility') == 'hidden') { - - /* - * Specific for 'Add Field' - * Make changes before setting popup - */ - jQuery('#add_field_popup .editor_addon_dropdown .vicon').css('display', 'none'); - jQuery('#add_field_popup').show(); - - // Place it above button - dropdown_list.css('margin', '-25px 0 0 -15px'); - dropdown_list.css('right', '0'); // needed for RTL - var pos = jQuery('.wpv_add_fields_button').position(); - dropdown_list.css('top', pos.top + jQuery('.wpv_add_fields_button').height() - iclEditorHeight + 'px'); - dropdown_list.css('left', pos.left + jQuery('.wpv_add_fields_button').width() + 'px'); - - // Toggle - icl_editor_popup(dropdown_list); - jQuery(dropdown_list).find('.search_field').focus(); - - } else { - dropdown_list.css('visibility', 'hidden'); - } - }); - - - /* - * - * This manages clicking on dropdown icon - */ - jQuery('#post').on('click', '.editor_addon_dropdown img', function(e){ - - // Set dropdown - var drop_down = jQuery(this).parent().find('.editor_addon_dropdown'); - - if (drop_down.css('visibility') == 'hidden') { - - // Hide top links if div too small - wpv_hide_top_groups(jQuery(this).parent()); - - // Popup - icl_editor_popup(drop_down); - jQuery(drop_down).find('.search_field').focus(); - - } else { - // Hide all - icl_editor_hide_popup(); - } - - - // Bind close on iFrame click (it's loaded now) - /* - * - * TODO Check and document this - * SRDJAN I do not understand this one... - */ - jQuery('#content_ifr').contents().bind('click', function(e) { - icl_editor_hide_popup(); - }); - - - // Bind Escape - jQuery(document).bind('keyup', function(e) { - if (e.keyCode == 27) { - icl_editor_hide_popup(); - jQuery(this).unbind(e); - } - }); - - - }); - - - /* - * - * This manages clicking on dropdown V icon on views edit screen - */ - jQuery(document).on('click', '.js-code-editor-toolbar-button-v-icon', function(e){ - - // find which text area we are inserting into - var code_editor = jQuery(this).parents('.code-editor'); - if (code_editor.length == 0) { - // Could be a content template - code_editor = jQuery(this).parents('.wpv-ct-inline-edit'); - } - var text_area_id = code_editor.find('textarea').attr('id'); - // Set the active editor so that Types shortcodes can be inserted. - window.wpcfActiveEditor = text_area_id; - - - // Set dropdown - var drop_down = jQuery(this).parent().find('.editor_addon_dropdown'); - - if ( drop_down.css('visibility') === 'hidden' ) { - - // Hide top links if div too small - wpv_hide_top_groups(jQuery(this).parent()); - - // Popup - icl_editor_popup(drop_down); - - jQuery(drop_down).find('.search_field').focus(); - - // Make sure the dialog fits on the screen when used in - // Layouts for the Post Content dialog - if (jQuery(drop_down).closest('#ddl-default-edit').length > 0) { - var dialog_bottom = jQuery(drop_down).offset().top + jQuery(drop_down).height(); - dialog_bottom -= jQuery(window).scrollTop(); - var window_height = jQuery(window).height(); - - if (dialog_bottom > window_height) { - var new_top = window_height - jQuery(drop_down).height() - 80; - if (new_top < 0) { - new_top = 0; - } - jQuery(drop_down).animate({top : new_top}, 200); - } - } - } - - // Bind close on iFrame click (it's loaded now) - /* - * - * TODO Check and document this - * SRDJAN I do not understand this one... - */ - jQuery('#content_ifr').contents().bind('click', function(e) { - icl_editor_hide_popup(); - }); - - - // Bind Escape - jQuery(document).bind('keyup', function(e) { - if (e.keyCode == 27) { - icl_editor_hide_popup(); - jQuery(this).unbind(e); - } - }); - - - }); - - /* - * - * This manages clicking on dropdown V icon - */ - jQuery(document).on('click', '.js-wpv-shortcode-post-icon-wpv-views', function(e){ - - // Set dropdown - var drop_down = jQuery(this).parent().find('.js-editor_addon_dropdown-wpv-views'); - if ( drop_down.css('visibility') === 'hidden' ) { - // Hide top links if div too small - wpv_hide_top_groups(jQuery(this).parent()); - // Popup - icl_editor_popup(drop_down); - - jQuery(drop_down).find('.search_field').focus(); - - } - - // Bind close on iFrame click (it's loaded now) - /* - * - * TODO Check and document this - * SRDJAN I do not understand this one... - */ - jQuery('#content_ifr').contents().bind('click', function(e) { - icl_editor_hide_popup(); - }); - - - // Bind Escape - jQuery(document).bind('keyup', function(e) { - if (e.keyCode == 27) { - icl_editor_hide_popup(); - jQuery(this).unbind(e); - } - }); - - - }); - - /* - * - * This manages clicking on dropdown T icon - */ - jQuery(document).on('click', '.js-wpv-shortcode-post-icon-types', function(e){ - // Set dropdown - // console.log('js-wpv-shortcode-post-icon-types'); - var drop_down = jQuery(this).parent().find('.js-editor_addon_dropdown-types'); - - if ( drop_down.css('visibility') === 'hidden' ) { - // Hide top links if div too small - wpv_hide_top_groups(jQuery(this).parent()); - // Popup - icl_editor_popup(drop_down); - - jQuery(drop_down).find('.search_field').focus(); - - } - - // Bind close on iFrame click (it's loaded now) - /* - * - * TODO Check and document this - * SRDJAN I do not understand this one... - */ - jQuery('#content_ifr').contents().bind('click', function(e) { - icl_editor_hide_popup(); - }); - - - // Bind Escape - jQuery(document).bind('keyup', function(e) { - if (e.keyCode == 27) { - icl_editor_hide_popup(); - jQuery(this).unbind(e); - } - }); - - - }); - - - /* - * - * - * Trigger close action - */ - jQuery(document).on('click', '.editor_addon_dropdown .item, .editor_addon_dropdown .close', function(e){ - icl_editor_hide_popup(); - }); - - /* - * - * Direct links - */ - - jQuery(document).on('click','.editor-addon-top-link', function() { - var scrollTargetDiv = jQuery(this).parents('.editor_addon_dropdown_content'); - var target = jQuery(this).closest('.editor_addon_dropdown_content').find('.'+jQuery(this).data('editor_addon_target')+'-target'); - var position = target.position(); - var scrollTo = position.top; - - // Do scroll. - scrollTargetDiv.animate({ - scrollTop:Math.round(scrollTo) - }, 'fast'); - - }); -}); - -/** - * - * Main popup function - */ -function icl_editor_popup(e) { - - // Toggle - icl_editor_toggle(e); - - // Set popup - //icl_editor_resize_popup(e); - - // @Srdjan. - // I have commented out the line above. I don't want the width and height to be calculated. - - // Bind window click to auto-hide - icl_editor_bind_auto_close(); -} - -// TODO Document this -jQuery.expr.filters.icl_offscreen = function(el) { - var t = jQuery(el).offset(); - return ( - (el.offsetLeft + el.offsetWidth) < 0 - || (el.offsetTop + el.offsetHeight) < 0 - || (el.offsetLeft > window.innerWidth || el.offsetTop > window.innerHeight) - ); -}; - -/** - * Toggles popups. - * - * @todo We have multiple calls here. - */ -function icl_editor_toggle(element) { - - // Hide all except current - // jQuery('.editor_addon_dropdown').each(function(){ - // if (element.attr('id') != jQuery(this).attr('id')) { - // jQuery(this).css('visibility', 'hidden') - // .css('display', 'inline'); - // } else { - // if (jQuery(this).css('visibility') == 'visible') { - // jQuery(this).css('visibility', 'hidden'); - // } else { - // jQuery(this).css('visibility', 'visible').css('display', 'inline'); - // } - // } - // }); - - var $popupContent = jQuery(element).find('.editor_addon_dropdown_content'); - var $directLinks = $popupContent.find('.direct-links, .direct-links-desc'); - $directLinks.hide(); - - // Hide All editors - jQuery('.editor_addon_dropdown').css({ - 'visibility': 'hidden' - //'display': 'inline' - }); - - // Show target editor - element.css({ - 'visibility': 'visible' - //'display': 'block' - }); - - if ( $popupContent.height() >= 400 ) { - $popupContent.find('.direct-links, .direct-links-desc').show(); - } - -} - -/** - * Resizing Toolset editor dropdowns. - * - * Mind there are multiple instances on same screen. - * @see .editor_addon_dropdown - */ -function icl_editor_resize_popup(element) { - - /* - * First hide elements that should not be taken into account - * Important: this is where we show shortuts in popup - */ - jQuery(element).find('.direct-links').hide(); - jQuery(element).find('.editor-addon-link-to-top').hide(); - - // Initial state - // If hidden will be 0 - var heightInitial = jQuery(element).height(); - - /* - * Resize - * - * We'll take main editor width - */ - var editorWidth = Math.round( jQuery('#post-body-content').width() + 20 ); - //Width for Views Edit Page - if ( editorWidth == 20 ){ - editorWidth = Math.round( jQuery('.CodeMirror').width() - 20 ); - } - var editorOffset = element.offset(); - var windowsize = jQuery(window).width(); - if ((editorWidth + editorOffset.left) > windowsize) { - editorWidth = windowsize - (editorOffset.left + 20); - } - icl_editor_resize_popup_width(element, editorWidth); - - /* - * Adjust size. - */ - if (heightInitial > iclEditorHeight) { - /* - * - * Important: this is where we show shortuts in popup - */ - jQuery(element).find('.direct-links').show(); - jQuery(element).find('.editor-addon-link-to-top').show(); - icl_editor_resize_popup_height(element, iclEditorHeight); - } - if (heightInitial < iclEditorHeightMin) { - icl_editor_resize_popup_height(element, iclEditorHeight); - } - - /* - * Set CSS - */ - jQuery(element).css('overflow', 'auto'); - jQuery(element).css('padding', '0px'); -} - -/** - * Sets element width. - */ -function icl_editor_resize_popup_width(element, width) { - jQuery(element).width(width).css('width', width + 'px'); -} - -/** - * Sets element height. - */ -function icl_editor_resize_popup_height(element, height) { - jQuery(element).height(height).css('height', height + 'px'); -} - - -var keyStr = "ABCDEFGHIJKLMNOP" + -"QRSTUVWXYZabcdef" + -"ghijklmnopqrstuv" + -"wxyz0123456789+/" + -"="; - -function editor_decode64(input) { - var output = ""; - var chr1, chr2, chr3 = ""; - var enc1, enc2, enc3, enc4 = ""; - var i = 0; - - // remove all characters that are not A-Z, a-z, 0-9, +, /, or = - var base64test = /[^A-Za-z0-9\+\/\=]/g; - if (base64test.exec(input)) { - alert("There were invalid base64 characters in the input text.\n" + - "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" + - "Expect errors in decoding."); - } - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - - do { - enc1 = keyStr.indexOf(input.charAt(i++)); - enc2 = keyStr.indexOf(input.charAt(i++)); - enc3 = keyStr.indexOf(input.charAt(i++)); - enc4 = keyStr.indexOf(input.charAt(i++)); - - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - - output = output + String.fromCharCode(chr1); - - if (enc3 != 64) { - output = output + String.fromCharCode(chr2); - } - if (enc4 != 64) { - output = output + String.fromCharCode(chr3); - } - - chr1 = chr2 = chr3 = ""; - enc1 = enc2 = enc3 = enc4 = ""; - - } while (i < input.length); - - return unescape(editor_utf8_decode(output)); -} - -function editor_utf8_decode(utftext) { - var string = ""; - var i = 0; - var c = c1 = c2 = 0; - - while ( i < utftext.length ) { - - c = utftext.charCodeAt(i); - - if (c < 128) { - string += String.fromCharCode(c); - i++; - } - else if((c > 191) && (c < 224)) { - c2 = utftext.charCodeAt(i+1); - string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - i += 2; - } - else { - c2 = utftext.charCodeAt(i+1); - c3 = utftext.charCodeAt(i+2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - i += 3; - } - - } - - return string; -} - -function insert_b64_shortcode_to_editor(b64_shortcode, text_area) { - var shortcode = editor_decode64(b64_shortcode); - if(shortcode.indexOf('[types') == 0 && shortcode.indexOf('[/types') === false) { - shortcode += '[/types]'; - } - window.wpcfActiveEditor = text_area; - - icl_editor.insert(shortcode); -} - -/** - * Filtering elements from search boxes with JS - */ -function wpv_on_search_filter(el) { - // get search text - var searchText = jQuery(el).val(); - searchText = searchText.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); - - // get parent on DOM to find items and hide/show Search - var parent = el.parentNode.parentNode; - var searchItems = jQuery(parent).find('.group .item'); - - jQuery(parent).find('.search_clear').css('display', (searchText == '') ? 'none' : 'inline'); - - // iterate items and search - jQuery(searchItems).each(function() { - if(searchText == '' || jQuery(this).text().search(new RegExp(searchText, 'i')) > -1) { - // alert(jQuery(this).text()); - jQuery(this).css('display', 'inline-block'); - } - else { - jQuery(this).css('display', 'none'); - } - }); - - // iterate group titles and check if they have items (otherwise hide them) - - wpv_hide_top_groups(parent); -} - -/** - * @TODO Document this - */ -function wpv_hide_top_groups(parent) { - var groupTitles = jQuery(parent).find('.group-title'); - jQuery(groupTitles).each(function() { - var parentOfGroup = jQuery(this).parent(); - // by default we assume that there are no children to show - var visibleGroup = false; - jQuery(parentOfGroup).find('.item').each(function() { - if(jQuery(this).css('display') === 'inline-block') { - visibleGroup = true; - return false; - } - }); - var id = jQuery(this).data('id'); - if(!visibleGroup) { - jQuery(this).hide(); - jQuery(this).closest('.group').hide(); - jQuery('.editor-addon-top-link[data-id="'+id+'"]').hide(); - } else { - jQuery(this).show(); - jQuery(this).closest('.group').show(); - jQuery('.editor-addon-top-link[data-id="'+id+'"]').show(); - } - }); -} - -// clear search input -function wpv_search_clear(el) { - var parent = el.parentNode.parentNode; - var searchbox = jQuery(parent).find('.search_field'); - searchbox.val(''); - wpv_on_search_filter(searchbox[0]); -} - -function icl_editor_hide_popup () { - jQuery('.editor_addon_dropdown').css({ - 'visibility': 'hidden' - }); - jQuery(document).off('click.icl_editor'); -} - -/** - * Bind window click to auto-hide - * - * This should be generic close. - * It's used in few places - */ -function icl_editor_bind_auto_close() { - /* - * jQuery executes 'bind' immediatelly on click - */ - - jQuery(document).on('click.icl_editor',function(e){ - - var dropdownAddField = jQuery('#add_field_popup .editor_addon_dropdown'); - - // Exception for 'Add field' button - var $target = jQuery(e.target); - - // if we click anything but Toolset buttons - if ( ( $target.closest('.wpv_add_fields_button,' + - '.js-code-editor-toolbar-button-v-icon,' + - '.js-code-editor-toolbar-button-v-icon,' + - '.js-wpv-shortcode-post-icon-wpv-views,' + - '.js-wpv-shortcode-post-icon-types,' + - '.js-wpcf-access-editor-button').length === 0) ) { - - // if we click outside the popup - if ( $target.parents('.editor_addon_dropdown').length === 0 ) { - - // Hide all - jQuery('.editor_addon_dropdown').css({ - 'visibility': 'hidden' - //'display': 'inline' - }); - - // Unbind Add field dropdown - dropdownAddField.removeClass('icl_editor_click_binded'); - - jQuery(this).unbind(e); - } - - } - - }); -} - - -/** - * - * Inserts content into active editor. - */ -var icl_editor = (function(window, $){ - - function isTinyMce($textarea) - { - var editor, ed=$textarea.attr('id'); - if (ed && ed.charAt(0)=='#') ed=ed.substring(1); - - // if tinyMCE - if ( - window.tinyMCE && ed && - null != (editor=window.tinyMCE.get(ed)) && - false == editor.isHidden() - ) - return editor; - return false; - }; - - function codeMirrorCursorIsWithin( area, tStart, tEnd ) - { - var codemirror = isCodeMirror(area); - - if( !codemirror ) - { - return false; - } - //let's scope it to our own instance do not bother window - this.wpcfActiveEditor = area; - - var current_cursor = codemirror.getCursor(true) - , text_before = codemirror.getRange({line:0,ch:0}, current_cursor) - , text_after = codemirror.getRange(current_cursor, {line:codemirror.lastLine(),ch:null}) - , regexStart - , regexEnd - , tagStart = tStart ? tStart : '' - , tagEnd = tEnd ? tEnd : ''; - - try - { - regexStart = new RegExp("\\["+tagStart+".*?\]"); - regexEnd = new RegExp('\\['+tagEnd+'.*?\]'); - - // console.log( text_before.match(regexStart), text_after.match(regexEnd) ); - - return text_before.search(regexStart) != -1 && text_after.search(regexEnd) != -1; - } - catch( e ) - { - console.log( "There are problems with your RegExp.", e.message ); - } - - return false; - }; - - function isCodeMirror($textarea) - { - if ( ! $textarea.is('textarea') ) { - return false; - } - var textareaNext = $textarea[0].nextSibling; - if ( typeof textareaNext === 'undefined' ) { - return false; - } - if ( textareaNext ) { - //Usual way before WordPress 4.1 - if ( - textareaNext.CodeMirror - && $textarea[0] == textareaNext.CodeMirror.getTextArea() - ) { - return textareaNext.CodeMirror; - } - // Juan: CodeMirror panels wrap the CodeMirror div and themselves into a div. - // Depending on the panels position, the CodeMirror div becomes the first or last child of that wrapper. - // We need to check if the relevant node contains the right CodeMirror div as a child node. - // Note that we will do the same below, so we can have CodeMirror panels in main editors too. - var textareaNextHasPanels = isCodeMirrorWithPanels( $textarea, textareaNext ); - if ( textareaNextHasPanels ) { - return textareaNextHasPanels; - } - // Emerson: WordPress 4.0+ introduces 'content-textarea-clone' div which in some instances is loaded after our textarea and before the CodeMirror div. - // This core feature in WP is used in their auto-resize editor and distraction free writing. - // This is particularly found in pages and post affecting syntax highlighting in main editors. - // Let's skip that node and check if the nextsibling is really the CodeMirror div. - var textareaNextNext = textareaNext.nextSibling; - if ( textareaNextNext ) { - if ( - textareaNextNext.CodeMirror - && $textarea[0] == textareaNextNext.CodeMirror.getTextArea() - ) { - return textareaNextNext.CodeMirror; - } - var textareaNextNextHasPanels = isCodeMirrorWithPanels( $textarea, textareaNextNext ); - if ( textareaNextNextHasPanels ) { - return textareaNextNextHasPanels; - } - } - } - return false; - }; - - function isCodeMirrorWithPanels( $textarea, candidateNode ) { - if ( ! $textarea.is('textarea') ) { - return false; - } - if ( typeof candidateNode === 'undefined' ) { - return false; - } - if ( candidateNode ) { - var candidateNodeFirstChild = candidateNode.firstChild, - candidateNodeLastChiild = candidateNode.lastChild; - if ( - candidateNodeFirstChild - && candidateNodeFirstChild.CodeMirror - && $textarea[0] == candidateNodeFirstChild.CodeMirror.getTextArea() - ) { - return candidateNodeFirstChild.CodeMirror; - } else if ( - candidateNodeLastChiild - && candidateNodeLastChiild.CodeMirror - && $textarea[0] == candidateNodeLastChiild.CodeMirror.getTextArea() - ) { - return candidateNodeLastChiild.CodeMirror; - } - } - return false; - } - - function getContent($area) - { - if (!$area) $area=$('#content'); - //var tinymce=aux.isTinyMce($area); - var codemirror=isCodeMirror($area); - if (codemirror) - return codemirror.getValue(); - return $area.val(); - }; - - function InsertAtCursor(myField, myValue1, myValue2) - { - var $myField=myField; - var tinymce=isTinyMce($myField); - var codemirror=isCodeMirror($myField); - //EMERSON: Check code mirror first before tinymce - //because tinymce instance would still exist even if code mirror is activated - - // if codemirror - if (codemirror) - { - // alert('codemirror'); - codemirror.focus(); - - if (!codemirror.somethingSelected()) - { - // set at current cursor - var current_cursor=codemirror.getCursor(true); - codemirror.setSelection(current_cursor, current_cursor); - } - if (typeof(myValue2)!='undefined' && myValue2) { // wrap - codemirror.replaceSelection(myValue1 + codemirror.getSelection() + myValue2, 'end'); - } else { - codemirror.replaceSelection(myValue1, 'end'); - } - - } - // else if tinymce - else if (tinymce) - { - // alert('tinymce'); - tinymce.focus(); - if (typeof(myValue2)!='undefined' && myValue2) // wrap - tinymce.execCommand("mceReplaceContent",false, myValue1 + tinymce.selection.getContent({ - format : 'raw' - }) + myValue2); - else - tinymce.execCommand("mceInsertContent",false, myValue1); - } - // else other text fields - else - { - // alert('other'); - myField=$myField[0]; //$(myField)[0]; - myField.focus(); - if (document.selection) - { - sel = document.selection.createRange(); - if (typeof(myValue2)!='undefined' && myValue2) // wrap - sel.text = myValue1 + sel.text + myValue2; - else - sel.text = myValue1; - } - else if ((myField.selectionStart != null) && (myField.selectionStart != undefined)/* == 0 || myField.selectionStart == '0'*/) - { - var startPos = parseInt(myField.selectionStart); - var endPos = parseInt(myField.selectionEnd); - var correctedPos = endPos; - if (typeof(myValue2)!='undefined' && myValue2) // wrap - { - var sel = myField.value.substring(startPos, endPos); - myField.value = myField.value.substring(0, startPos) + myValue1 + sel + myValue2 + - myField.value.substring(endPos, myField.value.length); - correctedPos += myValue1.length + sel.length + myValue2.length; - myField.setSelectionRange(correctedPos, correctedPos); - } - else { - myField.value = myField.value.substring(0, startPos) + myValue1 + myField.value.substring(endPos, myField.value.length); - correctedPos += myValue1.length; - myField.setSelectionRange(correctedPos, correctedPos); - } - } - else - { - if (typeof(myValue2)!='undefined' && myValue2) // wrap - myField.value += myValue1 + myValue2; - else - myField.value += myValue1; - } - } - // $myField.trigger('paste'); - }; - - function insertContent(content) - { - // alert(window.wpcfActiveEditor); - InsertAtCursor($('#'+window.wpcfActiveEditor), content); - } - - /** - * Toggles Codemirror on textarea (#ID, toggle). - * - * We could record mouse position on Codemirror to restore it. - */ - function toggleCodeMirror(textarea, on, mode) - { - mode = (typeof mode === "undefined") ? "myshortcodes" : mode; - // if codemirror activated, enable syntax highlight - if (window.CodeMirror) - { - if (!on && window.iclCodemirror[textarea]) - { - window.iclCodemirror[textarea].toTextArea(); - window.iclCodemirror[textarea] = false; - jQuery('#'+textarea).focus(); - return !on; - } - else if (on && !window.iclCodemirror[textarea]) - { -// CodeMirror.defineMode("myshortcodes", codemirror_shortcodes_overlay); - - var $_metabox=$('#'+textarea).closest('.postbox'), - _metabox_closed=false, - _metabox_display=false; - - if ($_metabox.hasClass('closed') || 'none'==$_metabox.css('display')) - { - _metabox_closed=true; - $_metabox.removeClass('closed'); - } - if ('none'==$_metabox.css('display')) - { - _metabox_display='none'; - $_metabox.css('display','block'); - } - window.iclCodemirror[textarea] = CodeMirror.fromTextArea(document.getElementById(textarea), { - mode: mode, - tabMode: "indent", - lineWrapping: true, - lineNumbers : true - // autofocus: true // test that this breaks nothing - }); - - // TODO is resizing needed? - // needed for scrolling -// var height=Math.min(5000, Math.max(50, 200)); -// $('#'+textarea).css('resize', 'none').height( height + 'px' ); -// window.iclCodemirror[textarea].setSize( $('#'+textarea).width(), height ); - - if ('none'==_metabox_display) - { - $_metabox.css('display','none'); - } - if (_metabox_closed) - { - $_metabox.addClass('closed'); - } - - jQuery('#'+textarea).focus(); - - return window.iclCodemirror[textarea]; - } - } - return false; - }; - - return { - isTinyMce : isTinyMce, - isCodeMirror : isCodeMirror, - getContent : getContent, - InsertAtCursor : InsertAtCursor, - toggleCodeMirror : toggleCodeMirror, - cursorWithin : codeMirrorCursorIsWithin, - insert : function(text) { - insertContent(text); - }, - codemirror : function(textarea, on, mode) { - mode = (typeof mode === "undefined") ? "myshortcodes" : mode; - return toggleCodeMirror(textarea, on, mode); - }, - codemirrorGet : function(textarea) { - return window.iclCodemirror[textarea]; - } - }; - - -})(window, jQuery, undefined); diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/icl_media_manager.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/icl_media_manager.js deleted file mode 100644 index 7839471..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/icl_media_manager.js +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @version 1.2 - * @type {{}|WPV_Toolset|{}|WPV_Toolset} - * @revision 25/09/2015 22:31 - */ -var WPV_Toolset = WPV_Toolset || {}; -WPV_Toolset.media_manager = WPV_Toolset.media_manager || {}; -WPV_Toolset.media_manager.set_to_post_id = 0; -WPV_Toolset.media_manager.current_plugin = ''; -WPV_Toolset.media_manager.instances = {}; - -if ( typeof WPV_Toolset.only_img_src_allowed_here === "undefined" ) { - /* - * WPV_Toolset.only_img_src_allowed_here - * - * This array holds IDs for textfields where you can insert media URLs using this media manager - * Note that they can only hold image URLs, not img tags or shortcodes - * To extend it, make your script dependant in this 'icl_media-manager-js' so this is loaded early - * Then, push to this array - * - * @todo Move the already existing IDs to the Views scripts - */ - WPV_Toolset.only_img_src_allowed_here = [ - 'wpv-pagination-spinner-image', - 'wpv-archive-pagination-uploaded-spinner-image', - 'wpv-dps-spinner-image', - 'wpv_filter_meta_html_css', - 'wpv_filter_meta_html_js', - 'wpv_layout_meta_html_css', - 'wpv_layout_meta_html_js' - ]; -} - -jQuery( document ).ready( function( $ ) { - if ( $( '#toolset-edit-data' ).length > 0 ) { - WPV_Toolset.media_manager.set_to_post_id = $( '#toolset-edit-data' ).val(); - WPV_Toolset.media_manager.current_plugin = $( '#toolset-edit-data' ).data( 'plugin' ); - } -}); - -/** - * Thanks to Thomas Griffin for his super useful example on Github - * - * https://github.com/thomasgriffin/New-Media-Image-Uploader - */ -jQuery( document ).ready( function( $ ) { - - $( document.body ).on( 'click', '.js-wpv-media-manager', function( e ) { - // Prevent the default action from occuring. - e.preventDefault(); - // Check whether we need to set the parent post ID value - var set_to_post_id = WPV_Toolset.media_manager.set_to_post_id, - referred_id = $( this ).attr( 'data-id' ); - if ( - typeof referred_id !== 'undefined' - && referred_id !== false - ) { - set_to_post_id = referred_id; - } - // Set the active target by its content data attribute value - var active_textarea = $( this ).data( 'content' ); - window.wpcfActiveEditor = active_textarea; - // Make sure the post parent ID is an integer, force zero otherwise - set_to_post_id = parseInt( set_to_post_id ) || 0; - // If the frame already exists, re-open it. - if ( WPV_Toolset.media_manager.instances[ set_to_post_id ] ) { - WPV_Toolset.media_manager.instances[ set_to_post_id ].open(); - return; - } else { - // Otherwise, set the model post ID and create the frame - //if ( set_to_post_id !== 0 ) { - wp.media.model.settings.post.id = set_to_post_id; - //} else { - //wp.media.model.settings.post.id = 0; - //} - } - - WPV_Toolset.media_manager.instances[ set_to_post_id ] = wp.media({ - //Create our media frame - className: 'media-frame mojo-media-frame js-wpv-media-frame', - frame: 'post', - multiple: false, //Disallow Mulitple selections - library: { - type: 'image' //Only allow images - } - }); - - WPV_Toolset.media_manager.instances[ set_to_post_id ].on('open', function(event){ - var media_button_insert = $('.media-button-insert'), - media_frame = $('.js-wpv-media-frame'); - $('li.selected').removeClass('selected').find('a.check').trigger('click'); - media_button_insert.addClass('button-secondary').removeClass('button-primary'); - media_frame.find('.media-menu').html(''); - $('.clear-selection').on('click', function() { - media_button_insert.parent().find('.js-wpv-media-type-not-insertable').remove(); - media_button_insert.addClass('button-secondary').removeClass('button-primary').show(); - }); - }); - - WPV_Toolset.media_manager.instances[ set_to_post_id ].on('insert', function(){ - // Watch changes in wp-includes/js/media-editor.js - var media_attachment = WPV_Toolset.media_manager.instances[ set_to_post_id ].state().get('selection').first().toJSON(), - filetype = media_attachment.type; - if ( filetype == 'image' ) { - var size = $('.attachment-display-settings .size').val(),// WARNING size might be undefined for some image types, like BMP or TIFF, that do not generate thumbnails - shortcode, - code, - options, - classes, - align, - target_url; - if ( $.inArray( window.wpcfActiveEditor, WPV_Toolset.only_img_src_allowed_here ) !== -1 ) { - if ( size ) { - code = media_attachment.sizes[size].url; - } else { - code = media_attachment.url; - } - $('.js-' + window.wpcfActiveEditor).val(''); - $('.js-' + window.wpcfActiveEditor + '-preview').attr("src",code).show(); - } else { - // Basic img tag options - if ( size ) { - options = { - tag:'img', - attrs: { - src: media_attachment.sizes[size].url - }, - single: true - }; - } else { - options = { - tag:'img', - attrs: { - src: media_attachment.url - }, - single: true - }; - } - if ( media_attachment.hasOwnProperty( 'alt' ) && media_attachment.alt ) { - options.attrs.alt = media_attachment.alt; - } - if ( size ) { - options.attrs.width = media_attachment.sizes[size].width; - options.attrs.height = media_attachment.sizes[size].height; - } else { - options.attrs.width = 1; - } - classes = []; - align = $('.alignment').val(); - if ( align == 'none' ) { - align = false; - } - // Only assign the align class to the image if we're not printing a caption, since the alignment is sent to the shortcode. - if ( align && ! media_attachment.caption ) { - classes.push( 'align' + align ); - } - if ( size ) { - classes.push( 'size-' + size ); - } - options.attrs['class'] = _.compact( classes ).join(' '); - // Generate the `a` element options, if they exist. - if ( $('select.link-to').val() == 'file' ) { - target_url = media_attachment.url; - } else if ( $('select.link-to').val() == 'custom' ) { - target_url = $('.link-to-custom').val(); - } else { - target_url = false; - } - if ( target_url ) { - options = { - tag: 'a', - attrs: { - href: target_url - }, - content: options - }; - } - code = wp.html.string( options ); - // Generate the caption shortcode if needed - if ( media_attachment.caption ) { - shortcode = {}; - if (size ) { - if ( media_attachment.sizes[size].width ) { - shortcode.width = media_attachment.sizes[size].width; - } - } else { - shortcode.width = 1; - } - if ( align ) { - shortcode.align = 'align' + align; - } - code = wp.shortcode.string({ - tag: 'caption', - attrs: shortcode, - content: code + ' ' + media_attachment.caption - }); - } - } - icl_editor.insert(code); - if ( $.inArray( window.wpcfActiveEditor, WPV_Toolset.only_img_src_allowed_here ) !== -1 ) { - $('.js-' + window.wpcfActiveEditor).trigger('keyup'); - } - } else { - var options, - media_shrtcode = ''; - if ( $('select.link-to').val() == 'embed' ) { - options = { - tag: filetype, - attrs: { - src: media_attachment.url - }, - type: true, - content: '' - }; - if ( media_attachment.hasOwnProperty( 'caption' ) && media_attachment.caption ) { - options.attrs.caption = media_attachment.caption; - } - media_shrtcode = wp.shortcode.string( options ); - } else { - options = { - tag: 'a', - attrs: { - href: media_attachment.url - }, - content: media_attachment.title - }; - media_shrtcode = wp.html.string( options ); - /* - media_shrtcode = '' + media_attachment.title + ''; - */ - } - icl_editor.insert(media_shrtcode); - } - $(' #' + window.wpcfActiveEditor ).trigger( 'js_icl_media_manager_inserted' ); - }); - - var _AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay; - wp.media.view.Settings.AttachmentDisplay = _AttachmentDisplay.extend({ - render: function() { - _AttachmentDisplay.prototype.render.apply(this, arguments); - var attachment = this.options.attachment, - attach_type = '', - insert_button = $('.media-button-insert').show(); - insert_button.parent().find('.js-wpv-media-type-not-insertable').remove(); - if ( attachment ) { - attach_type = attachment.get('type'); - } - if ( attach_type == 'image' && $.inArray( window.wpcfActiveEditor, WPV_Toolset.only_img_src_allowed_here ) !== -1 ) { - this.$el.find('select.link-to').parent().remove(); - this.model.set('link', 'none'); - this.$el.find('select.alignment').parent().remove(); - } else { - this.$el.find('select.link-to').find('option[value="post"]').remove(); - if ( $.inArray( window.wpcfActiveEditor, WPV_Toolset.only_img_src_allowed_here ) !== -1 ) { - insert_button.hide().parent().append(''); - } - } - this.updateLinkTo(); - } - }); - - // Now that everything has been set, let's open up the frame. - WPV_Toolset.media_manager.instances[ set_to_post_id ].open(); - }); -}); - - -jQuery(document).on("DOMNodeInserted", function(){ - var toolset_edit_plugin = jQuery( '#toolset-edit-data' ).data( 'plugin' ); - if ( toolset_edit_plugin === 'views' ){ - // Lock uploads to "Uploaded to this post" - jQuery('select.attachment-filters [value="uploaded"]').prop( 'selected', true ).parent().trigger('change'); - jQuery('.attachments-browser .media-toolbar-secondary .attachment-filters').addClass('hidden'); - } -}); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/mousewheel.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/mousewheel.js deleted file mode 100644 index b793241..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/mousewheel.js +++ /dev/null @@ -1,78 +0,0 @@ -/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) - * Licensed under the MIT License (LICENSE.txt). - * - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * Thanks to: Seamus Leahy for adding deltaX and deltaY - * - * Version: 3.0.4 - * - * Requires: 1.2.2+ - */ - -(function($) { - -var types = ['DOMMouseScroll', 'mousewheel']; - -$.event.special.mousewheel = { - setup: function() { - if ( this.addEventListener ) { - for ( var i=types.length; i; ) { - this.addEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = handler; - } - }, - - teardown: function() { - if ( this.removeEventListener ) { - for ( var i=types.length; i; ) { - this.removeEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = null; - } - } -}; - -$.fn.extend({ - mousewheel: function(fn) { - return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); - }, - - unmousewheel: function(fn) { - return this.unbind("mousewheel", fn); - } -}); - - -function handler(event) { - var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; - event = $.event.fix(orgEvent); - event.type = "mousewheel"; - - // Old school scrollwheel delta - if ( event.wheelDelta ) { delta = event.wheelDelta/120; } - if ( event.detail ) { delta = -event.detail/3; } - - // New school multidimensional scroll (touchpads) deltas - deltaY = delta; - - // Gecko - if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { - deltaY = 0; - deltaX = -1*delta; - } - - // Webkit - if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } - if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } - - // Add event and delta to the front of the arguments - args.unshift(event, delta, deltaX, deltaY); - - return $.event.handle.apply(this, args); -} - -})(jQuery); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/scrollbar.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/scrollbar.js deleted file mode 100644 index 3ec540f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/scrollbar.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * jScrollPane - v2.0.0beta11 - 2011-07-04 - * http://jscrollpane.kelvinluck.com/ - * - * Copyright (c) 2010 Kelvin Luck - * Dual licensed under the MIT and GPL licenses. - */ -(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var az,Q=this,Y,ak,v,am,T,Z,y,q,aA,aF,av,i,I,h,j,aa,U,aq,X,t,A,ar,af,an,G,l,au,ay,x,aw,aI,f,L,aj=true,P=true,aH=false,k=false,ap=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aI=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function at(aR){var aM,aO,aN,aK,aJ,aQ,aP=false,aL=false;az=aR;if(Y===c){aJ=D.scrollTop();aQ=D.scrollLeft();D.css({overflow:"hidden",padding:0});ak=D.innerWidth()+f;v=D.innerHeight();D.width(ak);Y=b('
                ').css("padding",aI).append(D.children());am=b('
                ').css({width:ak+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aP=az.stickToBottom&&K();aL=az.stickToRight&&B();aK=D.innerWidth()+f!=ak||D.outerHeight()!=v;if(aK){ak=D.innerWidth()+f;v=D.innerHeight();am.css({width:ak+"px",height:v+"px"})}if(!aK&&L==T&&Y.outerHeight()==Z){D.width(ak);return}L=T;Y.css("width","");D.width(ak);am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aR.contentWidth){T=aR.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/ak;q=Z/v;aA=q>1;aF=y>1;if(!(aF||aA)){D.removeClass("jspScrollable");Y.css({top:0,width:am.width()-f});n();E();R();w();ai()}else{D.addClass("jspScrollable");aM=az.maintainPosition&&(I||aa);if(aM){aO=aD();aN=aB()}aG();z();F();if(aM){N(aL?(T-ak):aO,false);M(aP?(Z-v):aN,false)}J();ag();ao();if(az.enableKeyboardNavigation){S()}if(az.clickOnTrack){p()}C();if(az.hijackInternalLinks){m()}}if(az.autoReinitialise&&!aw){aw=setInterval(function(){at(az)},az.autoReinitialiseDelay)}else{if(!az.autoReinitialise&&aw){clearInterval(aw)}}aJ&&D.scrollTop(0)&&M(aJ,false);aQ&&D.scrollLeft(0)&&N(aQ,false);D.trigger("jsp-initialised",[aF||aA])}function aG(){if(aA){am.append(b('
                ').append(b('
                '),b('
                ').append(b('
                ').append(b('
                '),b('
                '))),b('
                ')));U=am.find(">.jspVerticalBar");aq=U.find(">.jspTrack");av=aq.find(">.jspDrag");if(az.showArrows){ar=b('').bind("mousedown.jsp",aE(0,-1)).bind("click.jsp",aC);af=b('').bind("mousedown.jsp",aE(0,1)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ar.bind("mouseover.jsp",aE(0,-1,ar));af.bind("mouseover.jsp",aE(0,1,af))}al(aq,az.verticalArrowPositions,ar,af)}t=v;am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});av.hover(function(){av.addClass("jspHover")},function(){av.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);av.addClass("jspActive");var s=aJ.pageY-av.position().top;b("html").bind("mousemove.jsp",function(aK){V(aK.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});o()}}function o(){aq.height(t+"px");I=0;X=az.verticalGutter+aq.outerWidth();Y.width(ak-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aF){am.append(b('
                ').append(b('
                '),b('
                ').append(b('
                ').append(b('
                '),b('
                '))),b('
                ')));an=am.find(">.jspHorizontalBar");G=an.find(">.jspTrack");h=G.find(">.jspDrag");if(az.showArrows){ay=b('').bind("mousedown.jsp",aE(-1,0)).bind("click.jsp",aC);x=b('').bind("mousedown.jsp",aE(1,0)).bind("click.jsp",aC); -if(az.arrowScrollOnHover){ay.bind("mouseover.jsp",aE(-1,0,ay));x.bind("mouseover.jsp",aE(1,0,x))}al(G,az.horizontalArrowPositions,ay,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);h.addClass("jspActive");var s=aJ.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aK){W(aK.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});l=am.innerWidth();ah()}}function ah(){am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aF&&aA){var aJ=G.outerHeight(),s=aq.outerWidth();t-=aJ;b(an).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ak-=aJ;G.parent().append(b('
                ').css("width",aJ+"px"));o();ah()}if(aF){Y.width((am.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aF){au=Math.ceil(1/y*l);if(au>az.horizontalDragMaxWidth){au=az.horizontalDragMaxWidth}else{if(auaz.verticalDragMaxHeight){A=az.verticalDragMaxHeight}else{if(AaT){Q.scrollByY(-aQ)}else{V(aT)}}else{if(aN>0){if(I+aRaT){Q.scrollByX(-aQ)}else{W(aT)}}else{if(aN>0){if(aa+aRi){s=i}}if(aJ===c){aJ=az.animateScroll}if(aJ){Q.animate(av,"top",s,ad)}else{av.css("top",s);ad(s)}}function ad(aJ){if(aJ===c){aJ=av.position().top}am.scrollTop(0);I=aJ;var aM=I===0,aK=I==i,aL=aJ/i,s=-aL*(Z-v);if(aj!=aM||aH!=aK){aj=aM;aH=aK;D.trigger("jsp-arrow-change",[aj,aH,P,k])}u(aM,aK);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aM,aK]).trigger("scroll")}function W(aJ,s){if(!aF){return}if(aJ<0){aJ=0}else{if(aJ>j){aJ=j}}if(s===c){s=az.animateScroll}if(s){Q.animate(h,"left",aJ,ae) -}else{h.css("left",aJ);ae(aJ)}}function ae(aJ){if(aJ===c){aJ=h.position().left}am.scrollTop(0);aa=aJ;var aM=aa===0,aL=aa==j,aK=aJ/j,s=-aK*(T-ak);if(P!=aM||k!=aL){P=aM;k=aL;D.trigger("jsp-arrow-change",[aj,aH,P,k])}r(aM,aL);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aM,aL]).trigger("scroll")}function u(aJ,s){if(az.showArrows){ar[aJ?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aJ,s){if(az.showArrows){ay[aJ?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aJ){var aK=s/(Z-v);V(aK*i,aJ)}function N(aJ,s){var aK=aJ/(T-ak);W(aK*j,s)}function ab(aW,aR,aK){var aO,aL,aM,s=0,aV=0,aJ,aQ,aP,aT,aS,aU;try{aO=b(aW)}catch(aN){return}aL=aO.outerHeight();aM=aO.outerWidth();am.scrollTop(0);am.scrollLeft(0);while(!aO.is(".jspPane")){s+=aO.position().top;aV+=aO.position().left;aO=aO.offsetParent();if(/^body|html$/i.test(aO[0].nodeName)){return}}aJ=aB();aP=aJ+v;if(saP){aS=s-v+aL+az.verticalGutter}}if(aS){M(aS,aK)}aQ=aD();aT=aQ+ak;if(aVaT){aU=aV-ak+aM+az.horizontalGutter}}if(aU){N(aU,aK)}}function aD(){return -Y.position().left}function aB(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aB()<10)}function B(){var s=T-ak;return(s>20)&&(s-aD()<10)}function ag(){am.unbind(ac).bind(ac,function(aM,aN,aL,aJ){var aK=aa,s=I;Q.scrollBy(aL*az.mouseWheelSpeed,-aJ*az.mouseWheelSpeed,false);return aK==aa&&s==I})}function n(){am.unbind(ac)}function aC(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aJ,aL=[];aF&&aL.push(an[0]);aA&&aL.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aO){if(aO.target!==this&&!(aL.length&&b(aO.target).closest(aL).length)){return}var aN=aa,aM=I;switch(aO.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aO.keyCode;aK();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aJ=aO.keyCode==s&&aN!=aa||aM!=I;return !aJ}).bind("keypress.jsp",function(aM){if(aM.keyCode==s){aK()}return !aJ});if(az.hideFocus){D.css("outline","none");if("hideFocus" in am[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in am[0]){D.attr("hideFocus",false)}}function aK(){var aN=aa,aM=I;switch(s){case 40:Q.scrollByY(az.keyboardSpeed,false);break;case 38:Q.scrollByY(-az.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*az.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*az.scrollPagePercent,false);break;case 39:Q.scrollByX(az.keyboardSpeed,false);break;case 37:Q.scrollByX(-az.keyboardSpeed,false);break}aJ=aN!=aa||aM!=I;return aJ}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aL,aJ,aK=escape(location.hash);try{aL=b(aK)}catch(s){return}if(aL.length&&Y.find(aK)){if(am.scrollTop()===0){aJ=setInterval(function(){if(am.scrollTop()>0){ab(aK,true);b(document).scrollTop(am.position().top);clearInterval(aJ)}},50)}else{ab(aK,true);b(document).scrollTop(am.position().top)}}}}function ai(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){ai();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aJ;if(s.length>1){aJ=s[1];if(aJ.length>0&&Y.find("#"+aJ).length>0){ab("#"+aJ,true);return false}}})}function ao(){var aK,aJ,aM,aL,aN,s=false;am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aO){var aP=aO.originalEvent.touches[0];aK=aD();aJ=aB();aM=aP.pageX;aL=aP.pageY;aN=false;s=true}).bind("touchmove.jsp",function(aR){if(!s){return}var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5; -return aP==aa&&aO==I}).bind("touchend.jsp",function(aO){s=false}).bind("click.jsp-touchclick",function(aO){if(aN){aN=false;return false}})}function g(){var s=aB(),aJ=aD();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ap.append(Y.children()));ap.scrollTop(s);ap.scrollLeft(aJ)}b.extend(Q,{reinitialise:function(aJ){aJ=b.extend({},az,aJ);at(aJ)},scrollToElement:function(aK,aJ,s){ab(aK,aJ,s)},scrollTo:function(aK,s,aJ){N(aK,aJ);M(s,aJ)},scrollToX:function(aJ,s){N(aJ,s)},scrollToY:function(s,aJ){M(s,aJ)},scrollToPercentX:function(aJ,s){N(aJ*(T-ak),s)},scrollToPercentY:function(aJ,s){M(aJ*(Z-v),s)},scrollBy:function(aJ,s,aK){Q.scrollByX(aJ,aK);Q.scrollByY(s,aK)},scrollByX:function(s,aK){var aJ=aD()+Math[s<0?"floor":"ceil"](s),aL=aJ/(T-ak);W(aL*j,aK)},scrollByY:function(s,aK){var aJ=aB()+Math[s<0?"floor":"ceil"](s),aL=aJ/(Z-v);V(aL*i,aK)},positionDragX:function(s,aJ){W(s,aJ)},positionDragY:function(aJ,s){V(aJ,s)},animate:function(aJ,aM,s,aL){var aK={};aK[aM]=s;aJ.animate(aK,{duration:az.animateDuration,easing:az.animateEase,queue:false,step:aL})},getContentPositionX:function(){return aD()},getContentPositionY:function(){return aB()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aD()/(T-ak)},getPercentScrolledY:function(){return aB()/(Z-v)},getIsScrollableH:function(){return aF},getIsScrollableV:function(){return aA},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:function(){m()},destroy:function(){g()}});at(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this); \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/views-editor-addon.class.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/views-editor-addon.class.php deleted file mode 100644 index 6bb9c91..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/views-editor-addon.class.php +++ /dev/null @@ -1,141 +0,0 @@ -items ); - } - - function add_form_button( $context, $text_area = '', $standard_v = true, $add_views = false, $codemirror_button = false ) { - return; - } - - /** - * Backwards compatibility: Views < 2.3.0 might call this. - * - * @until 2.5.0 - */ - function render_shortcodes_wrapper_dialogs() { - return; - } - - /** - * Backwards compatibility: Views < 2.3.0 might call this. - * - * @until 2.5.0 - */ - function add_fields_views_button() { - return; - } - - /** - * - * Sort menus (and menu content) in an alphabetical order - * - * Still, keep Basic and Taxonomy on the top and Other Fields at the bottom - * - * @param array $menu menu reference - */ - function sort_menus( $menus ) { - // keep main references if set (not set on every screen) - $menu_temp = array(); - $menu_names = array( - __( 'WPML', 'wpv-views' ), - __( 'User View', 'wpv-views' ), - __( 'Taxonomy View', 'wpv-views' ), - __( 'Post View', 'wpv-views' ), - __( 'View', 'wpv-views' ), - __( 'Post field', 'wpv-views' ), - __( 'User basic data', 'wpv-views' ), - __( 'Content Template', 'wpv-views' ), - __( 'Taxonomy', 'wpv-views' ), - __( 'Basic', 'wpv-views' ) - ); - - $menus_sorted_first = array(); - $menus_sorted_last = array(); - $menus_sorted = array(); - - $menus_on_top = array( - __( 'Basic', 'wpv-views' ), - __( 'Taxonomy', 'wpv-views' ), - __( 'Content Template', 'wpv-views' ), - __( 'User basic data', 'wpv-views' ) - ); - - $menus_on_bottom = array( - __( 'Post field', 'wpv-views' ), - __( 'View', 'wpv-views' ), - __( 'Post View', 'wpv-views' ), - __( 'Taxonomy View', 'wpv-views' ), - __( 'User View', 'wpv-views' ), - __( 'WPML', 'wpv-views' ) - ); - - $menus_keys = array_keys( $menus ); - - foreach ( $menus_keys as $mk ) { - if ( in_array( $mk, $menus_on_top ) ) { - $menus_sorted_first[$mk] = $menus[$mk]; - unset( $menus[$mk] ); - } else if ( in_array( $mk, $menus_on_bottom ) ) { - $menus_sorted_last[$mk] = $menus[$mk]; - unset( $menus[$mk] ); - } - } - - $menus_sorted = array_merge( $menus_sorted_first, $menus, $menus_sorted_last ); - - return $menus_sorted; - - - } - - } - - /** - * Renders JS for inserting shortcode from thickbox popup to editor. - * - * @param type $shortcode - * maybe DEPRECATED ??? - */ - if ( ! function_exists('editor_admin_popup_insert_shortcode_js') ) { - function editor_admin_popup_insert_shortcode_js( $shortcode ) { // Types now uses ColorBox, it's not used in Views anymore. Maybe DEPRECATED - ?> - - log( mixed php_expression [, const message_type] ) - - message_type can be: WPLOG_ERR. WPLOG_WARNING, WPLOG_INFO, WPLOG_DEBUG - - Example: - if ($wplogger) $wplogger->log( get_option('active_plugins') ); - - Output ( from the browser console ): - [Information: from line xxx in file somefile.php] array ( - 0 => 'wplogger/wplogger.php', - 1 => '12seconds-widget/12seconds-widget.php', - 2 => 'get-the-image/get-the-image.php', - ) - */ - -/* Types of log messages */ -define( 'WPLOG_ERR', 'error' ); /* Error conditions */ -define( 'WPLOG_WARNING', 'warn' ); /* Warning conditions */ -define( 'WPLOG_INFO', 'info' ); /* Informational */ -define( 'WPLOG_DEBUG', 'debug' ); /* Debug-level messages */ -define( 'WPLOG_OFF', '' ); /* NO debug enabled */ - -/* New Wordpress Logger instance */ -global $wplogger; -$wplogger = new WPV_WPLogger(); - -function wplogger( $message = '', $msgType = null ) -{ - global $wplogger; - $wplogger->log( $message, $msgType ); -} - -/* Register function to add logging script */ -add_action( 'wp_footer', array($wplogger, 'flushLogMessages') ); // log scripts -/* Ensure logging works in admin pages as well */ -add_action ('admin_footer', array ($wplogger, 'flushLogMessages')); - -/** - * WPV_WPLogger Class - * renamed for compatibility reasons - */ -class WPV_WPLogger -{ - - /** - * String holding the buffered output. - */ - var $_buffer = array(); - - /** - * The default priority to use when logging an event. - */ - var $_defaultMsgType = WPLOG_INFO; - - /** - * Long descriptions of debug message types - */ - var $_msgTypeLong = array( - WPLOG_ERR => 'error', - WPLOG_WARNING => 'warn', - WPLOG_INFO => 'info', - WPLOG_DEBUG => 'debug' - ); - - var $_msgStatusPriority = array( - WPLOG_ERR => '50', - WPLOG_WARNING => '40', - WPLOG_INFO => '30', - WPLOG_DEBUG => '20', - WPLOG_OFF => '10' - ); - /** - * Writes JavaScript to flush all pending ("buffered") data to - * the Firefox or Safari console. - * - * @notes requires JQuery 1.2.6 for browser detection. - * browser detection is deprecated in JQuery 1.3 - * @see http://docs.jquery.com/Utilities/jQuery.browser - */ - function flushLogMessages() - { - if ( count( $this->_buffer ) ) - { - print '\n"; - } - ; - $this->_buffer = array(); - } - - /** - * Buffers $message to be flushed to the Firebug or Safari console. - * - * Adapted from the PEAR_Log library - * - * @return boolean true - * @param mixed $message String or object containing the message to log. - * @param const $msgType[optional] type of message. Valid values are: - * WPLOG_ERR. WPLOG_WARNING, WPLOG_INFO, WPLOG_DEBUG - */ - function log( $message, $msgType = null ) - { - /* backtrace */ - $bTrace = debug_backtrace(); // assoc array - - /* If a log message type hasn't been specified, use the default value. */ - if ( $msgType === null ) - { - $msgType = $this->_defaultMsgType; - } - - // verify the status type and output only priority messages (based on wp-config setup) - if(!$this->isMsgVisible($msgType)) { - return false; - } - - /* Extract the string representation of the message. */ - $message = $this->_extractMessage( $message ); - - /* normalize line breaks */ - $message = str_replace( "\r\n", "\n", $message ); - - /* escape line breaks */ - $message = str_replace( "\n", "\\n\\\n", $message ); - - /* escape quotes */ - $message = str_replace( '"', '\\"', $message ); - - /* Build the string containing the complete log line. */ - $line = sprintf('[%s: from line %d in file %s] %s', - $this->_msgTypeLong[ $msgType ], - $bTrace[0]['line'], - basename($bTrace[0]['file']), - $message ); - - // buffer method and line - $this->_buffer[] = array($msgType, $line); - - return true; - } - - /** - * Returns the string representation of the message data (from the PEAR_Log library). - * - * If $message is an object, _extractMessage() will attempt to extract - * the message text using a known method (such as a PEAR_Error object's - * getMessage() method). If a known method, cannot be found, the - * serialized representation of the object will be returned. - * - * If the message data is already a string, it will be returned unchanged. - * - * Adapted from the PEAR_Log library - * - * @param mixed $message The original message data. This may be a - * string or any object. - * - * @return string The string representation of the message. - * - */ - function _extractMessage( $message ) - { - /* - * If we've been given an object, attempt to extract the message using - * a known method. If we can't find such a method, default to the - * "human-readable" version of the object. - * - * We also use the human-readable format for arrays. - */ - if ( is_object( $message ) ) - { - if ( method_exists( $message, 'getmessage' ) ) - { - $message = $message->getMessage(); - } - else if ( method_exists( $message, 'tostring' ) ) - { - $message = $message->toString(); - } - else if ( method_exists( $message, '__tostring' ) ) - { - if ( version_compare( PHP_VERSION, '5.0.0', 'ge' ) ) - { - $message = (string) $message; - } - else - { - $message = $message->__toString(); - } - } - else - { - $message = var_export( $message, true ); - } - } - else if ( is_array( $message ) ) - { - if ( isset($message['message']) ) - { - if ( is_scalar( $message['message'] ) ) - { - $message = $message['message']; - } - else - { - $message = var_export( $message['message'], true ); - } - } - else - { - $message = var_export( $message, true ); - } - } - else if ( is_bool( $message ) || $message === NULL ) - { - $message = var_export( $message, true ); - } - - /* Otherwise, we assume the message is a string. */ - return $message; - } - - /** - * - * Is the message for the logger visible, i.e. is the status approved for output in the config - * - * @param status_type $msg_status the status level - */ - function isMsgVisible($msg_status) { - // verify that status for logging is set - if(!defined('WPV_LOGGING_STATUS')) { - return false; - } - - // use default off status if status not in the list - if(!in_array(WPV_LOGGING_STATUS, $this->_msgTypeLong) || - !in_array($msg_status, $this->_msgTypeLong)) { - return false; - } - - // verify priorities - if( $this->_msgStatusPriority[$msg_status] >= $this->_msgStatusPriority[WPV_LOGGING_STATUS] ) { - - return true; - } - - return false; - } -} - -?> diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/wpv-filter-date-embedded.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/wpv-filter-date-embedded.php deleted file mode 100644 index b7f1014..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/wpv-filter-date-embedded.php +++ /dev/null @@ -1,166 +0,0 @@ - 0) { - for ($i = 0; $i < $occurences; $i++) { - $date_func = $matches[1][$i]; - // remove comma at the end of date value in case is left there - $date_value = isset( $matches[2] ) ? rtrim( $matches[2][$i], ',' ) : ''; - $resulting_date = false; - - switch (strtoupper($date_func)) { - case "NOW": - $resulting_date = current_time('timestamp'); - break; - case "TODAY": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')); - break; - case "FUTURE_DAY": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m'), date_i18n('d') + $date_value, date_i18n('Y')); - break; - case "PAST_DAY": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m'), date_i18n('d') - $date_value, date_i18n('Y')); - break; - case "THIS_MONTH": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m'), 1, date_i18n('Y')); - break; - case "FUTURE_MONTH": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m') + $date_value, 1, date_i18n('Y')); - break; - case "PAST_MONTH": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m') - $date_value, 1, date_i18n('Y')); - break; - case "THIS_YEAR": - $resulting_date = adodb_mktime(0, 0, 0, 1, 1, date_i18n('Y')); - break; - case "FUTURE_YEAR": - $resulting_date = adodb_mktime(0, 0, 0, 1, 1, date_i18n('Y') + $date_value); - break; - case "PAST_YEAR": - $resulting_date = adodb_mktime(0, 0, 0, 1, 1, date_i18n('Y') - $date_value); - break; - case "SECONDS_FROM_NOW": - $resulting_date = current_time('timestamp') + $date_value; - break; - case "MONTHS_FROM_NOW": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m') + $date_value, date_i18n('d'), date_i18n('Y')); - break; - case "YEARS_FROM_NOW": - $resulting_date = adodb_mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y') + $date_value); - break; - case "DATE": - $date_object = wpv_filter_get_date_and_format($date_value); - $date_value = $date_object->date; - $format = $date_object->format; - $resulting_date = wpv_filter_parse_date_get_resulting_date( $date_value, $format ); - break; - - } - if ($resulting_date != false) { - $date_format = str_replace($matches[0][$i], $resulting_date, $date_format); - } - } - } - - return $date_format; - } - - if( !function_exists('wpv_filter_parse_date_get_resulting_date') ) - { - function wpv_filter_parse_date_get_resulting_date( $date_value, $format ) - { - $date_value = (string) $date_value; - - if( !$format && strpos($date_value, ',') !== false ){ - - $date_parts = explode(',', $date_value); - $ret = adodb_mktime(0, 0, 0, $date_parts[1], $date_parts[0], $date_parts[2]); - return $ret; - } - else - { - // just in case the Parser is not loaded yet - if( class_exists('Toolset_DateParser') === false ) - { - require_once(dirname(__FILE__) . "/expression-parser/parser.php"); - } - - $date_string = trim( trim( str_replace(',', '/', $date_value), "'" ) ); - - $date = Toolset_DateParser::parseDate( $date_string, $format ); - if( is_object($date) && method_exists( $date, 'getTimestamp' ) ) - { - $timestamp = $date->getTimestamp();// NOTE this timestamp construction should be compatible with the adodb_xxx functions - return $timestamp; - } - - return $date_value; - } - } - } - - if( !function_exists('wpv_filter_get_date_format') ) - { - function wpv_filter_get_date_and_format($date_value) - { - - $date_value = str_replace("'", '', $date_value); - - $ret = new stdClass(); - $ret->date = $date_value; - $ret->format = false; - - $last = strrpos( $date_value, ',' ); - - if( $last === false ) return $ret; - - $temp = trim( trim( substr($date_value, $last ), ',' ) ); - - if( is_numeric( $temp ) ) - { - return $ret; - } - else{ - $ret->date = trim( substr($date_value, 0, $last ) ); - $ret->format = trim( trim( $temp, ',') ); - - return $ret; - } - - return $date_value; - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/admin.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/admin.php deleted file mode 100644 index 987ba17..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/admin.php +++ /dev/null @@ -1,1782 +0,0 @@ -initialize_ajax_handler(); - } - break; - } - } - } - - -} - - -function wpcf_admin_calculate_menu_page_capability( $data ) { - $capability = array_key_exists( 'capability', $data ) ? $data['capability'] : 'manage_options'; - $wpcf_capability = apply_filters( 'wpcf_capability', $capability, $data, $data['slug'] ); - $wpcf_capability = apply_filters( 'wpcf_capability' . $data['slug'], $capability, $data, $data['slug'] ); - /** - * allow change capability by filter - * full list https://goo.gl/OJYTvl - */ - if ( isset( $data['capability_filter'] ) ) { - $wpcf_capability = apply_filters( $data['capability_filter'], $wpcf_capability, $data, $data['slug'] ); - } - return $wpcf_capability; -} - -function wpcf_admin_calculate_menu_page_load_hook( $data ) { - $load_hook = ''; - if ( array_key_exists( 'load_hook', $data ) ) { - $load_hook = $data['load_hook']; - } else if ( - array_key_exists( 'callback', $data ) - && is_string( $data['callback' ] ) - ) { - $load_hook = sprintf( '%s_hook', $data['callback'] ); - } - return $load_hook; -} - - -/** - * Add legacy menu pages. - * - * This is indirectly hooked to toolset_filter_register_menu_pages through the Types_Admin_Menu controller. - * - * @param $pages - * @return mixed - * @since 2.0 - */ -function wpcf_admin_toolset_register_menu_pages( $pages ) { - if( ! apply_filters( 'types_register_pages', true ) ) - return $pages; - - require_once WPCF_ABSPATH . '/help.php'; - - $current_page = ''; - if ( isset( $_GET['page'] ) ) { - $current_page = sanitize_text_field( $_GET['page'] ); - } - - $pages['wpcf-cpt'] = array( - 'slug' => 'wpcf-cpt', - 'menu_title' => __( 'Post Types', 'wpcf' ), - 'page_title' => __( 'Post Types', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_summary_cpt', - 'capability_filter' => 'wpcf_cpt_view', - 'capability' => WPCF_CUSTOM_POST_TYPE_VIEW, - ); - $pages['wpcf-cpt']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-cpt'] ); - $pages['wpcf-cpt']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-cpt'] ); - $pages['wpcf-cpt']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-cpt' ); - $pages['wpcf-cpt']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - - if ( $current_page == 'wpcf-edit-type' ) { - $pages['wpcf-edit-type'] = array( - 'slug' => 'wpcf-edit-type', - 'menu_title' => isset( $_GET['wpcf-post-type'] ) ? __( 'Edit Post Type', 'wpcf' ) : __( 'Add New Post Type', 'wpcf' ), - 'page_title' => isset( $_GET['wpcf-post-type'] ) ? __( 'Edit Post Type', 'wpcf' ) : __( 'Add New Post Type', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_type', - 'capability' => WPCF_CUSTOM_FIELD_EDIT, - 'load_hook' => 'wpcf_admin_menu_edit_type_hook' - ); - $pages['wpcf-edit-type']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-edit-type'] ); - $pages['wpcf-edit-type']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-edit-type'] ); - $pages['wpcf-edit-type']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-edit-type' ); - $pages['wpcf-edit-type']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - if ( $current_page == 'wpcf-view-type' ) { - $pages['wpcf-view-type'] = array( - 'slug' => 'wpcf-view-type', - 'menu_title' => __( 'View Post Type', 'wpcf' ), - 'page_title' => __( 'View Post Type', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_type', - 'capability' => WPCF_CUSTOM_FIELD_VIEW, - 'load_hook' => 'wpcf_admin_menu_edit_type_hook' - ); - $pages['wpcf-view-type']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-view-type'] ); - $pages['wpcf-view-type']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-view-type'] ); - $pages['wpcf-view-type']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-view-type' ); - $pages['wpcf-view-type']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - $pages['wpcf-ctt'] = array( - 'slug' => 'wpcf-ctt', - 'menu_title' => __( 'Taxonomies', 'wpcf' ), - 'page_title' => __( 'Taxonomies', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_summary_ctt', - 'capability_filter' => 'wpcf_ctt_view', - 'capability' => WPCF_CUSTOM_TAXONOMY_VIEW, - ); - $pages['wpcf-ctt']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-ctt'] ); - $pages['wpcf-ctt']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-ctt'] ); - $pages['wpcf-ctt']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-ctt' ); - $pages['wpcf-ctt']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - - if ( $current_page == 'wpcf-edit-tax' ) { - $pages['wpcf-edit-tax'] = array( - 'slug' => 'wpcf-edit-tax', - 'menu_title' => isset( $_GET['wpcf-tax'] ) ? __( 'Edit Taxonomy', 'wpcf' ) : __( 'Add New Taxonomy', 'wpcf' ), - 'page_title' => isset( $_GET['wpcf-tax'] ) ? __( 'Edit Taxonomy', 'wpcf' ) : __( 'Add New Taxonomy', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_tax', - 'capability' => WPCF_CUSTOM_TAXONOMY_EDIT, - 'load_hook' => 'wpcf_admin_menu_edit_tax_hook' - ); - $pages['wpcf-edit-tax']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-edit-tax'] ); - $pages['wpcf-edit-tax']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-edit-tax'] ); - $pages['wpcf-edit-tax']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-edit-tax' ); - $pages['wpcf-edit-tax']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - if ( $current_page == 'wpcf-view-tax' ) { - $pages['wpcf-view-tax'] = array( - 'slug' => 'wpcf-view-tax', - 'menu_title' => __( 'View Taxonomy', 'wpcf' ), - 'page_title' => __( 'View Taxonomy', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_tax', - 'capability' => WPCF_CUSTOM_TAXONOMY_VIEW, - 'load_hook' => 'wpcf_admin_menu_edit_tax_hook' - ); - $pages['wpcf-view-tax']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-view-tax'] ); - $pages['wpcf-view-tax']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-view-tax'] ); - $pages['wpcf-view-tax']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-view-tax' ); - $pages['wpcf-view-tax']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - - $pages['wpcf-cf'] = array( - 'slug' => 'wpcf-cf', - 'menu_title' => __( 'Post Fields', 'wpcf' ), - 'page_title' => __( 'Post Fields', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_summary', - 'capability_filter' => 'wpcf_cf_view', - 'capability' => WPCF_CUSTOM_FIELD_VIEW, - ); - $pages['wpcf-cf']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-cf'] ); - $pages['wpcf-cf']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-cf'] ); - $pages['wpcf-cf']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-cf' ); - $pages['wpcf-cf']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - - if ( $current_page == 'wpcf-edit' ) { - $pages['wpcf-edit'] = array( - 'slug' => 'wpcf-edit', - 'menu_title' => isset( $_GET['group_id'] ) ? __( 'Edit Group', 'wpcf' ) : __( 'Add New Post Field Group', 'wpcf' ), - 'page_title' => isset( $_GET['group_id'] ) ? __( 'Edit Group', 'wpcf' ) : __( 'Add New Post Field Group', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_fields', - 'capability' => WPCF_CUSTOM_FIELD_VIEW, - 'load_hook' => 'wpcf_admin_menu_edit_fields_hook' - ); - $pages['wpcf-edit']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-edit'] ); - $pages['wpcf-edit']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-edit'] ); - $pages['wpcf-edit']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-edit' ); - $pages['wpcf-edit']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - if ( $current_page == 'wpcf-view-custom-field' ) { - $pages['wpcf-view-custom-field'] = array( - 'slug' => 'wpcf-view-custom-field', - 'menu_title' => __( 'View Post Field Group', 'wpcf' ), - 'page_title' => __( 'View Post Field Group', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_fields', - 'capability' => WPCF_CUSTOM_FIELD_VIEW, - ); - $pages['wpcf-view-custom-field']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-view-custom-field'] ); - $pages['wpcf-view-custom-field']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-view-custom-field'] ); - $pages['wpcf-view-custom-field']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-view-custom-field' ); - $pages['wpcf-view-custom-field']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - $WPCF_Page_Listing_Termmeta = WPCF_Page_Listing_Termmeta::get_instance(); - $pages[WPCF_Page_Listing_Termmeta::PAGE_NAME] = $WPCF_Page_Listing_Termmeta->add_submenu_page(); - - - if ( $current_page == WPCF_Page_Edit_Termmeta::PAGE_NAME ) { - $WPCF_Page_Edit_Termmeta = WPCF_Page_Edit_Termmeta::get_instance(); - $pages[WPCF_Page_Edit_Termmeta::PAGE_NAME] = $WPCF_Page_Edit_Termmeta->add_submenu_page(); - } - - $pages['wpcf-um'] = array( - 'slug' => 'wpcf-um', - 'menu_title' => __( 'User Fields', 'wpcf' ), - 'page_title' => __( 'User Fields', 'wpcf' ), - 'callback' => 'wpcf_usermeta_summary', - 'capability_filter' => 'wpcf_uf_view', - 'capability' => WPCF_USER_META_FIELD_VIEW, - ); - $pages['wpcf-um']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-um'] ); - $pages['wpcf-um']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-um'] ); - $pages['wpcf-um']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-um' ); - $pages['wpcf-um']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - - if ( $current_page == 'wpcf-edit-usermeta' ) { - $pages['wpcf-edit-usermeta'] = array( - 'slug' => 'wpcf-edit-usermeta', - 'menu_title' => isset( $_GET['group_id'] ) ? __( 'Edit User Field Group', 'wpcf' ) : __( 'Add New User Field Group', 'wpcf' ), - 'page_title' => isset( $_GET['group_id'] ) ? __( 'Edit User Field Group', 'wpcf' ) : __( 'Add New User Field Group', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_user_fields', - 'capability' => WPCF_USER_META_FIELD_EDIT, - ); - $pages['wpcf-edit-usermeta']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-edit-usermeta'] ); - $pages['wpcf-edit-usermeta']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-edit-usermeta'] ); - $pages['wpcf-edit-usermeta']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-edit-usermeta' ); - $pages['wpcf-edit-usermeta']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - if ( $current_page == 'wpcf-view-usermeta' ) { - $pages['wpcf-view-usermeta'] = array( - 'slug' => 'wpcf-view-usermeta', - 'menu_title' => __( 'View User Field Group', 'wpcf' ), - 'page_title' => __( 'View User Field Group', 'wpcf' ), - 'callback' => 'wpcf_admin_menu_edit_user_fields', - 'capability' => WPCF_USER_META_FIELD_VIEW, - ); - $pages['wpcf-view-usermeta']['capability'] = wpcf_admin_calculate_menu_page_capability( $pages['wpcf-view-usermeta'] ); - $pages['wpcf-view-usermeta']['load_hook'] = wpcf_admin_calculate_menu_page_load_hook( $pages['wpcf-view-usermeta'] ); - $pages['wpcf-view-usermeta']['contextual_help_legacy'] = wpcf_admin_help( 'wpcf-view-usermeta' ); - $pages['wpcf-view-usermeta']['contextual_help_hook'] = 'wpcf_admin_help_add_tabs_load_hook'; - } - - - if ( 'installer' == $current_page ) { - // @todo Having a page with a slug "installer" is a direct path to a third-party plugin conflict. Just saying. Not to mention the callback funciton "installer_content", for god's sake - $pages['installer'] = array( - 'slug' => 'installer', - 'menu_title' => __( 'Installer', 'wpcf' ), - 'page_title' => __( 'Installer', 'wpcf' ), - 'callback' => 'installer_content', - ); - } - - /** - * This used to load the Toolset Access teaser - code has not been removed - * - * This also usd to hook the Installer page, added above - * - * @todo this is to be deletd IMHO - */ - //do_action( 'wpcf_menu_plus' ); - - return $pages; -} - -/** - * Menu page hook. - */ -function wpcf_admin_menu_debug_information() -{ - require_once WPCF_EMBEDDED_TOOLSET_ABSPATH .'/toolset-common/debug/debug-information.php'; -} - - -/** - * Menu page hook. - */ -function wpcf_usermeta_summary_hook() -{ - do_action( 'wpcf_admin_page_init' ); - wpcf_admin_load_collapsible(); - wpcf_admin_page_add_options('uf', __( 'User Fields', 'wpcf' )); -} - -/** - * Menu page hook. - */ -function wpcf_admin_menu_summary_hook() -{ - do_action( 'wpcf_admin_page_init' ); - wpcf_admin_load_collapsible(); - wpcf_admin_page_add_options('cf', __( 'Post Fields', 'wpcf' )); -} - -/** - * Menu page display. - */ -function wpcf_admin_menu_summary() -{ - wpcf_add_admin_header( __( 'Post Field Groups', 'wpcf' ), array('page'=>'wpcf-edit')); - require_once WPCF_INC_ABSPATH . '/fields.php'; - require_once WPCF_INC_ABSPATH . '/fields-list.php'; - $to_display = wpcf_admin_fields_get_fields(); - if ( !empty( $to_display ) ) { - add_action( 'wpcf_groups_list_table_after', 'wpcf_admin_promotional_text' ); - } - wpcf_admin_fields_list(); - wpcf_add_admin_footer(); -} - - -function wpcf_admin_enqueue_group_edit_page_assets() { - do_action( 'wpcf_admin_page_init' ); - - $asset_manager = Types_Asset_Manager::get_instance(); - - // Group filter - wp_enqueue_script( 'wpcf-filter-js', - WPCF_EMBEDDED_RES_RELPATH - . '/js/custom-fields-form-filter.js', array('jquery'), WPCF_VERSION ); - - - $asset_manager->enqueue_scripts( - array( - Types_Asset_Manager::SCRIPT_JQUERY_UI_VALIDATION, - Types_Asset_Manager::SCRIPT_ADDITIONAL_VALIDATION_RULES, - - // These scripts are needed only for the Styling editor - Types_Asset_Manager::SCRIPT_CODEMIRROR, - Types_Asset_Manager::SCRIPT_CODEMIRROR_CSS, - Types_Asset_Manager::SCRIPT_CODEMIRROR_XML, - Types_Asset_Manager::SCRIPT_CODEMIRROR_HTMLMIXED, - Types_Asset_Manager::SCRIPT_JSCROLLPANE, - Types_Asset_Manager::SCRIPT_MOUSEWHEEL - ) - ); - - // MAIN - wp_enqueue_script( - 'wpcf-fields-form', - WPCF_EMBEDDED_RES_RELPATH.'/js/fields-form.js', - array( 'wpcf-js' ), - WPCF_VERSION - ); - wp_enqueue_script( - 'wpcf-admin-fields-form', - WPCF_RES_RELPATH.'/js/fields-form.js', - array(), - WPCF_VERSION - ); - - $asset_manager->enqueue_styles( - array( - // These styles are needed only for the Styling editor - Types_Asset_Manager::STYLE_CODEMIRROR, - Types_Asset_Manager::STYLE_EDITOR_ADDON_MENU_SCROLL - ) - ); - - wp_enqueue_script( 'wpcf-form-codemirror-editor-resize' , - WPCF_RELPATH . '/resources/js/jquery_ui/jquery.ui.resizable.min.js', array('wpcf-js')); - - wp_enqueue_style( 'wpcf-usermeta', WPCF_EMBEDDED_RES_RELPATH . '/css/usermeta.css' ); - - wp_enqueue_style( 'font-awesome' ); - - add_action( 'admin_footer', 'wpcf_admin_fields_form_js_validation' ); - -} - - -/** - * Menu page hook. - */ -function wpcf_admin_menu_edit_fields_hook() { - wpcf_admin_enqueue_group_edit_page_assets(); - - require_once WPCF_INC_ABSPATH . '/fields.php'; - require_once WPCF_INC_ABSPATH . '/fields-form.php'; - // $form = wpcf_admin_fields_form(); - - $wpcf_admin = new Types_Admin_Edit_Custom_Fields_Group(); - $wpcf_admin->init_admin(); - $form = $wpcf_admin->form(); - wpcf_form( 'wpcf_form_fields', $form ); -} - -/** - * Menu page display. - */ -function wpcf_admin_menu_edit_fields() -{ - $add_new = false; - $post_type = current_filter(); - $title = __('View Post Field Group', 'wpcf'); - if ( isset( $_GET['group_id'] ) ) { - if ( WPCF_Roles::user_can_edit('custom-field', array('id' => (int) $_GET['group_id']))) { - $title = __( 'Edit Post Field Group', 'wpcf' ); - $add_new = array( - 'page' => 'wpcf-edit', - ); - } - } else if ( WPCF_Roles::user_can_create('custom-field')) { - $title = __( 'Add New Post Field Group', 'wpcf' ); - } - wpcf_add_admin_header( $title, $add_new ); - wpcf_wpml_warning(); - $form = wpcf_form( 'wpcf_form_fields' ); - echo '
                '; - wpcf_admin_screen($post_type, $form->renderForm()); - echo '
                '; - wpcf_add_admin_footer(); -} - - -function wpcf_admin_page_add_options( $name, $label) -{ - $option = 'per_page'; - $args = array( - 'label' => $label, - 'default' => 10, - 'option' => sprintf('wpcf_%s_%s', $name, $option), - ); - add_screen_option( $option, $args ); -} - - -function wpcf_admin_menu_summary_cpt_ctt_hook() -{ - do_action( 'wpcf_admin_page_init' ); - wpcf_admin_load_collapsible(); - require_once WPCF_INC_ABSPATH . '/custom-types.php'; - require_once WPCF_INC_ABSPATH . '/custom-taxonomies.php'; - require_once WPCF_INC_ABSPATH . '/custom-types-taxonomies-list.php'; -} - -/** - * Menu page hook. - */ -function wpcf_admin_menu_summary_cpt_hook() -{ - wpcf_admin_menu_summary_cpt_ctt_hook(); - wpcf_admin_page_add_options('cpt', __( 'Post Types', 'wpcf' )); -} - -/** - * Menu page display. - */ -function wpcf_admin_menu_summary_cpt() -{ - wpcf_add_admin_header( - __( 'Post Types', 'wpcf' ), - array('page'=>'wpcf-edit-type'), - __('Add New', 'wpcf') - ); - $post_type_option = new Types_Utils_Post_Type_Option(); - $to_display_posts = $post_type_option->get_post_types(); - $to_display_tax = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() ); - if ( !empty( $to_display_posts ) || !empty( $to_display_tax ) ) { - add_action( 'wpcf_types_tax_list_table_after', 'wpcf_admin_promotional_text' ); - } - wpcf_admin_custom_post_types_list(); - wpcf_add_admin_footer(); -} - -/** - * Menu page hook. - */ -function wpcf_admin_menu_summary_ctt_hook() -{ - wpcf_admin_menu_summary_cpt_ctt_hook(); - wpcf_admin_page_add_options('ctt', __( 'Taxonomies', 'wpcf' )); -} - -/** - * Menu page display. - */ -function wpcf_admin_menu_summary_ctt() -{ - wpcf_add_admin_header( __( 'Taxonomies', 'wpcf' ), array('page' => 'wpcf-edit-tax') ); - wpcf_admin_custom_taxonomies_list(); - do_action('wpcf_types_tax_list_table_after'); - wpcf_add_admin_footer(); -} - -/** - * Menu page hook. - */ -function wpcf_admin_menu_edit_type_hook() -{ - require_once WPCF_INC_ABSPATH . '/fields.php'; - do_action( 'wpcf_admin_page_init' ); - require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-types.php'; - require_once WPCF_INC_ABSPATH . '/custom-types-form.php'; - require_once WPCF_INC_ABSPATH . '/post-relationship.php'; - wp_enqueue_script( 'wpcf-custom-types-form', - WPCF_RES_RELPATH . '/js/' - . 'custom-types-form.js', array('jquery', 'jquery-ui-dialog', 'jquery-masonry'), WPCF_VERSION ); - - wp_enqueue_style('wp-jquery-ui-dialog'); - - $asset_manager = Types_Asset_Manager::get_instance(); - $asset_manager->enqueue_scripts( - array( - Types_Asset_Manager::SCRIPT_JQUERY_UI_VALIDATION, - Types_Asset_Manager::SCRIPT_ADDITIONAL_VALIDATION_RULES, - ) - ); - - add_action( 'admin_footer', 'wpcf_admin_types_form_js_validation' ); - wpcf_post_relationship_init(); - - // New page controller script. - $asset_manager->enqueue_scripts( Types_Asset_Manager::SCRIPT_PAGE_EDIT_POST_TYPE ); - - /** - * add form - */ - // $form = wpcf_admin_custom_types_form(); - require_once WPCF_INC_ABSPATH.'/classes/class.types.admin.edit.post.type.php'; - $wpcf_admin = new Types_Admin_Edit_Post_Type(); - $wpcf_admin->init_admin(); - $form = $wpcf_admin->form(); - wpcf_form( 'wpcf_form_types', $form ); -} - -/** - * Menu page display. - */ -function wpcf_admin_menu_edit_type() -{ - $post_type = current_filter(); - $title = __('View Post Type', 'wpcf'); - if ( WPCF_Roles::user_can_edit('custom-post-type', array()) ) { - if ( isset( $_GET['wpcf-post-type'] ) ) { - $title = __( 'Edit Post Type', 'wpcf' ); - /** - * add new CPT link - */ - $title .= sprintf( - '
                %s', - esc_url(add_query_arg( 'page', 'wpcf-edit-type', admin_url('admin.php'))), - __('Add New', 'wpcf') - ); - } else { - $title = __( 'Add New Post Type', 'wpcf' ); - } - } - wpcf_add_admin_header( $title ); - wpcf_wpml_warning(); - $form = wpcf_form( 'wpcf_form_types' ); - echo '
                '; - wpcf_admin_screen($post_type, $form->renderForm()); - echo '
                '; - wpcf_add_admin_footer(); -} - -/** - * Menu page hook. - */ -function wpcf_admin_menu_edit_tax_hook() -{ - do_action( 'wpcf_admin_page_init' ); - - wp_enqueue_script( 'wpcf-taxonomy-form', - WPCF_RES_RELPATH . '/js/' - . 'taxonomy-form.js', array( 'jquery' ), WPCF_VERSION ); - - - $asset_manager = Types_Asset_Manager::get_instance(); - $asset_manager->enqueue_scripts( - array( - Types_Asset_Manager::SCRIPT_JQUERY_UI_VALIDATION, - Types_Asset_Manager::SCRIPT_ADDITIONAL_VALIDATION_RULES, - - // New page controller script. - Types_Asset_Manager::SCRIPT_PAGE_EDIT_TAXONOMY - ) - ); - - add_action( 'admin_footer', 'wpcf_admin_tax_form_js_validation' ); - require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-taxonomies.php'; - require_once WPCF_INC_ABSPATH . '/custom-taxonomies-form.php'; -// $form = wpcf_admin_custom_taxonomies_form(); - require_once WPCF_INC_ABSPATH.'/classes/class.types.admin.edit.taxonomy.php'; - $wpcf_admin = new Types_Admin_Edit_Taxonomy(); - $wpcf_admin->init_admin(); - $form = $wpcf_admin->form(); - wpcf_form( 'wpcf_form_tax', $form ); -} - -/** - * Menu page display. - */ -function wpcf_admin_menu_edit_tax() -{ - $post_type = current_filter(); - $title = __( 'View Taxonomy', 'wpcf' ); - $add_new = false; - if ( WPCF_Roles::user_can_create('custom-taxonomy') ) { - $title = __( 'Add New Taxonomy', 'wpcf' ); - if ( isset( $_GET['wpcf-tax'] ) ) { - $title = __( 'Edit Taxonomy', 'wpcf' ); - $add_new = array('page' => 'wpcf-edit-tax' ); - } - } - wpcf_add_admin_header( $title, $add_new); - wpcf_wpml_warning(); - $form = wpcf_form( 'wpcf_form_tax' ); - echo '
                '; - wpcf_admin_screen($post_type, $form->renderForm()); - echo '
                '; - wpcf_add_admin_footer(); -} - -/** -* Export and Import, hooks and admin page tab -* -* This is screaming for a controller class... -*/ - -add_action( 'wp_loaded', 'wpcf_admin_export_on_form_submit' ); - -function wpcf_admin_export_on_form_submit() { - require_once WPCF_INC_ABSPATH . '/fields.php'; - require_once WPCF_INC_ABSPATH . '/import-export.php'; - if ( - extension_loaded( 'simplexml' ) - && isset( $_POST['types_export'] ) - && isset( $_POST['types_export_wpnonce'] ) - && wp_verify_nonce( $_POST['types_export_wpnonce'], 'wpcf_export' ) - ) { - wpcf_admin_export_data(); - die(); - } -} - -add_action( 'wp_loaded', 'wpcf_admin_import_on_form_submit' ); - -function wpcf_admin_import_on_form_submit() { - require_once WPCF_INC_ABSPATH . '/fields.php'; - require_once WPCF_INC_ABSPATH . '/import-export.php'; - global $wpcf_import_messages; - $wpcf_import_messages = array(); - if ( - extension_loaded( 'simplexml' ) - && isset( $_POST['types-import-final'] ) - && isset( $_POST['types_import_wpnonce'] ) - && wp_verify_nonce( $_POST['types_import_wpnonce'], 'wpcf_import' ) - ) { - $wpcf_import_messages = wpcf_admin_import_final_data(); - } -} - -add_action( 'admin_notices', 'wpcf_admin_import_admin_notices' ); - -function wpcf_admin_import_admin_notices() { - global $wpcf_import_messages; - if ( count( $wpcf_import_messages ) > 0 ) { - $success_messages = wp_list_filter( $wpcf_import_messages, array( 'type' => 'success' ) ); - $error_messages = wp_list_filter( $wpcf_import_messages, array( 'type' => 'error' ) ); - if ( count( $success_messages ) > 0 ) { - ?> -
                -

                -
                  - -
                • - -
                -
                - 0 ) { - ?> -
                -

                -
                  - -
                • - -
                -
                - 'types', - 'title' => __( 'Types', 'wpcf' ), - 'icon' => '', - 'items' => array( - 'export' => array( - 'title' => __( 'Export Types data', 'wpcf' ), - 'callback' => 'wpcf_render_export_form', - ), - 'import' => array( - 'title' => __( 'Import Types data', 'wpcf' ), - 'callback' => 'wpcf_render_import_form', - ) - ) - ); - return $sections; -} - -add_action( 'toolset_enqueue_scripts', 'wpcf_toolset_shared_pages_enqueue_script' ); - -function wpcf_toolset_shared_pages_enqueue_script( $current_page ) { - if ( $current_page == 'toolset-export-import' ) { - wp_enqueue_script( 'types-export-import' ); - } - if ( $current_page == 'toolset-settings' ) { - wp_enqueue_script( 'types-settings' ); - } -} - -function wpcf_render_export_form() { - require_once WPCF_INC_ABSPATH . '/fields.php'; - require_once WPCF_INC_ABSPATH . '/import-export.php'; - echo '
                '; - echo wpcf_admin_export_form(); - echo '
                '; -} - -function wpcf_render_import_form() { - require_once WPCF_INC_ABSPATH . '/fields.php'; - require_once WPCF_INC_ABSPATH . '/import-export.php'; - echo '
                '; - if ( - isset( $_POST['types_import_wpnonce'] ) - && wp_verify_nonce( $_POST['types_import_wpnonce'], 'wpcf_import' ) - && isset( $_POST['types-import-step'] ) - ) { - echo wpcf_admin_import_confirmation_form(); - } else { - echo wpcf_admin_import_form(); - } - echo '
                '; -} - - -add_filter( 'toolset_filter_toolset_register_settings_section', 'wpcf_register_settings_custom_content_section', 20 ); - -function wpcf_register_settings_custom_content_section( $sections ) { - $sections['custom-content'] = array( - 'slug' => 'custom-content', - 'title' => __( 'Custom Content', 'wpcf' ) - ); - return $sections; -} - -add_filter( 'toolset_filter_toolset_register_settings_custom-content_section', 'wpcf_admin_settings_for_images' ); - -function wpcf_admin_settings_for_images( $sections ) { - $settings = wpcf_get_settings(); - $section_content = ''; - ob_start(); - $form['images'] = array( - '#title' => '

                ' . __('Images resizing', 'wpcf') . '

                ', - '#id' => 'add_resized_images_to_library', - '#name' => 'wpcf_add_resized_images_to_library', - '#type' => 'checkbox', - '#label' => __('Add resized images to the media library', 'wpcf'), - '#description' => __('Types will automatically add the resized images as attachments to the media library.', 'wpcf'), - '#inline' => true, - '#default_value' => !empty($settings['add_resized_images_to_library']), - '#pattern' => '<ELEMENT><LABEL><DESCRIPTION>', - ); - $form['images_remote'] = array( - '#id' => 'images_remote', - '#name' => 'wpcf_images_remote', - '#type' => 'checkbox', - '#label' => __('Allow resizing of remote images', 'wpcf'), - '#description' => __('Types will try to scale remote images.', 'wpcf'), - '#inline' => true, - '#default_value' => !empty($settings['images_remote']), - '#pattern' => '<ELEMENT><LABEL><DESCRIPTION>', - ); - $form['images_remote_clear'] = array( - '#title' => '<h3>' . __('Images caching', 'wpcf') . '</h3>', - '#id' => 'images_remote_cache_time', - '#name' => 'wpcf_images_remote_cache_time', - '#type' => 'select', - '#pattern' => '<TITLE>' . __('Invalidate cached images that are more than <ELEMENT> hours old.', 'wpcf'), - '#options' => array( - __('Never', 'wpcf') => '0', - '24' => '24', - '36' => '36', - '48' => '48', - '72' => '72', - ), - '#inline' => false, - '#default_value' => intval($settings['images_remote_cache_time']), - ); - $form['clear_images_cache'] = array( - '#type' => 'button', - '#name' => 'clear-cache-images', - '#id' => 'clear-cache-images', - '#attributes' => array('id' => 'clear-cache-images','class' => 'button-secondary js-wpcf-settings-clear-cache-images'), - '#value' => __('Clear Cached Images', 'wpcf'), - '#inline' => false, - '#pattern' => '<div class="js-wpcf-settings-clear-cache-images-container"><ELEMENT>', - ); - $form['clear_images_cache_outdated'] = array( - '#id' => 'clear-cache-images-outdated', - '#type' => 'button', - '#name' => 'clear-cache-images-outdated', - '#attributes' => array('id' => 'clear-cache-images-outdated','class' => 'button-secondary js-wpcf-settings-clear-cache-images-outdated'), - '#value' => __('Clear Outdated Cached Images', 'wpcf'), - '#inline' => false, - '#pattern' => ' <ELEMENT></div>', - ); - $section_content = wpcf_form_simple( $form ); - - $sections['wpcf-images-settings'] = array( - 'slug' => 'wpcf-image-settings', - 'title' => __( 'Images', 'wpcf' ), - 'content' => $section_content - ); - return $sections; -} - -add_action( 'wp_ajax_wpcf_settings_clear_cache_images', 'wpcf_settings_clear_cache_images' ); - -function wpcf_settings_clear_cache_images() { - if ( ! current_user_can( 'manage_options' ) ) { - $data = array( - 'type' => 'capability', - 'message' => __( 'You do not have permissions for that.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST["wpnonce"] ) - || ! wp_verify_nonce( $_POST["wpnonce"], 'wpcf_settings_nonce' ) - ) { - $data = array( - 'type' => 'nonce', - 'message' => __( 'Your security credentials have expired. Please reload the page to get new ones.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields/image.php'; - $cache_dir = wpcf_fields_image_get_cache_directory( true ); - if ( is_wp_error( $cache_dir ) ) { - $data = array( - 'type' => 'error', - 'message' => $cache_dir->get_error_message() - ); - wp_send_json_error( $data ); - } - $posted_settings = isset( $_POST['settings'] ) ? sanitize_text_field( $_POST['settings'] ) : ''; - if ( ! in_array( $posted_settings, array( 'all', 'outdated' ) ) ) { - $data = array( - 'type' => 'error', - 'message' => __( 'Missing data', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - switch ( $posted_settings ) { - case 'all': - wpcf_fields_image_clear_cache( $cache_dir, 'all' ); - break; - case 'outdated': - wpcf_fields_image_clear_cache( $cache_dir ); - break; - } - wp_send_json_success(); -} - -add_action( 'wp_ajax_wpcf_settings_save_image_settings', 'wpcf_settings_save_image_settings' ); - -function wpcf_settings_save_image_settings() { - if ( ! current_user_can( 'manage_options' ) ) { - $data = array( - 'type' => 'capability', - 'message' => __( 'You do not have permissions for that.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST["wpnonce"] ) - || ! wp_verify_nonce( $_POST["wpnonce"], 'wpcf_settings_nonce' ) - ) { - $data = array( - 'type' => 'nonce', - 'message' => __( 'Your security credentials have expired. Please reload the page to get new ones.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - $settings = wpcf_get_settings(); - $keys_to_check = array( - 'add_resized_images_to_library' => 'esc_html', - 'images_remote' => 'intval', - 'images_remote_cache_time' => 'intval' - ); - $posted_settings = isset( $_POST['settings'] ) ? wp_parse_args( $_POST['settings'] ) : array(); - foreach ( $keys_to_check as $key => $validation ) { - if ( isset( $posted_settings['wpcf_' . $key] ) ) { - $settings[$key] = call_user_func( $validation, $posted_settings['wpcf_' . $key] ); - } else { - $settings[$key] = 0; - } - } - update_option('wpcf_settings', $settings); - wp_send_json_success(); -} - -add_filter( 'toolset_filter_toolset_register_settings_custom-content_section', 'wpcf_admin_settings_for_help_box', 20 ); - -function wpcf_admin_settings_for_help_box( $sections ) { - $settings = wpcf_get_settings(); - $section_content = ''; - $form['help-box'] = array( - '#id' => 'help_box', - '#name' => 'wpcf_help_box', - '#type' => 'radios', - '#options' => array( - 'all' => array( - '#value' => 'all', - '#title' => __("Show the help box on all custom post editing screens and on all Types create/edit pages", 'wpcf') - ), - 'by_types' => array( - '#value' => 'by_types', - '#title' => __("Show the help box only on post types that were created by Types and on all Types create/edit pages", 'wpcf') - ), - 'no' => array( - '#value' => 'no', - '#title' => __("Don't show the help box anywhere", 'wpcf') - ), - ), - '#inline' => true, - '#default_value' => $settings['help_box'], - '#pattern' => '<ELEMENT><DESCRIPTION>', - ); - $section_content = wpcf_form_simple( $form ); - - $sections['wpcf-help-box-settings'] = array( - 'slug' => 'wpcf-help-box-settings', - 'title' => __( 'Help box', 'wpcf' ), - 'content' => $section_content - ); - return $sections; -} - -add_action( 'wp_ajax_wpcf_settings_save_help_box_settings', 'wpcf_settings_save_help_box_settings' ); - -function wpcf_settings_save_help_box_settings() { - if ( ! current_user_can( 'manage_options' ) ) { - $data = array( - 'type' => 'capability', - 'message' => __( 'You do not have permissions for that.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST["wpnonce"] ) - || ! wp_verify_nonce( $_POST["wpnonce"], 'wpcf_settings_nonce' ) - ) { - $data = array( - 'type' => 'nonce', - 'message' => __( 'Your security credentials have expired. Please reload the page to get new ones.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - $settings = wpcf_get_settings(); - $keys_to_check = array( - 'help_box' => 'esc_html' - ); - $posted_settings = isset( $_POST['settings'] ) ? wp_parse_args( $_POST['settings'] ) : array(); - foreach ( $keys_to_check as $key => $validation ) { - if ( isset( $posted_settings['wpcf_' . $key] ) ) { - $settings[$key] = call_user_func( $validation, $posted_settings['wpcf_' . $key] ); - } else { - $settings[$key] = 0; - } - } - update_option('wpcf_settings', $settings); - wp_send_json_success(); -} - -add_filter( 'toolset_filter_toolset_register_settings_custom-content_section', 'wpcf_admin_settings_for_custom_field_metabox', 30 ); - -function wpcf_admin_settings_for_custom_field_metabox( $sections ) { - $settings = wpcf_get_settings(); - $section_content = ''; - $form['hide_standard_custom_fields_metabox'] = array( - '#id' => 'hide_standard_custom_fields_metabox', - '#name' => 'wpcf_hide_standard_custom_fields_metabox', - '#type' => 'radios', - '#options' => array( - 'all' => array( - '#value' => 'show', - '#title' => __('Show standard WordPress Custom Field Metabox', 'wpcf') - ), - 'by_types' => array( - '#value' => 'hide', - '#title' => __('Hide standard WordPress Custom Field Metabox', 'wpcf') - ), - ), - '#inline' => true, - '#default_value' => preg_match('/^(show|hide)$/', $settings['hide_standard_custom_fields_metabox'])? $settings['hide_standard_custom_fields_metabox']:'show', - '#pattern' => '<ELEMENT><DESCRIPTION>', - ); - $section_content = wpcf_form_simple( $form ); - - $sections['wpcf-custom-field-metabox-settings'] = array( - 'slug' => 'wpcf-custom-field-metabox-settings', - 'title' => __( 'Custom field metabox', 'wpcf' ), - 'content' => $section_content - ); - return $sections; -} - -add_action( 'wp_ajax_wpcf_settings_save_custom_field_metabox_settings', 'wpcf_settings_save_custom_field_metabox_settings' ); - -function wpcf_settings_save_custom_field_metabox_settings() { - if ( ! current_user_can( 'manage_options' ) ) { - $data = array( - 'type' => 'capability', - 'message' => __( 'You do not have permissions for that.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST["wpnonce"] ) - || ! wp_verify_nonce( $_POST["wpnonce"], 'wpcf_settings_nonce' ) - ) { - $data = array( - 'type' => 'nonce', - 'message' => __( 'Your security credentials have expired. Please reload the page to get new ones.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - $settings = wpcf_get_settings(); - $posted_settings = isset( $_POST['settings'] ) ? wp_parse_args( $_POST['settings'] ) : array(); - if ( preg_match('/^(show|hide)$/', $posted_settings['wpcf_hide_standard_custom_fields_metabox'] ) ) { - $settings['hide_standard_custom_fields_metabox'] = $posted_settings['wpcf_hide_standard_custom_fields_metabox']; - } else { - $settings['hide_standard_custom_fields_metabox'] = 'show'; - } - update_option('wpcf_settings', $settings); - wp_send_json_success(); -} - -add_filter( 'toolset_filter_toolset_register_settings_custom-content_section', 'wpcf_admin_settings_for_unfiltered_html', 40 ); - -function wpcf_admin_settings_for_unfiltered_html( $sections ) { - $settings = wpcf_get_settings(); - $section_content = ''; - $form['postmeta-unfiltered-html'] = array( - '#id' => 'postmeta_unfiltered_html', - '#name' => 'wpcf_postmeta_unfiltered_html', - '#type' => 'radios', - '#title' => __('Custom fields - unfiltered HTML', 'wpcf'), - '#options' => array( - 'on' => array( - '#value' => 'on', - '#title' => __('Allow saving unfiltered HTML in Types custom fields for users with higher roles', 'wpcf'), - ), - 'off' => array( - '#value' => 'off', - '#title' => __('Disallow saving unfiltered HTML in Types custom fields for all users', 'wpcf'), - ), - ), - '#inline' => false, - '#default_value' => $settings['postmeta_unfiltered_html'], - '#pattern' => '<TITLE><ELEMENT><DESCRIPTION>', - ); - $form['usermeta-unfiltered-html'] = array( - '#id' => 'usermeta_unfiltered_html', - '#name' => 'wpcf_usermeta_unfiltered_html', - '#type' => 'radios', - '#title' => __('Usermeta fields - unfiltered HTML', 'wpcf'), - '#options' => array( - 'on' => array( - '#value' => 'on', - '#title' => __("Allow saving unfiltered HTML in Types usermeta fields for users with higher roles", 'wpcf'), - ), - 'off' => array( - '#value' => 'off', - '#title' => __("Disallow saving unfiltered HTML in Types usermeta fields for all users", 'wpcf') - ), - ), - '#inline' => false, - '#default_value' => $settings['usermeta_unfiltered_html'], - '#pattern' => '<TITLE><ELEMENT><DESCRIPTION>', - ); - $section_content = wpcf_form_simple( $form ); - - $sections['wpcf-unfiltered-html-settings'] = array( - 'slug' => 'wpcf-unfiltered-html-settings', - 'title' => __( 'Saving unfiltered HTML for users with higher roles', 'wpcf' ), - 'content' => $section_content - ); - return $sections; -} - -add_action( 'wp_ajax_wpcf_settings_save_unfiltered_html_settings', 'wpcf_settings_save_unfiltered_html_settings' ); - -function wpcf_settings_save_unfiltered_html_settings() { - if ( ! current_user_can( 'manage_options' ) ) { - $data = array( - 'type' => 'capability', - 'message' => __( 'You do not have permissions for that.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST["wpnonce"] ) - || ! wp_verify_nonce( $_POST["wpnonce"], 'wpcf_settings_nonce' ) - ) { - $data = array( - 'type' => 'nonce', - 'message' => __( 'Your security credentials have expired. Please reload the page to get new ones.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - $settings = wpcf_get_settings(); - $keys_to_check = array( - 'postmeta_unfiltered_html', - 'usermeta_unfiltered_html' - ); - $posted_settings = isset( $_POST['settings'] ) ? wp_parse_args( $_POST['settings'] ) : array(); - foreach ( $keys_to_check as $key ) { - if ( isset( $posted_settings['wpcf_' . $key] ) ) { - if ( preg_match( '/^(on|off)$/', $posted_settings['wpcf_' . $key] ) ) { - $settings[$key] = $posted_settings['wpcf_' . $key]; - } else { - $settings[$key] = 'off'; - } - } else { - $settings[$key] = 'off'; - } - } - update_option('wpcf_settings', $settings); - wp_send_json_success(); -} - -add_filter( 'toolset_filter_toolset_register_settings_section', 'wpcf_register_settings_wpml_section', 70 ); - -function wpcf_register_settings_wpml_section( $sections ) { - $wpml_installed = apply_filters( 'wpml_setting', false, 'setup_complete' ); - if ( $wpml_installed ) { - $sections['wpml'] = array( - 'slug' => 'wpml', - 'title' => __( 'WPML integration', 'wpcf' ) - ); - } - return $sections; -} - -add_action( 'toolset_filter_toolset_register_settings_wpml_section', 'wpcf_wpml_translation_options' ); - -function wpcf_wpml_translation_options( $sections ) { - $wpml_installed = apply_filters( 'wpml_setting', false, 'setup_complete' ); - if ( $wpml_installed ) { - $settings = wpcf_get_settings(); - $form['register_translations_on_import'] = array( - '#id' => 'register_translations_on_import', - '#name' => 'wpcf_register_translations_on_import', - '#type' => 'checkbox', - '#label' => __("When importing, add texts to WPML's String Translation table", 'wpcf'), - '#inline' => true, - '#default_value' => !empty($settings['register_translations_on_import']), - '#pattern' => '<p><ELEMENT><LABEL><DESCRIPTION></p>', - ); - - $section_content = wpcf_form_simple( $form ); - - $sections['wpml-wpcf'] = array( - 'slug' => 'wpml-wpcf', - 'title' => __( 'Types and WPML integration', 'wpcf' ), - 'content' => $section_content - ); - } - return $sections; -} - -add_action( 'wp_ajax_wpcf_settings_save_wpml_settings', 'wpcf_settings_save_wpml_settings' ); - -function wpcf_settings_save_wpml_settings() { - if ( ! current_user_can( 'manage_options' ) ) { - $data = array( - 'type' => 'capability', - 'message' => __( 'You do not have permissions for that.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - if ( - ! isset( $_POST["wpnonce"] ) - || ! wp_verify_nonce( $_POST["wpnonce"], 'wpcf_settings_nonce' ) - ) { - $data = array( - 'type' => 'nonce', - 'message' => __( 'Your security credentials have expired. Please reload the page to get new ones.', 'wpcf' ) - ); - wp_send_json_error( $data ); - } - $settings = wpcf_get_settings(); - $keys_to_check = array( - 'register_translations_on_import' => 'esc_html', - ); - $posted_settings = isset( $_POST['settings'] ) ? wp_parse_args( $_POST['settings'] ) : array(); - foreach ( $keys_to_check as $key => $validation ) { - if ( isset( $posted_settings['wpcf_' . $key] ) ) { - $settings[$key] = call_user_func( $validation, $posted_settings['wpcf_' . $key] ); - } else { - $settings[$key] = 0; - } - } - update_option('wpcf_settings', $settings); - wp_send_json_success(); -} - -/** - * Adds typical header on admin pages. - * - * @param string $title - * @param string $icon_id Custom icon - * @return string - */ -function wpcf_add_admin_header($title, $add_new = false, $add_new_title = false) -{ - echo '<div class="wrap">'; - echo '<h1>', $title; - if ( !$add_new_title ) { - $add_new_title = __('Add New', 'wpcf'); - } - if ( is_array($add_new) && isset($add_new['page']) ) { - $add_button = false; - /** - * check user can? - */ - switch($add_new['page']) { - case 'wpcf-edit-type': - $add_button = WPCF_Roles::user_can_create( 'custom-post-type' ); - break; - case 'wpcf-edit-tax': - $add_button = WPCF_Roles::user_can_create( 'custom-taxonomy' ); - break; - case 'wpcf-edit': - $add_button = WPCF_Roles::user_can_create( 'custom-field' ); - break; - case 'wpcf-edit-usermeta': - $add_button = WPCF_Roles::user_can_create( 'user-meta-field' ); - break; - case WPCF_Page_Edit_Termmeta::PAGE_NAME: - $add_button = WPCF_Roles::user_can_create( 'term-field' ); - break; - } - if ( $add_button ) { - printf( - ' <a href="%s" class="add-new-h2">%s</a>', - esc_url(add_query_arg( $add_new, admin_url('admin.php'))), - $add_new_title - ); - } - } - echo '</h2>'; - $current_page = sanitize_text_field( $_GET['page'] ); - do_action( 'wpcf_admin_header' ); - do_action( 'wpcf_admin_header_' . $current_page ); -} - -/** - * Adds footer on admin pages. - * - * <b>Strongly recomended</b> if wpcf_add_admin_header() is called before. - * Otherwise invalid HTML formatting will occur. - */ -function wpcf_add_admin_footer() -{ - $current_page = sanitize_text_field( $_GET['page'] ); - do_action( 'wpcf_admin_footer_' . $current_page ); - do_action( 'wpcf_admin_footer' ); - echo '</div>'; -} - -/** - * Returns HTML formatted 'widefat' table. - * - * @param type $ID - * @param type $header - * @param type $rows - * @param type $empty_message - */ -function wpcf_admin_widefat_table( $ID, $header, $rows = array(), $empty_message = 'No results' ) -{ - if ( 'No results' == $empty_message ) { - $empty_message = __('No results', 'wpcf'); - } - $head = ''; - $footer = ''; - foreach ( $header as $key => $value ) { - $head .= '<th id="wpcf-table-' . $key . '">' . $value . '</th>' . "\r\n"; - $footer .= '<th>' . $value . '</th>' . "\r\n"; - } - echo '<table id="' . $ID . '" class="widefat" cellspacing="0"> - <thead> - <tr> - ' . $head . ' - </tr> - </thead> - <tfoot> - <tr> - ' . $footer . ' - </tr> - </tfoot> - <tbody> - '; - $row = ''; - if ( empty( $rows ) ) { - echo '<tr><td colspan="' . count( $header ) . '">' . $empty_message - . '</td></tr>'; - } else { - $i = 0; - foreach ( $rows as $row ) { - $classes = array(); - if ( $i++%2 ) { - $classes[] = 'alternate'; - } - if ( isset($row['status']) && 'inactive' == $row['status'] ) { - $classes[] = sprintf('status-%s', $row['status']); - }; - printf('<tr class="%s">', implode(' ', $classes )); - foreach ( $row as $column_name => $column_value ) { - if ( preg_match( '/^(status|raw_name)$/', $column_name )) { - continue; - } - echo '<td class="wpcf-table-column-' . $column_name . '">'; - echo $column_value; - echo '</td>' . "\r\n"; - } - echo '</tr>' . "\r\n"; - } - } - echo ' - </tbody> - </table>' . "\r\n"; -} - -/** - * Admin tabs. - * - * @param type $tabs - * @param type $page - * @param type $default - * @param type $current - * @return string - */ -function wpcf_admin_tabs($tabs, $page, $default = '', $current = '') -{ - if ( empty( $current ) && isset( $_GET['tab'] ) ) { - $current = sanitize_text_field( $_GET['tab'] ); - } else { - $current = $default; - } - $output = '<h2 class="nav-tab-wrapper">'; - foreach ( $tabs as $tab => $name ) { - $class = ( $tab == $current ) ? ' nav-tab-active' : ''; - $output .= "<a class='nav-tab$class' href='?page=$page&tab=$tab'>$name</a>"; - } - $output .= '</h2>'; - return $output; -} - -/** - * Saves open fieldsets. - * - * @param type $action - * @param type $fieldset - */ -function wpcf_admin_form_fieldset_save_toggle($action, $fieldset) -{ - $data = get_user_meta( get_current_user_id(), 'wpcf-form-fieldsets-toggle', - true ); - if ( $action == 'open' ) { - $data[$fieldset] = 1; - } elseif ( $action == 'close' ) { - unset( $data[$fieldset] ); - } - update_user_meta( get_current_user_id(), 'wpcf-form-fieldsets-toggle', $data ); -} - -/** - * Check if fieldset is saved as open. - * - * @param type $fieldset - */ -function wpcf_admin_form_fieldset_is_collapsed($fieldset) -{ - $data = get_user_meta( get_current_user_id(), 'wpcf-form-fieldsets-toggle', - true ); - if ( empty( $data ) ) { - return true; - } - return array_key_exists( $fieldset, $data ) ? false : true; -} - -/** - * Adds help on admin pages. - * - * @param type $contextual_help - * @param type $screen_id - * @param type $screen - * @return type - */ -function wpcf_admin_plugin_help($hook, $page) -{ - global $wp_version; - $call = false; - $contextual_help = ''; - $page = $page; - if ( isset( $page ) && isset( $_GET['page'] ) && $_GET['page'] == $page ) { - switch ( $page ) { - case 'wpcf-cf': - $call = 'custom_fields'; - break; - - case 'wpcf-cpt': - $call = 'post_types_list'; - break; - - case 'wpcf-ctt': - $call = 'custom_taxonomies_list'; - break; - - case 'wpcf-edit': - $call = 'edit_group'; - break; - - case 'wpcf-edit-type': - $call = 'edit_type'; - break; - - case 'wpcf-edit-tax': - $call = 'edit_tax'; - break; - - case 'wpcf': - $call = 'wpcf'; - break; - - case 'wpcf-um': - $call = 'user_fields_list'; - break; - - case 'wpcf-edit-usermeta': - $call = 'user_fields_edit'; - break; - } - } - if ( $call ) { - require_once WPCF_ABSPATH . '/help.php'; - // WP 3.3 changes - if ( version_compare( $wp_version, '3.2.1', '>' ) ) { - wpcf_admin_help_add_tabs($call, $hook, $contextual_help); - } else { - $contextual_help = wpcf_admin_help( $call, $contextual_help ); - add_contextual_help( $hook, $contextual_help ); - } - } -} - -/** - * Promo texts - * - * @todo Move! - */ -function wpcf_admin_promotional_text() -{ - $promo_tabs = get_option( '_wpcf_promo_tabs', false ); - // random selection every one hour - if ( $promo_tabs ) { - $time = time(); - $time_check = intval( $promo_tabs['time'] ) + 60 * 60; - if ( $time > $time_check ) { - $selected = mt_rand( 0, 3 ); - $promo_tabs['selected'] = $selected; - $promo_tabs['time'] = $time; - update_option( '_wpcf_promo_tabs', $promo_tabs ); - } else { - $selected = $promo_tabs['selected']; - } - } else { - $promo_tabs = array(); - $selected = mt_rand( 0, 3 ); - $promo_tabs['selected'] = $selected; - $promo_tabs['time'] = time(); - update_option( '_wpcf_promo_tabs', $promo_tabs ); - } -} - -/** - * Collapsible scripts. - */ -function wpcf_admin_load_collapsible() -{ - wp_enqueue_script( 'wpcf-collapsible', - WPCF_RES_RELPATH . '/js/collapsible.js', array('jquery'), - WPCF_VERSION ); - wp_enqueue_style( 'wpcf-collapsible', - WPCF_RES_RELPATH . '/css/collapsible.css', array(), WPCF_VERSION ); - $option = get_option( 'wpcf_toggle', array() ); - if ( !empty( $option ) ) { - $setting = 'new Array("' . implode( '", "', array_keys( $option ) ) . '")'; - wpcf_admin_add_js_settings( 'wpcf_collapsed', $setting ); - } -} - -/** - * Various delete/deactivate content actions. - * - * @param type $type - * @param type $arg - * @param type $action - */ -function wpcf_admin_deactivate_content($type, $arg, $action = 'delete') -{ - switch ( $type ) { - case 'post_type': - // Clean tax relations - if ( $action == 'delete' ) { - $custom = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() ); - foreach ( $custom as $post_type => $data ) { - if ( empty( $data['supports'] ) ) { - continue; - } - if ( array_key_exists( $arg, $data['supports'] ) ) { - unset( $custom[$post_type]['supports'][$arg] ); - $custom[$post_type][TOOLSET_EDIT_LAST] = time(); - } - } - update_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, $custom ); - } - break; - - case 'taxonomy': - // Clean post relations - if ( $action == 'delete' ) { - $post_type_option = new Types_Utils_Post_Type_Option(); - $custom = $post_type_option->get_post_types(); - foreach ( $custom as $post_type => $data ) { - if ( empty( $data['taxonomies'] ) ) { - continue; - } - if ( array_key_exists( $arg, $data['taxonomies'] ) ) { - unset( $custom[$post_type]['taxonomies'][$arg] ); - $custom[$post_type][TOOLSET_EDIT_LAST] = time(); - } - } - update_option( WPCF_OPTION_NAME_CUSTOM_TYPES, $custom ); - } - break; - - default: - break; - } -} - -/** - * Loads teasers. - * - * @param type $teasers - */ -function wpcf_admin_load_teasers($teasers) -{ - foreach ( $teasers as $teaser ) { - $file = WPCF_ABSPATH . '/plus/' . $teaser; - if ( file_exists( $file ) ) { - require_once $file; - } - } -} - -/** - * Get temporary directory - * - * @return - */ - -function wpcf_get_temporary_directory() -{ - $dir = sys_get_temp_dir(); - if ( !empty( $dir ) && is_dir( $dir ) && is_writable( $dir ) ) { - return $dir; - } - $dir = wp_upload_dir(); - $dir = $dir['basedir']; - return $dir; -} - -/** - * add types configuration to debug - */ - -function wpcf_get_extra_debug_info($extra_debug) -{ - $extra_debug['types'] = wpcf_get_settings(); - return $extra_debug; -} - -add_filter( 'icl_get_extra_debug_info', 'wpcf_get_extra_debug_info' ); - -/** - * sort helper for tables - */ -function wpcf_usort_reorder($a,$b) -{ - $orderby = (!empty($_REQUEST['orderby'])) ? sanitize_text_field( $_REQUEST['orderby'] ) : 'title'; //If no sort, default to title - $order = (!empty($_REQUEST['order'])) ? sanitize_text_field( $_REQUEST['order'] ) : 'asc'; //If no order, default to asc - if ( ! in_array( $order, array( 'asc', 'desc' ) ) ) { - $order = 'asc'; - } - if ('title' == $orderby || !isset($a[$orderby])) { - $orderby = 'slug'; - } - /** - * sort by slug if sort field is the same - */ - if ( $a[$orderby] == $b[$orderby] ) { - $orderby = 'slug'; - } - $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order - return ($order==='asc') ? $result : -$result; //Send final sort direction to usort -} - -add_filter('set-screen-option', 'wpcf_table_set_option', 10, 3); -function wpcf_table_set_option($status, $option, $value) -{ - return $value; -} - -function wpcf_admin_screen( $post_type, $form_output = '') -{ -?> -<div id="poststuff"> - <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> -<?php echo $form_output; ?> - <div id="postbox-container-1" class="postbox-container"> - <?php do_meta_boxes($post_type, 'side', null); ?> - </div> - <div id="postbox-container-2" class="postbox-container"> -<?php - do_meta_boxes($post_type, 'normal', null); - do_meta_boxes($post_type, 'advanced', null); -?> - </div> - </div> -</div> -<?php -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/bin/install-wp-tests.sh b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/bin/install-wp-tests.sh deleted file mode 100644 index 4f53355..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/bin/install-wp-tests.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash - -if [ $# -lt 3 ]; then - echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]" - exit 1 -fi - -DB_NAME=$1 -DB_USER=$2 -DB_PASS=$3 -DB_HOST=${4-localhost} -WP_VERSION=${5-latest} - -WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} -WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} - -download() { - if [ `which curl` ]; then - curl -s "$1" > "$2"; - elif [ `which wget` ]; then - wget -nv -O "$2" "$1" - fi -} - -if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then - WP_TESTS_TAG="tags/$WP_VERSION" -elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - WP_TESTS_TAG="trunk" -else - # http serves a single offer, whereas https serves multiple. we only want one - download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json - grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json - LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') - if [[ -z "$LATEST_VERSION" ]]; then - echo "Latest WordPress version could not be found" - exit 1 - fi - WP_TESTS_TAG="tags/$LATEST_VERSION" -fi - -set -ex - -install_wp() { - - if [ -d $WP_CORE_DIR ]; then - return; - fi - - mkdir -p $WP_CORE_DIR - - if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - mkdir -p /tmp/wordpress-nightly - download https://wordpress.org/nightly-builds/wordpress-latest.zip /tmp/wordpress-nightly/wordpress-nightly.zip - unzip -q /tmp/wordpress-nightly/wordpress-nightly.zip -d /tmp/wordpress-nightly/ - mv /tmp/wordpress-nightly/wordpress/* $WP_CORE_DIR - else - if [ $WP_VERSION == 'latest' ]; then - local ARCHIVE_NAME='latest' - else - local ARCHIVE_NAME="wordpress-$WP_VERSION" - fi - download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz - tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR - fi - - download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php -} - -install_test_suite() { - # portable in-place argument for both GNU sed and Mac OSX sed - if [[ $(uname -s) == 'Darwin' ]]; then - local ioption='-i .bak' - else - local ioption='-i' - fi - - # set up testing suite if it doesn't yet exist - if [ ! -d $WP_TESTS_DIR ]; then - # set up testing suite - mkdir -p $WP_TESTS_DIR - svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes - fi - - if [ ! -f wp-tests-config.php ]; then - download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php - fi - -} - -install_db() { - # parse DB_HOST for port or socket references - local PARTS=(${DB_HOST//\:/ }) - local DB_HOSTNAME=${PARTS[0]}; - local DB_SOCK_OR_PORT=${PARTS[1]}; - local EXTRA="" - - if ! [ -z $DB_HOSTNAME ] ; then - if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then - EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" - elif ! [ -z $DB_SOCK_OR_PORT ] ; then - EXTRA=" --socket=$DB_SOCK_OR_PORT" - elif ! [ -z $DB_HOSTNAME ] ; then - EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" - fi - fi - - # create database - mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA -} - -install_wp -install_test_suite -install_db diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php deleted file mode 100644 index a481598..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php +++ /dev/null @@ -1,804 +0,0 @@ -<?php -/** - * - * - */ -require_once(WPCF_EMBEDDED_TOOLSET_ABSPATH . '/toolset-common/visual-editor/editor-addon.class.php'); -require_once WPCF_EMBEDDED_ABSPATH . '/includes/post-relationship.php'; - -if ( defined( 'DOING_AJAX' ) ) { - require_once WPCF_EMBEDDED_INC_ABSPATH . '/ajax.php'; - add_action( 'wp_ajax_wpcf_ajax', 'wpcf_ajax_embedded' ); -} - -/** - * admin_init hook. - */ -function wpcf_embedded_admin_init_hook() { - // Add callbacks for post edit pages - add_action( 'load-post.php', 'wpcf_admin_edit_screen_load_hook' ); - add_action( 'load-post-new.php', 'wpcf_admin_edit_screen_load_hook' ); - - // Meta boxes hook - add_action( 'add_meta_boxes', 'wpcf_admin_add_meta_boxes', 10, 2 ); - - // Add callback for 'media-upload.php' - add_filter( 'get_media_item_args', 'wpcf_get_media_item_args_filter' ); - - // Add save_post callback - add_action( 'save_post', 'wpcf_admin_save_post_hook', 10, 2 ); - - // Add Media callback - add_action( 'add_attachment', 'wpcf_admin_save_attachment_hook', 10 ); - add_action( 'add_attachment', 'wpcf_admin_add_attachment_hook', 10 ); - add_action( 'edit_attachment', 'wpcf_admin_save_attachment_hook', 10 ); - - // Render messages - wpcf_show_admin_messages(); - - // Render JS settings - add_action( 'admin_head', 'wpcf_admin_render_js_settings' ); - - // Media insert code - if ( (isset( $_GET['context'] ) && $_GET['context'] == 'wpcf-fields-media-insert') - || (isset( $_SERVER['HTTP_REFERER'] ) - && strpos( $_SERVER['HTTP_REFERER'], - 'context=wpcf-fields-media-insert' ) !== false) - ) { - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields/file.php'; - // Add types button - add_filter( 'attachment_fields_to_edit', 'wpcf_fields_file_attachment_fields_to_edit_filter', PHP_INT_MAX, 2 ); - // Filter media TABs - add_filter( 'media_upload_tabs', 'wpcf_fields_file_media_upload_tabs_filter' ); - } - - register_post_type( TYPES_CUSTOM_FIELD_GROUP_CPT_NAME, - array( - 'public' => false, - 'label' => 'Types Groups', - 'can_export' => false, - ) - ); - register_post_type( TYPES_USER_META_FIELD_GROUP_CPT_NAME, - array( - 'public' => false, - 'label' => 'Types User Groups', - 'can_export' => false, - ) - ); - - register_post_type( - TYPES_TERM_META_FIELD_GROUP_CPT_NAME, - array( - 'public' => false, - 'label' => 'Types Term Groups', - 'can_export' => false, - ) - ); - - add_filter( 'icl_custom_fields_to_be_copied', - 'wpcf_custom_fields_to_be_copied', 10, 2 ); - - // WPML editor filters - add_filter( 'icl_editor_cf_name', 'wpcf_icl_editor_cf_name_filter' ); - add_filter( 'icl_editor_cf_description', - 'wpcf_icl_editor_cf_description_filter', 10, 2 ); - add_filter( 'icl_editor_cf_style', 'wpcf_icl_editor_cf_style_filter', 10, 2 ); - // Initialize translations - if ( function_exists( 'icl_register_string' ) - && defined( 'WPML_ST_VERSION' ) - && !get_option( 'wpcf_strings_translation_initialized', false ) ) { - wpcf_admin_bulk_string_translation(); - update_option( 'wpcf_strings_translation_initialized', 1 ); - } -} - -/** - * Add meta boxes hook. - * - * @param type $post_type - * @param type $post - * - * @since 2.2.23 Some plugins calls `add_meta_boxes` incorrectly, to prevent fatal errors it's better to avoid them and not showing Types meta boxes - */ -function wpcf_admin_add_meta_boxes( $post_type, $post = null ) { - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php'; - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields-post.php'; - - if ( $post ) { - wpcf_add_meta_boxes( $post_type, $post ); - } -} - -/** - * save_post hook. - * - * @param type $post_ID - * @param type $post - */ -function wpcf_admin_save_post_hook( $post_ID, $post ) { - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php'; - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields-post.php'; - wpcf_admin_post_save_post_hook( $post_ID, $post ); -} - -/** - * Save attachment hook. - * - * @param type $attachment_id - */ -function wpcf_admin_add_attachment_hook( $attachment_id ) -{ - $post = get_post( $attachment_id ); - wpcf_admin_post_add_attachment_hook( $attachment_id, $post ); -} - -/** - * Save attachment hook. - * - * @param type $attachment_id - */ -function wpcf_admin_save_attachment_hook( $attachment_id ) { - $post = get_post( $attachment_id ); - wpcf_admin_save_post_hook( $attachment_id, $post ); -} - -/** - * Triggers post procceses. - */ -function wpcf_admin_edit_screen_load_hook() { - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields-post.php'; - global $wpcf; - $wpcf->post = wpcf_admin_get_edited_post(); - wpcf_admin_post_init( $wpcf->post ); -} - -/** - * Add styles to admin fields groups - */ -function wpcf_admin_fields_postfields_styles(){ - - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields.php'; - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields-post.php'; - -// $groups = wpcf_admin_fields_get_groups(); - $groups = wpcf_admin_post_get_post_groups_fields( wpcf_admin_get_edited_post() ); - - if ( !empty( $groups ) ) { - echo '<style type="text/css">'; - foreach ( $groups as $group ) { - echo str_replace( "}", "}\n", - wpcf_admin_get_groups_admin_styles_by_group( $group['id'] ) ); - } - echo '</style>'; - } -} - -/** - * Add styles to userfields groups - */ -function wpcf_admin_fields_userfields_styles(){ - - require_once WPCF_EMBEDDED_INC_ABSPATH . '/usermeta-post.php'; - - -// $groups = wpcf_admin_fields_get_groups(); - $groups = wpcf_admin_usermeta_get_groups_fields(); - - if ( !empty( $groups ) ) { - echo '<style type="text/css">'; - foreach ( $groups as $key => $group ) { - echo str_replace( "}", "}\n", - wpcf_admin_get_groups_admin_styles_by_group( $group['id'] ) ); - } - echo '</style>'; - } -} - -/** @noinspection PhpUndefinedClassInspection */ - -/** - * Initiates/returns specific form. - * - * @staticvar array $wpcf_forms - * @param string $id - * @param array $form - * @return Enlimbo_Forms_Wpcf - * @deprecated Please avoid using Enlimbo forms for new code. Consider using Twig templates instead. - */ -function wpcf_form( $id, $form = array() ) { - static $wpcf_forms = array(); - - if ( isset( $wpcf_forms[ $id ] ) ) { - return $wpcf_forms[ $id ]; - } - - require_once WPCF_EMBEDDED_ABSPATH . '/classes/forms.php'; - /** @noinspection PhpUndefinedClassInspection */ - - $new_form = new Enlimbo_Forms_Wpcf(); - $new_form->autoHandle( $id, $form ); - - $wpcf_forms[ $id ] = $new_form; - - return $wpcf_forms[ $id ]; -} - -/** - * Renders form elements. - * - * @staticvar string $form - * @param array $elements - * @return array - * @deprecated Please avoid using Enlimbo forms for new code. Consider using Twig templates instead. - */ -function wpcf_form_simple( $elements ) { - static $form = NULL; - require_once WPCF_EMBEDDED_ABSPATH . '/classes/forms.php'; - if ( is_null( $form ) ) { - $form = new Enlimbo_Forms_Wpcf(); - } - return $form->renderElements( $elements ); -} - -/** - * Validates form elements (simple). - * - * @staticvar string $form - * @param type $elements - * @return type - * @deprecated Please avoid using Enlimbo forms for new code. Consider using Twig templates instead. - */ -function wpcf_form_simple_validate( &$elements ) { - static $form = NULL; - require_once WPCF_EMBEDDED_ABSPATH . '/classes/forms.php'; - if ( is_null( $form ) ) { - $form = new Enlimbo_Forms_Wpcf(); - } - $form->validate( $elements ); - return $form; -} - -/** - * Stores JS validation rules. - * - * @staticvar array $validation - * @param type $element - * @return array - * @deprecated Please avoid using Enlimbo forms for new code. Consider using Twig templates instead. - */ -function wpcf_form_add_js_validation( $element ) { - static $validation = array(); - if ( $element == 'get' ) { - $temp = $validation; - $validation = array(); - return $temp; - } - $validation[$element['#id']] = $element; -} - -/** - * Renders JS validation rules. - * - * @global type $wpcf - * @param type $selector Can be CSS class or element ID - * @param type $echo - * @return string - * @deprecated Please avoid using Enlimbo forms for new code. Consider using Twig templates instead. - */ -function wpcf_form_render_js_validation( $selector = '.wpcf-form-validate', - $echo = true ) { - $output = WPCF_Validation::renderJsonData( $selector ); - if ( $echo ) { - echo $output; - } - return $output; -} - -/** - * wpcf_custom_fields_to_be_copied - * - * Hook the copy custom fields from WPML and remove any of the fields - * that wpcf will copy. - */ -function wpcf_custom_fields_to_be_copied( $copied_fields, $original_post_id ) { - - // see if this is one of our fields. - $groups = wpcf_admin_post_get_post_groups_fields( get_post( $original_post_id ) ); - - foreach ( $copied_fields as $id => $copied_field ) { - foreach ( $groups as $group ) { - if ( isset( $group['fields'] ) && is_array( $group['fields'] ) ) { - foreach ( $group['fields'] as $field ) { - if ( $copied_field == wpcf_types_get_meta_prefix( $field ) . $field['slug'] ) { - unset( $copied_fields[$id] ); - } - } - } - } - } - return $copied_fields; -} - -/** - * Holds validation messages. - * - * @param type $method - * @return type - */ -function wpcf_admin_validation_messages( $method = false, $sprintf = '' ) { - $messages = array( - 'required' => __( 'This field is required.', 'wpcf' ), - 'email' => __( 'Please enter a valid email address.', 'wpcf' ), - 'url' => __( 'Please enter a valid URL address.', 'wpcf' ), - 'date' => __( 'Please enter a valid date.', 'wpcf' ), - 'digits' => __( 'Please enter numeric data.', 'wpcf' ), - 'number' => __( 'Please enter numeric data.', 'wpcf' ), - 'alphanumeric' => __( 'Letters, numbers, spaces or underscores only please.', 'wpcf' ), - 'nospecialchars' => __( 'Letters, numbers, spaces, underscores and dashes only please.', 'wpcf' ), - 'rewriteslug' => __( 'Letters, numbers, slashes, underscores and dashes only please.', 'wpcf' ), - 'negativeTimestamp' => __( 'Please enter a date after 1 January 1970.', 'wpcf' ), - 'maxlength' => sprintf( __( 'Maximum of %s characters exceeded.', 'wpcf' ), strval( $sprintf ) ), - 'minlength' => sprintf( __( 'Minimum of %s characters has not been reached.', 'wpcf' ), strval( $sprintf ) ), - /** - * see - * https://support.skype.com/en/faq/FA10858/what-is-a-skype-name-and-how-do-i-find-mine - */ - 'skype' => __( 'Letters, numbers, dashes, underscores, commas and periods only please.', 'wpcf' ), - ); - if ( $method ) { - return isset( $messages[$method] ) ? $messages[$method] : ''; - } - return $messages; -} - - -/** - * Sanitize admin notice. - * - * @param string $message - * @return string - */ -function wpcf_admin_message_sanitize( $message ) -{ - $allowed_tags = array( - 'a' => array( - 'href' => array(), - 'title' => array() - ), - 'br' => array(), - 'b' => array(), - 'div' => array(), - 'em' => array(), - 'i' => array(), - 'p' => array(), - 'strong' => array(), - ); - $message = wp_kses($message, $allowed_tags); - return stripslashes(html_entity_decode($message, ENT_QUOTES)); -} - -/** - * Adds admin notice. - * - * @param string $message - * @param string $class - * @param string $mode 'action'|'echo' - */ -function wpcf_admin_message( $message, $class = 'updated', $mode = 'action' ) -{ - if ( 'action' == $mode ) { - // 5.2 support for Types pre m2m. - // TODO: remove this after PHP5.2 support dropping. - if (version_compare(phpversion(), '5.3', '<')) { - add_action( 'admin_notices', - create_function( '$a=1, $class=\'' . $class . '\', $message=\'' - . htmlentities( $message, ENT_QUOTES ) . '\'', - '$screen = get_current_screen(); if (!$screen->is_network) echo "<div class=\"message $class\"><p>" . wpcf_admin_message_sanitize ($message) . "</p></div>";' ) ); - } else { - add_action( 'admin_notices', function() use ($class, $message) { - $message = htmlentities( $message, ENT_QUOTES ); - $screen = get_current_screen(); - if ( ! $screen->is_network ) { - echo '<div class="message ' . $class . '"><p>' . wpcf_admin_message_sanitize ($message) . '</p></div>'; - } - } ); - } - } elseif ( 'echo' == $mode ) { - printf( - '<div class="message %s is-dismissible"><p>%s</p> <button type="button" class="notice-dismiss"> - <span class="screen-reader-text"> - '. __( 'Dismiss this notice.' ) .' - </span> - </button></div>', - $class, - wpcf_admin_message_sanitize($message) - ); - } -} - -/** - * Shows stored messages. - */ -function wpcf_show_admin_messages($mode = 'action') -{ - $messages = get_option( 'wpcf-messages', array() ); - $messages_for_user = isset( $messages[get_current_user_id()] ) ? $messages[get_current_user_id()] : array(); - $dismissed = get_option( 'wpcf_dismissed_messages', array() ); - if ( !empty( $messages_for_user ) && is_array( $messages_for_user ) ) { - foreach( $messages_for_user as $message_id => $message ) { - if( ! in_array( $message['keep_id'], $dismissed ) ) { - wpcf_admin_message( $message['message'], $message['class'], $mode ); - } - if( empty( $message['keep_id'] ) - || in_array( $message['keep_id'], $dismissed ) - ) { - unset( $messages[ get_current_user_id() ][ $message_id ] ); - } - } - } - update_option( 'wpcf-messages', $messages ); -} - -/** - * Stores admin notices if redirection is performed. - * - * @param string $message - * @param string $class - */ -function wpcf_admin_message_store( $message, $class = 'updated', $keep_id = false ) -{ - /** - * Allow to store or note - * - * Filter allow to turn off storing messages in Types - * - * @since 1.6.6 - * - * @param boolean $var default value is true to show messages - */ - if (!apply_filters('wpcf_admin_message_store', true) ) { - return; - } - $messages = get_option( 'wpcf-messages', array() ); - $messages[get_current_user_id()][md5( $message )] = array( - 'message' => $message, - 'class' => $class, - 'keep_id' => $keep_id ? $keep_id : false, - ); - update_option( 'wpcf-messages', $messages ); -} - -/** - * Admin notice with dismiss button. - * - * @param type $ID - * @param string $message - * @param type $store - * @return boolean - */ -function wpcf_admin_message_dismiss( $ID, $message, $store = true ) { - $dismissed = get_option( 'wpcf_dismissed_messages', array() ); - if ( in_array( $ID, $dismissed ) ) { - return false; - } - $message = $message . '<div style="float:right; margin:-15px 0 0 15px;"><a onclick="jQuery(this).parent().parent().fadeOut();jQuery.get(\'' - . admin_url( 'admin-ajax.php?action=wpcf_ajax&wpcf_action=dismiss_message&id=' - . $ID . '&_wpnonce=' . wp_create_nonce( 'dismiss_message' ) ) . '\');return false;"' - . 'class="button-secondary" href="javascript:void(0);">' - . __( 'Dismiss', 'wpcf' ) . '</a></div>'; - if ( $store ) { - wpcf_admin_message_store( $message, 'updated', $ID ); - } else { - wpcf_admin_message( $message ); - } -} - -/** - * Checks if message is dismissed. - * - * @param type $message_id - * @return boolean - */ -function wpcf_message_is_dismissed( $message_id ) { - return in_array( $message_id, - (array) get_option( '_wpcf_dismissed_messages', array() ) ); -} - -/** - * Adds dismissed message to record. - * - * @param type $ID - */ -function wpcf_admin_message_set_dismissed( $ID ) { - $messages = get_option( 'wpcf_dismissed_messages', array() ); - if ( !in_array( $ID, $messages ) ) { - $messages[] = $ID; - update_option( 'wpcf_dismissed_messages', $messages ); - } -} - -/** - * Removes dismissed message from record. - * - * @param type $ID - */ -function wpcf_admin_message_restore_dismissed( $ID ) { - $messages = get_option( 'wpcf_dismissed_messages', array() ); - $key = array_search( $ID, $messages ); - if ( $key !== false ) { - unset( $messages[$key] ); - update_option( 'wpcf_dismissed_messages', $messages ); - } -} - -/** - * Saves cookie. - * - * @param type $data - */ -function wpcf_cookies_add( $data ) { - if ( isset( $_COOKIE['wpcf'] ) ) { - $data = array_merge( (array) $_COOKIE['wpcf'], $data ); - } - setcookie( 'wpcf', $data, time() + $lifetime, COOKIEPATH, COOKIE_DOMAIN ); -} - -/** - * Renders page head. - * - * @see WPCF_Template::ajax_header() - * @global type $pagenow - * @param type $title - */ -function wpcf_admin_ajax_head( $title = '' ) { - - /* - * Since Types 1.2 and WP 3.5 - * AJAX head is rendered differently - */ - global $wp_version; - if ( version_compare( $wp_version, '3.4', '>' ) ) { - // WP Header - include WPCF_EMBEDDED_ABSPATH . '/includes/ajax/admin-header.php'; - return true; - } - - global $pagenow; - $hook_suffix = $pagenow; - - ?> - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>> - <head> - <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" /> - <title><?php echo $title; ?> - - - - - - - - - - ' ) ) { - // WP Footer - do_action( 'admin_footer_wpcf_ajax' ); - include WPCF_EMBEDDED_ABSPATH . '/includes/ajax/admin-footer.php'; - return true; - } - - global $pagenow; - do_action( 'admin_footer_wpcf_ajax' ); -// do_action('admin_footer', ''); -// do_action('admin_print_footer_scripts'); -// do_action("admin_footer-" . $pagenow); - - ?> - - - - - - ID ) ) { - $post_type = get_post_type( $post ); - } else { - if ( !isset( $_GET['post_type'] ) ) { - $post_type = 'post'; - } else if ( in_array( $_GET['post_type'], - get_post_types( array('show_ui' => true) ) ) ) { - $post_type = sanitize_text_field( $_GET['post_type'] ); - } else { - $post_type = 'post'; - } - } - return $post_type; -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/bootstrap.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/bootstrap.php deleted file mode 100644 index de5fe82..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/bootstrap.php +++ /dev/null @@ -1,380 +0,0 @@ -load_sections( $toolset_common_sections ); - } - - // Loader - require_once WPCF_EMBEDDED_ABSPATH . '/classes/loader.php'; - - do_action( 'wpcf_before_init' ); - do_action( 'types_before_init' ); - - // Define necessary constants if plugin is not present - // This ones are skipped if used as embedded code! - if ( !defined( 'WPCF_VERSION' ) ) { - define( 'WPCF_VERSION', '1.9' ); - define( 'WPCF_META_PREFIX', 'wpcf-' ); - } - - // If forced embedded mode use path to __FILE__ - if ( ( defined( 'TYPES_LOAD_EMBEDDED' ) && TYPES_LOAD_EMBEDDED ) - || !defined('WPCF_RELPATH') ) { - define( 'WPCF_EMBEDDED_RELPATH', wpcf_get_file_url( __FILE__, false ) ); - } else { - define( 'WPCF_EMBEDDED_RELPATH', WPCF_RELPATH . '/embedded' ); - } - - // Define embedded paths - define( 'WPCF_EMBEDDED_INC_RELPATH', WPCF_EMBEDDED_RELPATH . '/includes' ); - define( 'WPCF_EMBEDDED_RES_RELPATH', WPCF_EMBEDDED_RELPATH . '/resources' ); - - // TODO INCLUDES! - - // Basic - /* - * - * Mind class extensions queue - */ - require_once WPCF_EMBEDDED_ABSPATH . '/classes/fields.php'; - require_once WPCF_EMBEDDED_ABSPATH . '/classes/field.php'; - require_once WPCF_EMBEDDED_ABSPATH . '/classes/usermeta_field.php'; // Added by Gen, usermeta fields class - - // Repeater - require_once WPCF_EMBEDDED_ABSPATH . '/classes/repeater.php'; - require_once WPCF_EMBEDDED_ABSPATH . '/classes/usermeta_repeater.php'; // Added by Gen, usermeta repeater class - require_once WPCF_EMBEDDED_INC_ABSPATH . '/repetitive-fields-ordering.php'; - require_once WPCF_EMBEDDED_INC_ABSPATH . '/repetitive-usermetafields-ordering.php'; - - // Relationship - require_once WPCF_EMBEDDED_ABSPATH . '/classes/relationship.php'; - - // Conditional - require_once WPCF_EMBEDDED_ABSPATH . '/classes/conditional.php'; - - // API - require_once WPCF_EMBEDDED_INC_ABSPATH . '/api.php'; - - // Validation - require_once WPCF_EMBEDDED_ABSPATH . '/classes/validation.php'; - - // Post Types - require_once WPCF_EMBEDDED_ABSPATH . '/classes/class.wpcf-post-types.php'; - - // Import Export - require_once WPCF_EMBEDDED_ABSPATH . '/classes/class.wpcf-import-export.php'; - - // Module manager - require_once WPCF_EMBEDDED_INC_ABSPATH . '/module-manager.php'; - - // WPML specific code - require_once WPCF_EMBEDDED_INC_ABSPATH . '/wpml.php'; - - // CRED specific code. - if ( defined( 'CRED_FE_VERSION' ) ) { - require_once WPCF_EMBEDDED_INC_ABSPATH . '/cred.php'; - } - - // This is a must for now. - // See if any fields need to be loaded. - // 1. Checkboxes - may be missing when submitted - require_once WPCF_EMBEDDED_INC_ABSPATH . '/fields/checkbox.php'; - - // Use this call to load basic scripts and styles if necesary - // wpcf_enqueue_scripts(); - require_once WPCF_EMBEDDED_ABSPATH . '/usermeta-init.php'; - - // Include frontend or admin code - if ( is_admin() ) { - - require_once WPCF_EMBEDDED_ABSPATH . '/admin.php'; - - /* - * TODO Check if called twice - * - * Watch this! This is actually called twice everytime - * in both modes (plugin or embedded) - */ - wpcf_embedded_admin_init_hook(); - } else { - require_once WPCF_EMBEDDED_ABSPATH . '/frontend.php'; - } - - global $wpcf; - - /* - * Consider code already there as core. - * Use hooks to add new functionalities - * - * Introduced new global object $wpcf - * Holds useful objects like: - * $wpcf->field - Field object (base item object) - * $wpcf->repeater - Repetitive field object - */ - - // Set debugging - if ( !defined( 'WPCF_DEBUG' ) ) { - define( 'WPCF_DEBUG', false ); - } else if ( WPCF_DEBUG ) { - wp_enqueue_script( 'jquery' ); - } - $wpcf->debug = new stdClass(); - require WPCF_EMBEDDED_INC_ABSPATH . '/debug.php'; - add_action( 'wp_footer', 'wpcf_debug', PHP_INT_MAX); - add_action( 'admin_footer', 'wpcf_debug', PHP_INT_MAX); - - // Set field object - $wpcf->field = new WPCF_Field(); - - // Set fields object - $wpcf->fields = new WPCF_Fields(); - - // Set usermeta field object - $wpcf->usermeta_field = new WPCF_Usermeta_Field(); - - // Set termmeta field object - $wpcf->termmeta_field = new WPCF_Termmeta_Field(); - - // Set repeater object - $wpcf->repeater = new WPCF_Repeater(); - - // Set usermeta repeater object - $wpcf->usermeta_repeater = new WPCF_Usermeta_Repeater(); - - // Set termmeta repeater object - $wpcf->termmeta_repeater = new WPCF_Termmeta_Repeater(); - - // Set relationship object - $wpcf->relationship = new WPCF_Relationship(); - - // Set conditional object - $wpcf->conditional = new WPCF_Conditional(); - - // Set validate object - $wpcf->validation = new WPCF_Validation(); - - // Set import export objects - $wpcf->import = new WPCF_Import_Export(); - $wpcf->export = new WPCF_Import_Export(); - - // Set post object - $wpcf->post = new stdClass(); - - // Set post types object - $wpcf->post_types = new WPCF_Post_Types(); - - // Define exceptions - privileged plugins and their data - $wpcf->toolset_post_types = array( - 'view', 'view-template', 'cred-form', 'cred-user-form' - ); - // 'attachment' = Media - // - $wpcf->excluded_post_types = array( - 'cred-form', - 'cred-user-form', - 'custom_css', - 'customize_changeset', - 'dd_layouts', - 'deprecated_log', - 'mediapage', - 'nav_menu_item', - 'revision', - 'view', - 'view-template', - 'wp-types-group', - 'wp-types-user-group', - 'wp-types-term-group', - 'acf-field-group', - 'acf' - ); - - /** - * Filter that allows to add own post types which will be not used in Toolset plugins. - * - * @param string[] $post_types array of post type slugs. - * @since 1.9 - */ - $wpcf->excluded_post_types = apply_filters( 'toolset_filter_exclude_own_post_types', $wpcf->excluded_post_types ); - - // Init loader - WPCF_Loader::init(); - - /* - * TODO Check why we enabled this - * - * I think because of CRED or Views using Types admin functions on frontend - * Does this need review? - */ - if ( defined( 'DOING_AJAX' ) ) { - require_once WPCF_EMBEDDED_ABSPATH . '/frontend.php'; - } - - // Check if import/export request is going on - wpcf_embedded_check_import(); - - // Initialize (new) parts of the GUI. - // Btw. current_screen is being fired during admin_init. - add_action( 'current_screen', 'wpcf_initialize_admin_gui' ); - - do_action( 'types_after_init' ); - do_action( 'wpcf_after_init' ); -} - - -/** - * Initialize parts of GUI depending on current screen. - * - * @since 1.9 - */ -function wpcf_initialize_admin_gui() { - - $screen = get_current_screen(); - - // Should be always true. - if( $screen instanceof WP_Screen ) { - if( in_array( $screen->base, array( 'edit-tags', 'term' ) ) ) { - WPCF_GUI_Term_Field_Editing::initialize(); - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/class.wpcf-import-export.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/class.wpcf-import-export.php deleted file mode 100644 index 86a24cc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/class.wpcf-import-export.php +++ /dev/null @@ -1,220 +0,0 @@ - - */ -class WPCF_Import_Export -{ - - /** - * Meta keys that are used to generate checksum. - * - * @var type - */ - var $group_meta_keys = array( - '_wpcf_conditional_display', - '_wp_types_group_fields', - '_wp_types_group_post_types', - '_wp_types_group_templates', - '_wp_types_group_terms', - ); - - /** - * Restricted data - ommited from checksum, applies to all content types. - * - * @var type - */ - var $_remove_data_keys = array('id', 'ID', 'menu_icon', 'wpml_action', - 'wpcf-post-type', 'wpcf-tax', 'hash', 'checksum'); - - /** - * Required Group meta keys - * - * @todo Make sure only this is used to fetch required meta_keys - * @return type - */ - function get_group_meta_keys() { - return $this->group_meta_keys; - } - - /** - * Fetches required meta ny meta_key - * - * @param type $group_id - * @return type - */ - function get_group_checksum_data( $group_id ) { - - $checksum = array(); - $group = wpcf_admin_fields_get_group( $group_id ); - - if ( !empty( $group ) ) { - unset( $group['slug'], $group['name'] ); - $checksum = $group; - foreach ( $this->group_meta_keys as $meta_key ) { - $meta = get_post_meta( $group['id'], $meta_key, true ); - if ( !empty( $meta ) ) { - $checksum[$meta_key] = $meta; - } - } - } - - return $checksum; - } - - /** - * Sort by key recursively. - * - * @param type $data - * @return type - */ - function ksort_by_string( $data ) { - if ( is_array( $data ) ) { - ksort( $data, SORT_STRING ); - foreach ( $data as $k => $v ) { - $data[$k] = $this->ksort_by_string( $v ); - } - } - return $data; - } - - /** - * Generates checksums for defined content types. - * - * @param type $type - * @param type $item_id - * @return type - */ - function generate_checksum( $type, $item_id = null ) { - switch ( $type ) { - case 'group': - $checksum = $this->get_group_checksum_data( $item_id ); - break; - - case 'field': - $checksum = wpcf_admin_fields_get_field( $item_id ); - ksort( $checksum, SORT_STRING ); - break; - - case 'custom_post_type': - $checksum = wpcf_get_custom_post_type_settings( $item_id ); - - break; - - case 'custom_taxonomy': - $checksum = wpcf_get_custom_taxonomy_settings( $item_id ); - break; - - default: - /* - * Enable $this->generate_checksum('test'); - */ - $checksum = $type; - break; - } - - // Unset various not wanted data - foreach ( $this->_remove_data_keys as $key ) { - if ( isset( $checksum[$key] ) ) { - unset( $checksum[$key] ); - } - - } - - //EMERSON: Remove empty conditional_display for consistent checksum computation with Module manager 1.1 during import - if (isset($checksum['data']['conditional_display'])) { - if (empty($checksum['data']['conditional_display'])) { - - unset($checksum['data']['conditional_display']); - } - } - - //EMERSON: Convert to integer value to provide correct checksum computation of this field during Module manager 1.1. import - if (isset($checksum['data']['repetitive'])) { - - $checksum['data']['repetitive']=(integer)$checksum['data']['repetitive']; - } - - //EMERSON: Remove __types_id and __types_title to provide correct checksum computation of CPT during Module manager 1.1. import - if ((isset($checksum['__types_id'])) || (isset($checksum['__types_title']))) { - - unset($checksum['__types_id']); - unset($checksum['__types_title']); - } - - //EMERSON: Change custom taxonomies data type to integer to provide correct hashes for MM 1.1. - if ((isset($checksum['taxonomies'])) && (!(empty($checksum['taxonomies'])))) { - - foreach ($checksum['taxonomies'] as $tax_module_passed_name=>$tax_module_passed_value) { - - if ($tax_module_passed_name!='category') { - - $checksum['taxonomies'][$tax_module_passed_name]=(integer)$checksum['taxonomies'][$tax_module_passed_name]; - - } - - } - - } - - return md5( maybe_serialize( $this->ksort_by_string( $checksum ) ) ); - } - - /** - * Generates and compares checksums. - * - * @param type $type - * @param type $item_id - * @param type $import_checksum Imported checksum - * @return type - */ - function checksum( $type, $item_id, $import_checksum ) { - // Generate checksum of installed content - $checksum = $this->generate_checksum( $type, $item_id ); - // Compare - return $checksum == strval( $import_checksum ); - } - - /** - * Checks if item exists. - * - * @param type $type - * @param type $item_id - * @return boolean - */ - function item_exists( $type, $item_id ) { - switch ( $type ) { - case 'group': - $check = wpcf_admin_fields_get_group( $item_id ); - break; - - case 'field': - $check = wpcf_admin_fields_get_field( $item_id ); - break; - - case 'custom_post_type': - $check = wpcf_get_custom_post_type_settings( $item_id ); - break; - - case 'custom_taxonomy': - $check = wpcf_get_custom_taxonomy_settings( $item_id ); - break; - - default: - return false; - break; - } - return !empty( $check ); - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/class.wpcf-post-types.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/class.wpcf-post-types.php deleted file mode 100644 index 6641721..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/class.wpcf-post-types.php +++ /dev/null @@ -1,460 +0,0 @@ - - */ -class WPCF_Post_Types -{ - - var $data; - var $settings; - var $messages = null; - - function __construct() - { - add_action('admin_init', array($this, 'admin_init')); - global $wp_version; - if ( version_compare( $wp_version, '4.4' ) < 0 ) { - add_action('admin_head-nav-menus.php', array($this, 'add_filters')); - add_filter('wp_setup_nav_menu_item', array( $this, 'setup_archive_item')); - add_filter('wp_nav_menu_objects', array( $this, 'maybe_make_current')); - } - } - /** - * Check has some custom fields to display. - * - * Check post type for custom fields to display on custom post edit - * screen. - * - * @since 1.7 - * - * @param array $data CPT data - * @param string $field name of field to check - * - * @return bool It has some fields? - */ - private function check_has_custom_fields($data, $field = false) - { - $value = isset($data['custom_fields']) && is_array($data['custom_fields']) && !empty($data['custom_fields']); - if ( false == $value ) { - return $value; - } - if ( true == $value && false == $field ) { - return $value; - } - return isset($data['custom_fields'][$field]); - } - - /** - * Add sort to admin table list. - * - * Add sort by custom field to admin table with list of entries - * - * @since 1.7 - * - * @param object $query QP Query object - * - */ - public function pre_get_posts($query) - { - /** - * do not run in admin - */ - if ( !is_admin() ) { - return; - } - /** - * check is main query and is set orderby and post_type - */ - if ( - $query->is_main_query() - && ( $orderby = $query->get( 'orderby' ) ) - && ( $post_type = $query->get( 'post_type' ) ) - ) { - $custom_post_types = wpcf_get_active_custom_types(); - /** - * this CPT exists as a Types CPT? - */ - if (!isset($custom_post_types[$post_type])) { - return; - } - /** - * set up meta_key if this CPT has this field to sort - */ - if ($this->check_has_custom_fields($custom_post_types[$post_type], $orderby)) { - $query->set('meta_key',$orderby); - } - } - } - - /** - * Admin init. - * - * Admin init function used to add columns.. - * - * @since 1.6.6 - */ - public function admin_init() - { - add_action('pre_get_posts', array($this, 'pre_get_posts')); - $custom_post_types = wpcf_get_active_custom_types(); - foreach( $custom_post_types as $post_type => $data ) { - if ( $this->check_has_custom_fields($data)) { - $hook = sprintf('manage_edit-%s_columns', $post_type); - add_filter($hook, array($this, 'manage_posts_columns')); - - $hook = sprintf('manage_edit-%s_sortable_columns', $post_type); - add_filter($hook, array($this, 'manage_posts_sortable_columns')); - - $hook = sprintf('manage_%s_posts_custom_column', $post_type); - add_action($hook, array($this, 'manage_custom_columns'), 10, 2); - } - } - } - - /** - * Add custom fields as a sortable columns. - * - * Add custom fields as a sortable columns on custom post admin list - * - * @since 1.7 - * - * @param array $columns Hashtable of columns; - * - * @return array Hashtable of columns; - */ - public function manage_posts_sortable_columns($columns) - { - return $this->manage_posts_columns_common($columns, 'sortable'); - } - - /** - * Add custom fields column helper. - * - * Add custom fields as a sortable columns on custom post admin list - * - * @since 1.7 - * - * @param array $columns Hashtable of columns; - * @param string $mode Work Mode. - * - * @return array Hashtable of columns; - */ - private function manage_posts_columns_common($columns, $mode = 'normal') - { - $screen = get_current_screen(); - if ( !isset( $screen->post_type) ) { - return $columns; - } - $custom_post_types = wpcf_get_active_custom_types(); - if( - !isset($custom_post_types[$screen->post_type]) - || !$this->check_has_custom_fields($custom_post_types[$screen->post_type]) - || !isset($custom_post_types[$screen->post_type]['custom_fields']) - || empty($custom_post_types[$screen->post_type]['custom_fields']) - ) { - return $columns; - } - $fields = wpcf_admin_fields_get_fields(); - - foreach( array_keys($custom_post_types[$screen->post_type]['custom_fields']) as $full_id) { - - $data = array(); - $key = null; - - foreach( $fields as $field_key => $field_data ) { - if ( !isset($field_data['meta_key']) ) { - continue; - } - if ( $full_id != $field_data['meta_key'] ) { - continue; - } - $key = $field_key; - $data = $field_data; - } - - if ( !isset($data['meta_key']) ) { - continue; - } - - if ( isset($custom_post_types[$screen->post_type]['custom_fields'][$data['meta_key']]) ) { - switch($mode) { - case 'sortable': - switch( $data['type'] ) { - /** - * turn of sorting for complex data - */ - case 'skype': - $columns[$data['meta_key']] = false;; - break; - default: - $columns[$data['meta_key']] = $data['meta_key']; - break; - } - break; - case 'normal': - default: - $columns[$data['meta_key']] = $data['name']; - break; - } - } - } - return $columns; - } - - /** - * Add custom fields as a columns. - * - * Add custom fields as a columns on custom post admin list - * - * @since 1.6.6 - * - * @param array $columns Hashtable of columns; - * - * @return array Hashtable of columns; - */ - public function manage_posts_columns($columns) - { - return $this->manage_posts_columns_common($columns, 'normal'); - } - - /** - * Show value of custom field. - * - * Show value of custom field. - * - * @since 1.6.6 - * - * @param string $column Column name, - * @param int $var Current post ID. - */ - public function manage_custom_columns($column, $post_id) - { - $value = get_post_meta($post_id, $column, true); - if ( empty($value) ) { - return; - } - $field = wpcf_admin_fields_get_field_by_meta_key($column); - if ( isset( $field['type'] ) ) { - switch( $field['type'] ) { - case 'image': - $default_width = '100px'; - /** - * Width of image. - * - * Filter allow to change default image size displayed on - * admin etry list for custom field type image. Default is - * 100px - you can change it to any proper CSS width - * definition. - * - * @since 1.7 - * - * @param string $var Default width "100px". - */ - $width = apply_filters('wpcf_field_image_max_width', $default_width); - if (empty($width)) { - $width = $default_width; - } - $value = sprintf( - '', - esc_attr($value), - esc_attr($width) - ); - break; - case 'skype': - $value = isset($value['skypename'])? $value['skypename']:''; - break; - case 'date': - require_once WPTOOLSET_FORMS_ABSPATH . '/classes/class.date.php'; - $value = WPToolset_Field_Date::timetodate($value); - break; - default: - require_once WPCF_EMBEDDED_ABSPATH . '/frontend.php'; - $value = types_render_field( $field['id'] ); - } - } - if ( is_string($value ) ) { - echo $value; - } - } - - /** - * Assign menu item the appropriate url - * @param object $menu_item - * @return object $menu_item - */ - public function setup_archive_item( $menu_item ) { - if ( $menu_item->type !== 'post_type_archive' ) { - return $menu_item; - } - $post_type = $menu_item->object; - if (post_type_exists( $post_type )) { - $data = get_post_type_object( $post_type ); - $menu_item->type_label = sprintf( __( 'Archive for %s', 'wpcf' ), $data->labels->name); - $menu_item->url = get_post_type_archive_link( $post_type ); - } - return $menu_item; - } - - public function add_filters() - { - $custom_post_types = wpcf_get_active_custom_types(); - if ( empty($custom_post_types) ) { - return; - } - foreach ( $custom_post_types as $slug => $data ) { - add_filter( 'nav_menu_items_' . $slug, array( $this, 'add_archive_checkbox' ), null, 3 ); - } - } - - public function add_archive_checkbox( $posts, $args, $post_type ) - { - if ( - is_array( $post_type ) - && isset( $post_type['args'] ) - ) { - $post_type_object = $post_type['args']; - } else { - $post_type_object = $post_type; - } - global $_nav_menu_placeholder, $wp_rewrite; - $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1; - - array_unshift( $posts, (object) array( - 'ID' => 0, - 'object_id' => $_nav_menu_placeholder, - 'post_title' => $post_type_object->labels->all_items, - 'post_type' => 'nav_menu_item', - 'post_excerpt' => '', - 'post_content' => '', - 'type' => 'post_type_archive', - 'object' => $post_type_object->slug, - ) ); - - return $posts; - } - - /** - * Make post type archive link 'current' - * @uses Post_Type_Archive_Links :: get_item_ancestors() - * @param array $items - * @return array $items - */ - public function maybe_make_current( $items ) { - foreach ( $items as $item ) { - if ( 'post_type_archive' !== $item->type ) { - continue; - } - $post_type = $item->object; - if ( - ! is_post_type_archive( $post_type ) - AND ! is_singular( $post_type ) - ) - continue; - - // Make item current - $item->current = true; - $item->classes[] = 'current-menu-item'; - - // Loop through ancestors and give them 'parent' or 'ancestor' class - $active_anc_item_ids = $this->get_item_ancestors( $item ); - foreach ( $items as $key => $parent_item ) { - $classes = (array) $parent_item->classes; - - // If menu item is the parent - if ( $parent_item->db_id == $item->menu_item_parent ) { - $classes[] = 'current-menu-parent'; - $items[ $key ]->current_item_parent = true; - } - - // If menu item is an ancestor - if ( in_array( intval( $parent_item->db_id ), $active_anc_item_ids ) ) { - $classes[] = 'current-menu-ancestor'; - $items[ $key ]->current_item_ancestor = true; - } - - $items[ $key ]->classes = array_unique( $classes ); - } - } - - return $items; - } - - /** - * Get menu item's ancestors - * @param object $item - * @return array $active_anc_item_ids - */ - public function get_item_ancestors( $item ) { - $anc_id = absint( $item->db_id ); - - $active_anc_item_ids = array(); - while ( - $anc_id = get_post_meta( $anc_id, '_menu_item_menu_item_parent', true ) - AND ! in_array( $anc_id, $active_anc_item_ids ) - ) - $active_anc_item_ids[] = $anc_id; - - return $active_anc_item_ids; - } - - function set($post_type, $settings = null) - { - $data = get_post_type_object( $post_type ); - $this->data = $data; - $this->settings = is_null( $settings ) ? $this->get_settings( $post_type ) : (array) $settings; - } - - function _get_labels($data) - { - $data = (array) $data; - return isset( $data['labels'] ) ? (object) $data['labels'] : new stdClass(); - } - - function check_singular_plural_match($data = null) - { - if ( is_null( $data ) ) { - $data = $this->data; - } - $labels = $this->_get_labels( $data ); - if ( array_key_exists( 'ignore', $labels ) && 'on' == $labels->ignore ) { - return false; - } - return strtolower( $labels->singular_name ) == strtolower( $labels->name ); - } - - function message($message_id) - { - $this->_set_messenger(); - return isset( $this->messages[$message_id] ) ? $this->messages[$message_id] : 'Howdy!'; - } - - function _set_messenger() - { - if ( is_null( $this->messages ) ) { - include dirname( __FILE__ ) . '/post-types/messages.php'; - $this->messages = $messages; - } - } - - function get_settings($post_type) - { - return wpcf_get_custom_post_type_settings( $post_type ); - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/conditional.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/conditional.php deleted file mode 100644 index ca7aa41..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/conditional.php +++ /dev/null @@ -1,221 +0,0 @@ -set($wpcf->post, wpcf_admin_fields_get_field('image')); - * - * // Use it - * $is_valid = $my_field->evaluate(); - * - * Generic instance can be found in global $wpcf. - * global $wpcf; - * $wpcf->conditional->set(...); - * - * @since Types 1.2 - * @package Types - * @subpackage Classes - * @version 0.1 - * @category core - * @author srdjan - */ -class WPCF_Conditional extends WPCF_Field -{ - - /** - * Holds all processed fields using one instance. - */ - var $collected = null; - - /** - * Holds all triggers on which check should fire. - * - * @var type - */ - var $triggers = null; - - /** - * Marks if currently processed field is valid. - * - * - * @var type - */ - var $passed = true; - - /** - * Trigger CSS class. - * @var type - */ - var $css_class_trigger = 'wpcf-conditional-check-trigger'; - - /** - * Field CSS class. - * @var type - */ - var $css_class_field = 'wpcf-conditional'; - - /** - * Evaluate object. - * - * @var type - */ - var $evaluate = null; - - function __construct() { - parent::__construct(); - } - - function set( $post, $cf ) { - parent::set( $post, $cf ); - } - - /** - * Collect all fields and conditions. - */ - function collect() { - if ( is_null( $this->triggers ) ) { - $this->collected = array(); - $this->triggers = array(); - $fields = WPCF_Fields::getFields(); - if ( is_array( $fields ) && !empty( $fields ) ) { - foreach ( $fields as $f_id => $f ) { - if ( !empty( $f['data']['conditional_display']['conditions'] ) ) { - foreach ( $f['data']['conditional_display']['conditions'] as $condition ) { - $this->collected[$f_id] = $condition; - if ( !empty( $condition['field'] ) ) { - $this->triggers[$condition['field']][$f_id][] = $condition; - } - } - } - } - } - } - } - - /** - * Checks if field is conditional. - * - * @param type $field - * @return type - */ - function is_conditional( $field = array() ) { - if ( is_array( $field ) ) { - return !empty( $field['data']['conditional_display']['conditions'] ); - } else { - $this->collect(); - $field_id = $this->__get_slug_no_prefix( strval( $field ) ); - return isset( $this->collected[$field_id] ); - } - } - - /** - * Checks if field is check trigger. - * - * @param type $field - * @return type - */ - function is_trigger( $field = array() ) { - $this->collect(); - return !empty( $this->triggers[$field['id']] ); - } - - /** - * Enqueues scripts. - */ - function add_js() { - wp_enqueue_script( 'types-conditional' ); - } - - /** - * Wraps each trigger check field with $this->css_class_trigger - * and corespondive classes. - * - * @param type $element - * @return type - */ - function wrap_trigger( $element = array() ) { - - // Set attribute class to $this->css_class_trigger - if ( isset( $element['#attributes']['class'] ) ) { - $element['#attributes']['class'] .= ' ' . $this->css_class_trigger; - } else { - $element['#attributes']['class'] = $this->css_class_trigger; - } - - /* - * - * Radios needs per option - */ - if ( $element['#type'] == 'radios' - && ( isset( $element['#options'] ) && is_array( $element['#options'] )) ) { - foreach ( $element['#options'] as $_k => $_v ) { - if ( isset( $_v['#attributes']['class'] ) ) { - $element['#options'][$_k]['#attributes']['class'] .= ' ' . $this->css_class_trigger; - } else { - $element['#options'][$_k]['#attributes']['class'] = $this->css_class_trigger; - } - } - } - - return apply_filters( 'types_conditional_field_trigger', $element, $this ); - } - - /** - * Wraps each field with $this->css_class_field and corespondive classes. - * - * @param type $element - * @return type - */ - function wrap( $element = array() ) { - if ( !empty( $element ) ) { - $passed = $this->evaluate(); - if ( !$passed ) { - $wrap = ''; - } - } - - return apply_filters( 'types_conditional_field', $element, $this ); - } - - /** - * Evaluates if check passed. - * - * @return type - */ - function evaluate() { - WPCF_Loader::loadClass( 'evaluate' ); - $this->passed = WPCF_Evaluate::evaluate( $this ); - return $this->passed; - } - - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/editor.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/editor.php deleted file mode 100644 index e4b9d5e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/editor.php +++ /dev/null @@ -1,558 +0,0 @@ - - */ -class WPCF_Editor -{ - - /** - * Settings. - * @var type - */ - private $_settings = array(); - - /** - * Active Field. - * @var type - */ - var $field = array(); - - /** - * Context (postmeta|usermeta). - * @var type - */ - private $_meta_type = 'post'; - - /** - * Post object. - * @var type - */ - private $_post; - - /** - * Collected data. - * @var type - */ - private $_data = array(); - - /** - * Construct function. - */ - function __construct() { - wp_register_script( 'types-editor', - WPCF_EMBEDDED_RES_RELPATH . '/js/editor.js', - array('jquery', 'types-knockout'), WPCF_VERSION, true ); - wp_register_style( 'types-editor', - WPCF_EMBEDDED_RES_RELPATH . '/css/editor.css', - array('admin-bar', 'wp-admin', 'buttons', 'media-views', 'font-awesome'), - WPCF_VERSION ); - wp_register_style( 'types-editor-cloned', - WPCF_EMBEDDED_RES_RELPATH . '/css/editor-cloned.css', array(), - WPCF_VERSION ); - } - - /** - * Renders Thickbox content. - * - * Field should provide callback function - * that will be called automatically. - * - * Function should be named like: - * 'wpcf_fields_' . $field_type . '_editor_callback' - * e.g. 'wpcf_fields_checkbox__editor_callback' - * - * Function should return array with elements: - * 'supports' - parameters or other feature supported, e.g. 'styling' will - * enable 'Styling' options - * - * Tabs is array with elements: - * 'menu_title' - used for menu title - * 'title' - used for main title - * 'content' - HTML content of tab - * - * @param type $field - * @param type $meta_type - * @param type $post_id - * @param string $shortcode - */ - function frame( $field, $meta_type = 'postmeta', $post_id = -1, - $shortcode = null, $callback = false, $views_meta = false ) { - - global $wp_version, $wpcf; - - // Queue rendering JS settings - add_action( 'admin_print_footer_scripts', - array($this, 'renderTedSettings'), 1 ); - - wp_enqueue_script( 'types' ); - wp_enqueue_script( 'types-knockout' ); - wp_enqueue_script( 'types-editor' ); - wp_enqueue_script( 'wp-pointer' ); - wp_enqueue_style( 'types-editor' ); - wp_enqueue_style( 'wp-pointer' ); - wp_enqueue_style( 'font-awesome' ); - - // Load cloned WP Media Modal CSS - if ( version_compare( $wp_version, '3.5', '<' ) ) { - wp_enqueue_style( 'types-editor-cloned' ); - } - - $this->field = $field; - $this->_meta_type = $meta_type; - $this->_post = get_post( $post_id ); - $this->_settings = is_null( $shortcode ) ? array() : $this->shortcodeToParameters( $shortcode ); - $this->callback = $callback; - $this->_data = array( - 'meta_type' => $meta_type, - 'field' => $field, - 'field_type_data' => WPCF_Fields::getFieldTypeData( $field['type'] ), - 'settings' => array(), - 'tabs' => array(), - 'supports' => array(), - 'post' => $this->_post, - 'post_types' => get_post_types( array('show_ui' => true) ), - 'style' => isset( $this->_settings['style'] ) ? $this->_settings['style'] : '', - 'class' => isset( $this->_settings['class'] ) ? $this->_settings['class'] : '', - 'output' => 'html', - 'user_form' => '', - ); - - // Set title if updated - if ( !is_null( $shortcode ) ) { - $this->_data['title'] = sprintf( __( 'Update %s', 'wpcf' ), - $this->_data['field_type_data']['title'] ); - $this->_data['submit_button_title'] = __( 'Update shortcode', 'wpcf' ); - } - - // Exclude post types - foreach ( $wpcf->excluded_post_types as $_post_type ) { - unset( $this->_data['post_types'][$_post_type] ); - } - - /* - * Callback - */ - $function = 'wpcf_fields_' . $field['type'] . '_editor_callback'; - if ( function_exists( $function ) ) { - // Main callback - $callback = call_user_func( $function, $field, $this->_settings, - $this->_meta_type, $this->_post ); - // Add supports - if ( !empty( $callback['supports'] ) && is_array( $callback['supports'] ) ) { - $this->_data['supports'] = $callback['supports']; - } - // Add tabs - if ( !empty( $callback['tabs'] ) && is_array( $callback['tabs'] ) ) { - $this->_data['tabs'] = $callback['tabs']; - } - // Unify settings - if ( !empty( $callback['settings'] ) && is_array( $callback['settings'] ) ) { - $this->_settings = array_merge( $this->_settings, - self::sanitizeParams( $callback['settings'], 'array' ) ); - } - } - - // If no tabs - if ( empty( $this->_data['tabs'] ) ) { - $this->_data['tabs']['display'] = array( - 'menu_title' => __( 'Display', 'wpcf' ), - 'title' => __( 'Display', 'wpcf' ), - 'content' => sprintf( __( 'There are no additional display options for the %s field.', 'wpcf' ), - $this->_data['field_type_data']['title'] ), - ); - } - - // Add User ID form - if ( $this->_meta_type == 'usermeta' ) { - if ( ! $views_meta ) { - $this->_data['supports'][] = 'user_id'; - $this->_data['user_form'] = wpcf_form_simple( wpcf_get_usermeta_form_addon( $this->_settings ) ); - } - } elseif ( $this->_meta_type == 'termmeta' ) { - if ( ! $views_meta ) { - $this->_data['supports'][] = 'term_id'; - //$this->_data['user_form'] = wpcf_form_simple( wpcf_get_usermeta_form_addon( $this->_settings ) ); - //$this->_data['supports'][] = 'user_id'; - } - } else { - // Add Post ID form - $this->_data['supports'][] = 'post_id'; - } - - // Get parents - if ( !empty( $this->_post->ID ) ) { - $this->_data['parents'] = WPCF_Relationship::get_parents( $this->_post ); - } - - // Set icons - $icons = array( - 'audio' => 'music', - 'checkbox' => 'check', - 'checkboxes' => 'checkboxes', - 'colorpicker' => 'tint', - 'date' => 'calendar', - 'email' => 'envelope-alt', - 'embed' => 'youtube-play', - 'file' => 'file-alt', - 'image' => 'picture', - 'map' => 'map-marker', - 'numeric' => 'numeric', - 'phone' => 'phone', - 'radio' => 'radio-button', - 'select' => 'select-box', - 'skype' => 'skype', - 'textarea' => 'text-area', - 'textfield' => 'text-field', - 'url' => 'link', - 'video' => 'film', - 'wysiwyg' => 'wysiwyg', - ); - $this->_data['icon_class'] = 'fa '; - if ( isset( $icons[$field['type']] ) ) { - $this->_data['icon_class'] .= sprintf( - 'fa-%s icon-%s', - $icons[$field['type']], - $icons[$field['type']] - ); - } else { - $filter = sprintf('toolset_editor_%s_icon_class', $field['type']); - $this->_data['icon_class'] .= apply_filters($filter, 'fa-text-field icon-text-field'); - } - - // Is repetitive - $this->_data['is_repetitive'] = (bool) types_is_repetitive( $field ); - /** - * Show or hide separator. - * - * Filter allow to hide separator choosing tab when we do not need - * this tab in Types shortcode GUI - * - * @since 1.9.0 - * - * @param boolean $show Show separator tab - default true. - */ - $show_separator = apply_filters('toolset_editor_show_separator_'.$field['type'], true); - if ( $show_separator && $this->_data['is_repetitive'] ) { - $this->_data['supports'][] = 'separator'; - } - - // Render header - wpcf_admin_ajax_head(); - - // Check if submitted - $this->_thickbox_check_submit(); - - // Render form - echo '
                '; - echo WPCF_Loader::view( 'editor-modal-window', $this->_data ); - wp_nonce_field( 'types_editor_frame', '__types_editor_nonce' ); - echo '
                '; - - // Render footer - wpcf_admin_ajax_footer(); - } - - /** - * Renders JS settings queued after editor.js - */ - function renderTedSettings() { - $_field = $this->field; - echo "\r\n" . "\r\n" . '' . "\r\n" . "\r\n"; - } - - /** - * Process if submitted. - * - * Field should provide callback function - * that will be called automatically. - * - * Function should be named like: - * 'wpcf_fields_' . $field_type . '_editor_submit' - * e.g. 'wpcf_fields_checkbox_editor_submit' - * - * Function should return shortcode string. - */ - function _thickbox_check_submit() { - if ( !empty( $_POST['__types_editor_nonce'] ) - && wp_verify_nonce( $_POST['__types_editor_nonce'], - 'types_editor_frame' ) ) { - - $function = 'wpcf_fields_' . strtolower( $this->field['type'] ) - . '_editor_submit'; - - $shortcode = ''; - if ( function_exists( $function ) ) { - /* - * Callback - */ - $shortcode = call_user_func( $function, $_POST, $this->field, $this->_meta_type ); - } else { - /* - * Generic - */ - if ( $this->_meta_type == 'usermeta' ) { - $add = wpcf_get_usermeta_form_addon_submit(); - $shortcode = wpcf_usermeta_get_shortcode( $this->field, $add ); - } elseif ( $this->_meta_type == 'termmeta' ) { - $add = wpcf_get_termmeta_form_addon_submit(); - $shortcode = wpcf_termmeta_get_shortcode( $this->field, $add ); - } else { - $shortcode = wpcf_fields_get_shortcode( $this->field ); - } - } - - if ( !empty( $shortcode ) ) { - /** - * remove '; - } else { - echo '

                ' - . __( 'Shortcode generation failed', 'wpcf' ) . '

                '; - } - - wpcf_admin_ajax_footer(); - die(); - } - } - - /** - * Adds additional parameters if required. - * - * @param type $shortcode - * @param type $data - * @return type - */ - function _add_parameters_to_shortcode( $shortcode, $data ) { - $raw_mode = isset( $data['raw_mode'] ) && $data['raw_mode'] == '1'; - if ( !$raw_mode ) { - if ( isset( $data['class'] ) && $data['class'] != '' ) { - $shortcode = preg_replace( '/\[types([^\]]*)/', - '$0 class="' . esc_attr(strip_tags($data['class'])) . '"', $shortcode ); - } - if ( $this->supports( 'style' ) && isset( $data['style'] ) && $data['style'] != '' ) { - $shortcode = preg_replace( '/\[types([^\]]*)/', - '$0 style="' . esc_attr(strip_tags($data['style'])) . '"', $shortcode ); - } - if ( isset( $data['output'] ) && $data['output'] == 'html' ) { - $shortcode = preg_replace( '/\[types([^\]]*)/', - '$0 output="html"', $shortcode ); - } - } - if ( !empty( $data['separator'] ) ) { - if ( $data['separator'] == 'custom' ) { - $data['separator'] = isset( $data['separator_custom'] ) ? wp_kses_post($data['separator_custom']) : ''; - } - $shortcode = preg_replace( '/\[types([^\]]*)/', - '$0 separator="' - . htmlentities( $data['separator'] ) . '"', $shortcode ); - } - if ( isset( $data['show_name'] ) && $data['show_name'] == '1' ) { - $shortcode = preg_replace( '/\[types([^\]]*)/', - '$0 show_name="true"', $shortcode ); - } - if ( isset( $data['raw_mode'] ) && $data['raw_mode'] == '1' ) { - $shortcode = preg_replace( '/\[types([^\]]*)/', '$0 output="raw"', - $shortcode ); - } - if ( isset( $data['post_id'] ) && $data['post_id'] != 'current' ) { - $post_id = 'id='; - if ( $data['post_id'] == 'post_id' ) { - $post_id .= '"' . preg_replace( '/[^\d]+/', '', $data['specific_post_id'] ) . '"'; - } else if ( $data['post_id'] == 'parent' ) { - $post_id .= '"$parent"'; - } else if ( $data['post_id'] == 'related' ) { - $post_id .= '"$' . esc_attr(trim( strval( $data['related_post'] ) )) . '"'; - } else { - $post_id .= '"' . preg_replace( '/[^\d]+/', '', $data['post_id'] ) . '"'; - } - $shortcode = preg_replace( '/\[types([^\]]*)/', '$0 ' . $post_id, - $shortcode ); - } - - // replace double quotes with single quotes types-554 - $search_for_double_quotes = array( - '#(?<=[A-z]\=)(\")#', // opening " - '#(\")(?= [A-z]{1,}\=)#', // closing " followed by another parameter - '#(\")(?=\s*\])#', // closing " for the last parameter - ); - $shortcode = preg_replace( $search_for_double_quotes, "'", $shortcode ); - - return $shortcode; - } - - /** - * Checks if feature is supported. - * - * @param type $feature - * @return type - */ - function supports( $feature ) { - return in_array( $feature, $this->_data['supports'] ); - } - - /** - * Converts shortcode string to array of parameters. - * - * @param type $shortcode - */ - function shortcodeToParameters( $shortcode ) { - - if ( !is_string( $shortcode ) ) { - return is_array( $shortcode ) ? $shortcode : array(); - } - - $params = array(); - $pattern = get_shortcode_regex(); - preg_match_all( "/$pattern/s", stripslashes( $shortcode ), $matches ); - - if ( !empty( $matches[3] ) ) { - $options = array(); - foreach ( $matches[3] as $index => $match ) { - $_params = shortcode_parse_atts( trim( $match, '[]' ) ); - switch ( $this->field['type'] ) { - case 'checkbox': - $_params['mode'] = 'db'; - if ( isset( $_params['state'] ) ) { - $_params['mode'] = 'value'; - if ( $_params['state'] == 'checked' ) { - $_params['selected'] = $matches[5][$index]; - } else if ( $_params['state'] == 'unchecked' ) { - $_params['not_selected'] = $matches[5][$index]; - } - } - $params = array_merge( $params, $_params ); - break; - - case 'checkboxes': - $_params['mode'] = isset( $_params['separator'] ) ? 'display_all' : 'db'; - if ( isset( $_params['option'] ) ) { - $_option = $_params['option']; - $_params['mode'] = 'value'; - $_params['state'] = isset( $_params['state'] ) ? $_params['state'] : 'checked'; - if ( $_params['state'] == 'unchecked' ) { - $options[$_option]['not_selected'] = $matches[5][$index]; - } else { - $options[$_option]['selected'] = $matches[5][$index]; - } - unset( $_params['option'], $_params['state'] ); - } - $params = array_merge( $params, $_params ); - break; - - case 'radio': - $_params['mode'] = 'db'; - if ( isset( $_params['option'] ) ) { - $_option = $_params['option']; - $_params['mode'] = 'value'; - $options[$_option] = $matches[5][$index]; - unset( $_params['option'] ); - } - $params = array_merge( $params, $_params ); - break; - - case 'image': - if ( isset( $_params['width'] ) || isset( $_params['height'] ) ) { - $_params['image_size'] = 'wpcf-custom'; - } - $params = array_merge( $params, $_params ); - break; - - default: - $params = shortcode_parse_atts( $matches[3][0] ); - break; - } - } - if ( !empty( $options ) ) { - $params['options'] = $options; - } - } - - if ( !is_array( $params ) ) { - return array(); - } - - while ( $next = next( $params ) ) { - $param = key( $params ); - $value = $params[$param]; - switch ( $param ) { - case 'id': - if ( is_numeric( $value ) ) { - $params['post_id'] = 'post_id'; - $params['specific_post_id'] = intval( $value ); - } else { - if ( $value === '$parent' ) { - $params['post_id'] = 'parent'; - } else if ( $value === 'current' ) { - $params['post_id'] = self::sanitizeParams( $value ); - } else { - $params['post_id'] = 'related'; - $params['related_post'] = trim( self::sanitizeParams( $value ), - '$' ); - } - } - $params[$param] = self::sanitizeParams( $value ); - break; - - case 'options': - $params[$param] = self::sanitizeParams( $value, 'array' ); - break; - - default: - $params[$param] = self::sanitizeParams( $value ); - break; - } - } - return $params; - } - - /** - * Sanitize value before writing to JS. - * - * @param type $value - * @return type - */ - public static function sanitizeParams( $value, $is_array = false ) { - if ( $is_array === 'array' && is_array( $value ) ) { - foreach ( $value as $k => $v ) { - $value[$k] = self::sanitizeParams( $v, 'array' ); - } - return $value; - } - return htmlentities( stripslashes( strval( $value ) ), ENT_QUOTES ); - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/evaluate.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/evaluate.php deleted file mode 100644 index 4924f01..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/evaluate.php +++ /dev/null @@ -1,350 +0,0 @@ - - */ -class WPCF_Evaluate -{ - - /** - * Main conditinal evaluation function. - * - * @since 1.2 - * @version 0.2 - * @param type $o - * @return boolean - */ - public static function evaluate( $o ) { - - // Set vars - $post = $o->post; - $field = $o->cf; - - /* - * - * Since Types 1.2 - * We force initial value to be FALSE. - * Better to have restricted than allowed because of sensitive data. - * If conditional is set on field and it goes wrong - better to abort - * so user can report bug without exposing his content. - */ - $passed = false; - - if ( empty( $post->ID ) ) { - /* - * - * Keep all forbidden if post is not saved. - */ - $passed = false; - /* - * - * - * - * - * - * - * - * - * - * VIEWS - * - * Custom call uses Views code - * wpv_filter_parse_date() - * wpv_condition() - */ - } else if ( isset( $field['data']['conditional_display']['custom_use'] ) ) { - /* - * - * - * More malformed forbids - */ - if ( empty( $field['data']['conditional_display']['custom'] ) ) { - return false; - } - - /* - * - * - * Filter meta values (switch them with $_POST values) - * Used by Views, Types do not need it. - */ - - if ( $o->context == 'relationship' ) { - add_filter( 'get_post_metadata', - array('WPCF_Evaluate', 'relationship_custom_statement_meta_ajax_validation_filter'), - 10, 4 ); - } else { - add_filter( 'get_post_metadata', - array('WPCF_Evaluate', 'meta_ajax_validation_filter'), - 10, 4 ); - } - do_action( 'types_custom_conditional_statement', $o ); - - /* - * - * Set statement - */ - $evaluate = trim( stripslashes( $field['data']['conditional_display']['custom'] ) ); - // Check dates - $evaluate = wpv_filter_parse_date( $evaluate ); - // Add quotes = > < >= <= === <> !== - $strings_count = preg_match_all( '/[=|==|===|<=|<==|<===|>=|>==|>===|\!===|\!==|\!=|<>]\s(?!\$)(\w*)[\)|\$|\W]/', - $evaluate, $matches ); - if ( !empty( $matches[1] ) ) { - foreach ( $matches[1] as $temp_match ) { - $temp_replace = is_numeric( $temp_match ) ? $temp_match : '\'' . $temp_match . '\''; - $evaluate = str_replace( ' ' . $temp_match . ')', - ' ' . $temp_replace . ')', $evaluate ); - } - } - preg_match_all( '/\$([^\s]*)/', - $field['data']['conditional_display']['custom'], $matches ); - - - - if ( empty( $matches ) ) { - /* - * - * If statement false - */ - $passed = false; - } else { - /* - * - * - * If statement right, check condition - */ - $fields = array(); - foreach ( $matches[1] as $field_name ) { - /* - * - * - * This field value is checked - */ - $f = wpcf_admin_fields_get_field( trim( strval( $field_name ) ) ); - if ( empty( $f ) ) { - return false; - } - - $c = new WPCF_Field(); - $c->set( $post, $f ); - - // Set field - $fields[$field_name] = $c->slug; - } - $fields['evaluate'] = $evaluate; - $check = wpv_condition( $fields, $post ); - - /* - * - * - * Views return string malformed, - * boolean if call completed. - */ - if ( !is_bool( $check ) ) { - $passed = false; - } else { - $passed = $check; - } - } - - /* - * - * - * Remove filter meta values - */ - if ( $o->context == 'relationship' ) { - remove_filter( 'get_post_metadata', - array('WPCF_Evaluate', 'relationship_custom_statement_meta_ajax_validation_filter'), - 10, 4 ); - } else { - remove_filter( 'get_post_metadata', - array('WPCF_Evaluate', 'meta_ajax_validation_filter'), - 10, 4 ); - } - } else { - /* - * - * - * - * - * - * - * - * - * TYPES - * - * If not custom code, use Types built-in check. - * wpcf_cd_admin_compare() - */ - $passed_all = true; - $passed_one = false; - - // Basic check - if ( empty( $field['data']['conditional_display']['conditions'] ) ) { - return false; - } - - // Keep count to see if OR/AND relation needed - $count = count( $field['data']['conditional_display']['conditions'] ); - - foreach ( $field['data']['conditional_display']['conditions'] as $condition ) { - /* - * - * - * Malformed condition and should be treated as forbidden - */ - if ( !isset( $condition['field'] ) || !isset( $condition['operation'] ) - || !isset( $condition['value'] ) ) { - $passed_one = false; - continue; - } - /* - * - * - * This field value is checked - */ - $f = wpcf_admin_fields_get_field( trim( strval( $condition['field'] ) ) ); - if ( empty( $f ) ) { - return false; - } - - $c = new WPCF_Field(); - $c->set( $post, $f ); - - /* - * - * Since Types 1.2 - * meta is property of WPCF_Field::$__meta - * - * BREAKPOINT - * This is where values for evaluation are set. - * Please do not allow other places - use hooks. - * - * TODO Monitor this - * 1.3 Change use of $c->_get_meta( 'POST' ) - * to $c->get_submitted_data() - */ -// $value = defined( 'DOING_AJAX' ) ? $c->_get_meta( 'POST' ) : $c->__meta; - $value = defined( 'DOING_AJAX' ) ? $c->get_submitted_data() : $c->__meta; - - /* - * - * Apply filters - */ - $value = apply_filters( 'wpcf_conditional_display_compare_meta_value', - $value, $c->cf['id'], $condition['operation'], $c->slug, - $post ); - $condition['value'] = apply_filters( 'wpcf_conditional_display_compare_condition_value', - $condition['value'], $c->cf['id'], - $condition['operation'], $c->slug, $post ); - - /* - * - * - * Call built-in Types compare func - */ - WPCF_Loader::loadInclude( 'conditional-display' ); - $passed = wpcf_cd_admin_compare( $condition['operation'], - $value, $condition['value'] ); - - if ( !$passed ) { - $passed_all = false; - } else { - $passed_one = true; - } - } - - /* - * - * - * Check OR/AND relation - */ - if ( $count > 1 ) { - if ( $field['data']['conditional_display']['relation'] == 'AND' ) { - $passed = $passed_all; - } else if ( $field['data']['conditional_display']['relation'] == 'OR' ) { - $passed = $passed_one; - } - } - } - - return (bool) $passed; - } - - /** - * Filters $_POST for relationship. - * - * @global type $wpcf - * @param type $null - * @param type $object_id - * @param type $meta_key - * @param type $single - * @return type - */ - public static function relationship_custom_statement_meta_ajax_validation_filter( $null, - $object_id, $meta_key, $single ){ - - global $wpcf; - - $value = $wpcf->relationship->get_submitted_data( - $wpcf->relationship->parent->ID, $wpcf->relationship->child->ID, - $meta_key ); - - $null = is_null( $value ) ? $null : $value; - - // Date - if ( !empty( $null ) && !empty( $field ) && $field['type'] == 'date' ) { - $time = strtotime( $null ); - if ( $time ) { - $null = $time; - } - /** - * be sure do not return string if array is expected! - */ - if ( !$single && !is_array($null) ) { - return array($null); - } - } - - return $null; - } - - /** - * Filters $_POST values for AJAX call. - * - * @param type $null - * @param type $object_id - * @param type $meta_key - * @param type $single - * @return type - */ - public static function meta_ajax_validation_filter( $null, $object_id, - $meta_key, $single ) { - $meta_key = str_replace( 'wpcf-', '', $meta_key ); - $field = wpcf_admin_fields_get_field( $meta_key ); - $value = !empty( $field ) && isset( $_POST['wpcf'][$meta_key] ) ? $_POST['wpcf'][$meta_key] : ''; - /** - * be sure do not return string if array is expected! - */ - if ( !$single && !is_array($value) ) { - return array($value); - } - return $value; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field.php deleted file mode 100644 index df35026..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field.php +++ /dev/null @@ -1,987 +0,0 @@ -set($wpcf->post, wpcf_admin_fields_get_field('image')); - * - * // Use it - * $my_field->save(); - * - * // Generic instance can be found in global $wpcf. - * global $wpcf; - * $wpcf->field->set(...); - * - * !! BE CAREFUL !! not to disturb global instance if you suspect processing - * current item is not finished. Core code sometimes use same instance over - * few functions and places. - * - * @since Types 1.2 - * @package Types - * @subpackage Classes - * @version 0.1 - * @category core - * @author srdjan - */ -class WPCF_Field -{ - - /** - * Field structure - * - * This is actually a form array collected from files per specific field: - * /embedded/includes/fields/$field_type.php - * /includes/fields/$field_type.php - * - * @var array - */ - var $cf = array(); - - /** - * All Types created fields - */ - var $fields = null; - - /** - * Field saved data - */ - var $meta = null; - - /** - * Field config. - * - * Use it to set default configuration. - * - * @var array - */ - var $config = array( - 'use_form' => false, - ); - - /** - * Form object - * @var array - */ - var $form = array(); - - /** - * Sets post - */ - var $post; - - /** - * CF slug - * @var string - */ - var $slug = ''; - - /** - * Use cache flag - * @var boolean - */ - var $use_cache = true; - - /** - * Cache.DEPRECATED - * - * @var - */ - var $cache = array(); - - /** - * Add to editor flas - * @var boolean - */ - var $add_to_editor = true; - - /** - * Context in which class is called - */ - var $context = 'group'; - - /** - * Invalid fields - * - * @todo Revise - */ - var $invalid_fields = array(); - - /** - * ID - */ - var $ID = ''; - - /** - * Unique ID - */ - var $unique_id = ''; - - function __construct( $config = array() ) { - // Parse args - extract( wp_parse_args( (array) $config, $this->config ) ); - } - - /** - * Set current post and field. - * - * @param $post - * @param $cf - * - * @return bool - */ - function set( $post, $cf ) { - - global $wpcf; - - /* - * - * Check if $cf is string - */ - if ( is_string( $cf ) ) { - WPCF_Loader::loadInclude( 'fields' ); - $_cf = wpcf_admin_fields_get_field( $this->__get_slug_no_prefix( $cf ) ); - // Check if found without prefix - if ( empty( $_cf ) ) { - $_cf = wpcf_admin_fields_get_field( $cf ); - } - if ( empty( $_cf ) ) { - /* - * TODO Check what happens if field is not found - */ - $this->_reset(); - return false; - } - $cf = $_cf; - } - - $this->post = is_integer( $post ) ? get_post( $post ) : $post; - // If empty post it is new - if ( empty( $this->post->ID ) ) { - $this->post = new stdClass(); - $this->post->ID = 0; - } - $this->ID = $cf['id']; - $this->cf = $cf; - $this->slug = wpcf_types_get_meta_prefix( $this->cf ) . $this->cf['slug']; - $this->meta = $this->_get_meta(); - $this->config = $this->_get_config(); - $this->unique_id = wpcf_unique_id( serialize( (array) $this ) ); - $this->cf['value'] = $this->meta; - - // Debug - $wpcf->debug->fields[$this->unique_id] = $this->cf; - $wpcf->debug->meta[$this->slug][] = $this->meta; - - // Load files - $this->_include_file_by_field_type($this->cf['type']); - if ( defined( 'WPCF_INC_ABSPATH' ) ) { - $file = WPCF_INC_ABSPATH . '/fields/' . preg_replace('/[^\w]+/', '', $this->cf['type']) . '.php'; - if ( file_exists( $file ) ) { - include_once $file; - } - } - } - - /** - * Reset on failure. - */ - function _reset() { - $this->ID = ''; - $this->cf = array(); - $this->post = new stdClass(); - $this->slug = ''; - $this->meta = ''; - $this->__meta = ''; - $this->config = array(); - $this->unique_id = ''; - $this->cf['value'] = ''; - } - - /** - * Set needed but not required form elements. - * - * @param string $cf - */ - function _parse_cf_form_element( $cf ) { - $p = array('#before' => '', '#after' => '', '#description' => ''); - foreach ( $p as $_p => $param ) { - if ( !isset( $cf[$_p] ) ) { - $cf[$_p] = $param; - } - } - return $cf; - } - - /** - * Fetch and sort fields. - * - * @global object $wpdb - * - */ - function _get_meta() { - global $wpdb; - - $cache_key = md5( 'field::_get_meta' . $this->post->ID . $this->slug ); - $cache_group = 'types_cache'; - $cached_object = wp_cache_get( $cache_key, $cache_group ); - if ( $this->use_cache ) { - if ( false != $cached_object && is_array( $cached_object ) && isset( $cached_object[0] ) ) {// WordPress cache - $r = $cached_object[0]; - } else { - // Cache all the postmeta for this same post - $all_postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->postmeta} WHERE post_id=%d", $this->post->ID), OBJECT ); - if ( !empty( $all_postmeta ) ) { - $cache_key_keys = array(); - foreach ( $all_postmeta as $metarow ) { - $mpid = intval($metarow->post_id); - $mkey = $metarow->meta_key; - $cache_key_keys[$mpid . $mkey][] = $metarow; - $cache_key_looped = md5( 'field::_get_meta' . $mpid . $mkey ); - if ( $mkey == $this->slug ) { - $r = $metarow; - } - } - foreach ( $cache_key_keys as $single_meta_keys => $single_meta_values ) { - $cache_key_looped_new = md5( 'field::_get_meta' . $single_meta_keys ); - wp_cache_add( $cache_key_looped_new, $single_meta_values, $cache_group );// WordPress cache - } - } - } - } else { - // If not using cache, get straight from DB single value - $r = $wpdb->get_row( - $wpdb->prepare( - "SELECT * FROM $wpdb->postmeta - WHERE post_id=%d - AND meta_key=%s", - $this->post->ID, $this->slug ) - ); - // Cache it - wp_cache_add( $cache_key, array( $r ), $cache_group );// WordPress cache - } - - // Sort meta - $meta = array(); - if ( !empty( $r ) ) { - $meta = maybe_unserialize( $r->meta_value ); - $this->meta_object = $r; - } else { - $meta = null; - $this->meta_object = new stdClass(); - $this->meta_object->meta_id = null; - $this->meta_object->meta_key = null; - $this->meta_object->meta_value = null; - } - - /* - * Secret public object :) - * Keeps original data - */ - $this->__meta = $meta; - - /* - * Apply filters - */ - $meta = apply_filters( 'wpcf_fields_value_get', $meta, $this ); - $meta = apply_filters( 'wpcf_fields_slug_' . $this->cf['slug'] . '_value_get', $meta, $this ); - $meta = apply_filters( 'wpcf_fields_type_' . $this->cf['type'] . '_value_get', $meta, $this ); - - return $meta; - } - - /** - * Gets $_POST data. - * - * @return type - */ - function get_submitted_data() { - $posted = isset( $_POST['wpcf'][$this->cf['slug']] ) ? $_POST['wpcf'][$this->cf['slug']] : null; - $value = apply_filters( 'types_field_get_submitted_data', $posted, $this ); - return $value; - } - - /** - * Save field. - * - * If $value is empty, $_POST will be checked. - * 1.3.2 Reverted saving empty fields - * removed - if ( !empty( $value ) || is_numeric( $value ) ) { - * - * @param type $value - * - * @refactoring !! Extreme spaghetti code. - */ - function save( $value = null ) - { - // If $value null, look for submitted data - if ( is_null( $value ) ) { - $value = $this->get_submitted_data(); - } - /** - * - * Since Types 1.2 - * We completely rewrite meta. - * It has no impact on frontend and covers a lot of cases - * (e.g. user change mode from single to repetitive) - * - */ - do_action('wpcf_postmeta_before_delete', $this->post, $this->cf); - delete_post_meta( $this->post->ID, $this->slug ); - do_action('wpcf_postmeta_after_delete', $this->post, $this->cf); - // Trim - if ( is_string( $value ) ) { - $value = trim( $value ); - } - /** - * setup what save to database if needed - */ - if ( - $value - && array_key_exists( 'data', $this->cf ) - && array_key_exists( 'set_value', $this->cf['data'] ) - ) { - $value = $this->cf['data']['set_value']; - } - - // Apply filters on the field value. - $original_value = $value; - unset( $value ); - $filtered_value = $this->_filter_save_postmeta_value( $original_value ); - $filtered_value = $this->_filter_save_value( $filtered_value ); - - // Save field if needed - $value_is_empty = ( is_null( $filtered_value ) || $filtered_value === false || $filtered_value === '' ); - $should_save_empty_value = ( - isset( $this->cf['data']['save_empty'] ) && 'yes' == $this->cf['data']['save_empty'] - ); - - // This is a special case where we are supposed to save zero as a value when the field is set - // (applies for checkbox, checkboxes or other boolean-ish fields). - $saving_zero_as_set_value = ( - array_key_exists( 'set_value', $this->cf['data'] ) - && preg_match( '/^0$/', $filtered_value ) - && preg_match( '/^0$/', $this->cf['data']['set_value'] ) - ); - - if ( ! $value_is_empty || $should_save_empty_value || $saving_zero_as_set_value ) { - - $mid = add_post_meta( $this->post->ID, $this->slug, $filtered_value ); - /* - * Use these hooks to add future functionality. - * Do not add any more code to core. - */ - $this->_action_save( $this->cf, $filtered_value, $mid, $original_value ); - } - } - - /** - * Apply filters to saved value. - * - * @param type $value - * @return type - */ - function _filter_save_value( $value ) - { - // Apply filters - $value = apply_filters( 'wpcf_fields_value_save', $value, $this->cf['type'], $this->cf['slug'], $this->cf, $this ); - $value = apply_filters( 'wpcf_fields_slug_' . $this->cf['slug'] . '_value_save', $value, $this->cf, $this ); - $value = apply_filters( 'wpcf_fields_type_' . $this->cf['type'] . '_value_save', $value, $this->cf, $this ); - - return $value; - } - - function _filter_save_postmeta_value( $value ) - { - $value = apply_filters( 'wpcf_fields_postmeta_value_save', $value, $this->cf['type'], $this->cf['slug'], $this->cf, $this ); - return $value; - } - - function _filter_save_usermeta_value( $value ) - { - $value = apply_filters( 'wpcf_fields_usermeta_value_save', $value, $this->cf['type'], $this->cf['slug'], $this->cf, $this ); - return $value; - } - - function _filter_save_termmeta_value( $value ) - { - $value = apply_filters( 'wpcf_fields_termmeta_value_save', $value, $this->cf['type'], $this->cf['slug'], $this->cf, $this ); - return $value; - } - - /** - * Use these hooks to add future functionality. - * Do not add any more code to core. - * - * @param type $field - * @param type $value - * @param type $meta_id - */ - function _action_save( $field, $value, $meta_id, $meta_value_original ) - { - do_action( 'wpcf_fields_save', $value, $field, $this, $meta_id, $meta_value_original ); - do_action( 'wpcf_fields_slug_' . $field['slug'] . '_save', $value, $field, $this, $meta_id, $meta_value_original ); - do_action( 'wpcf_fields_type_' . $field['type'] . '_save', $value, $field, $this, $meta_id, $meta_value_original ); - } - - /** - * Get file fullpath to include - * - * param @string $basename - * - * return @string - * - */ - function _include_file_by_field_type($basename) - { - $file = wpcf_get_fullpath_by_field_type($basename); - if ( file_exists( $file ) ) { - include_once $file; - } - return $file; - } - - /** - * Sets field config. - * - * @return type - */ - function _get_config() { - $this->_include_file_by_field_type($this->cf['type']); - $func = 'wpcf_fields_' . $this->cf['type']; - if ( is_callable( $func ) ) { - return (object) call_user_func( $func ); - } - return new stdClass(); - } - - /** - * Discouraged usage. - * - * @return type - */ - function _deprecated_inherited_allowed() { - return array( - 'image' => 'file', - 'numeric' => 'textfield', - 'email' => 'textfield', - 'phone' => 'textfield', - 'url' => 'textfield', - ); - } - - /** - * Sets field meta box form. - * - * @return type - */ - function _get_meta_form( $meta_value = null, $meta_id = null, $wrap = true ) { - - /* - * Note that field may be registered outside of Types. - * In that case, it's on developer to make sure it's loaded. - */ - $this->_include_file_by_field_type($this->cf['type']); - - /* - * Set value - * - * IMPORTANT - * Here we set values for form elements - */ - $this->cf['value'] = is_null( $meta_value ) ? $this->meta : $meta_value; - - $form = array(); - $form_meta_box = array(); - $inherited = array(); - $this->__multiple = false; - - // Open main wrapper - if ( $wrap ) { - $form['__meta_form_OPEN'] = array( - '#type' => 'markup', - '#markup' => '' - . '
                ', - ); - } - - /* - * - * - * - * - * Since Types 1.2 - * Avoid using parent (inherited) type - * $this->config->inherited_field_type - */ - // See if inherited data and merge - if ( isset( $this->config->inherited_field_type ) ) { - if ( !array_key_exists( $this->cf['type'], - $this->_deprecated_inherited_allowed() ) ) { -// _deprecated_argument( 'inherited_field_type', '1.2', -// 'Since Types 1.2 we encourage developers to completely define fields' ); - } - $file = $this->_include_file_by_field_type($this->config->inherited_field_type); - - if ( file_exists( $file ) ) { - - if ( function_exists( 'wpcf_fields_' - . $this->config->inherited_field_type - . '_meta_box_form' ) ) { - $inherited = call_user_func_array( 'wpcf_fields_' - . $this->config->inherited_field_type - . '_meta_box_form', array($this->cf, $this) ); - // If single form - convert to array of elements - if ( isset( $inherited['#type'] ) ) { - $inherited = array('wpcf_field_' . $this->unique_id => $inherited); - } - - // One value? - if ( count( $inherited ) > 1 ) { - $this->__multiple = true; - } - - $form = $form + $inherited; - } - } - } - - $func = 'wpcf_fields_' . $this->cf['type'] . '_meta_box_form'; - if ( is_callable( $func ) ) { - /* - * - * From Types 1.2 use complete form setup - */ - $form_meta_box = call_user_func_array( 'wpcf_fields_' - . $this->cf['type'] . '_meta_box_form', - array($this->cf, $this) ); - - // If single form - convert to array of elements - if ( isset( $form_meta_box['#type'] ) ) { - $form_meta_box = array('wpcf_field_' . $this->unique_id => $form_meta_box); - } - - // One value? - if ( count( $form_meta_box ) > 1 ) { - $this->__multiple = true; - } - - // Merge - $form = array_merge( $form, $form_meta_box ); - } - - if ( !empty( $form ) ) { - - // Process each field - foreach ( $form as $element_key => $element ) { - - /* - * - * Start using __ in keys to skip element - */ - // Skip protected - if ( strpos( $element_key, '__' ) === 0 ) { - $form[$element_key] = $element; - continue; - } - - // Add title and description - // TODO WPML - if ( empty( $started ) ) { - $_title = isset( $element['#title'] ) ? $element['#title'] : $this->cf['name']; - $element['#title'] = wpcf_translate( 'field ' - . $this->cf['id'] . ' name', $_title ); - - // Add asterisk for required fields - if ( isset( $this->cf['data']['validate']['required'] ) ) { - $element['#title'] .= '*'; - } - - $_description = isset( $element['#description'] ) ? $element['#description'] : $this->cf['description']; - $element['#description'] = wpautop( wpcf_translate( 'field ' - . $this->cf['id'] . ' description', - $_description ) ); - $started = true; - } - - // Set current element - $this->__current_form_element = $element; - - // Process field - $temp_processed = wpcf_admin_post_process_field( $this ); - if ( !empty( $temp_processed['element'] ) ) { - $element = $temp_processed['element']; - } - - // Set form element - $form[$element_key] = apply_filters( 'wpcf_post_edit_field', $element, $this->cf, $this->post, $this->context ); - } - - // Add to editor - if ( $this->add_to_editor ) { - wpcf_admin_post_add_to_editor( $this->cf ); - } - - $this->enqueue_script(); - $this->enqueue_style(); - } - - // Close main wrapper - if ( $wrap ) { - $form['meta_form_CLOSE'] = array( - '#type' => 'markup', - '#markup' => '' - . '
                ', - ); - } - - // Add unique IDs - foreach ( $form as $k => $v ) { - $_form[$k . '_' . $this->unique_id] = $v; - } - - return apply_filters( 'wpcf_meta_form', $_form ); - } - - /** - * Enqueue all files from config - */ - function enqueue_script( $config = null ) { - // Use internal - if ( is_null( $config ) ) { - $config = $this->config; - } - $config = (object) $config; - // Process JS - if ( !empty( $config->meta_box_js ) ) { - foreach ( $config->meta_box_js as $handle => $data_script ) { - if ( isset( $data_script['inline'] ) ) { - add_action( 'admin_footer', $data_script['inline'] ); - continue; - } - if ( !isset( $data_script['src'] ) ) { - continue; - } - $deps = isset($data_script['deps']) && !empty( $data_script['deps'] ) ? $data_script['deps'] : array(); - $in_footer = isset($data_script['in_footer']) && $data_script['in_footer']; - $ver = !empty( $data_script['ver'] ) ? $data_script['ver'] : WPCF_VERSION; - wp_enqueue_script( $handle, $data_script['src'], $deps, $ver, $in_footer); - } - } - } - - /** - * Enqueue all files from config - */ - function enqueue_style( $config = null ) { - // Use internal - if ( is_null( $config ) ) { - $config = $this->config; - } - $config = (object) $config; - if ( !empty( $config->meta_box_css ) ) { - foreach ( $config->meta_box_css as $handle => $data_script ) { - $deps = !empty( $data_script['deps'] ) ? $data_script['deps'] : array(); - if ( isset( $data_script['inline'] ) ) { - add_action( 'admin_head', $data_script['inline'] ); - continue; - } - if ( !isset( $data_script['src'] ) ) { - continue; - } - wp_enqueue_style( $handle, $data_script['src'], $deps, - WPCF_VERSION ); - } - } - } - - /** - * Use this function to add final filters to HTML output. - * - * @param type $output - */ - function html( $html, $params ) - { - /** - * check input - */ - if ( is_array($html) || is_object($html) ) { - return ''; - } - /** - * - * Exception when RAW = TRUE. - * Return unchanged value. - * - */ - if ( isset( $params['raw'] ) && $params['raw'] == 'true' ) { - return $html; - } else { - $html = stripslashes( $html ); - } - // Process shortcodes too - $html = do_shortcode( $html ); - return $html; - } - - /** - * Determines if field is created with Types. - * - * @param type $field_key - */ - function is_under_control( $field_key ) { - /* - * - * We force checking our meta prefix - */ - $key = $this->__get_slug_no_prefix( $field_key ); - return WPCF_Fields::isUnderControl( $key ); - } - - /** - * Return slug. - * - * @param type $meta_key - * @return type - */ - function __get_slug_no_prefix( $meta_key ) { - return strpos( $meta_key, WPCF_META_PREFIX ) === 0 ? substr( $meta_key, - strlen( WPCF_META_PREFIX ) ) : $meta_key; - } - - /** - * Returns altered element form name. - * - * Use $prefix to set name like: - * wpcf_post_relationship[214][wpcf-my-checkbox] - * - * Or if multi array - * wpcf_post_relationship[214][wpcf-my-date][datepicker] - * wpcf_post_relationship[214][wpcf-my-date][hour] - * - * @param type $prefix - * @param type $name - * @return type - */ - function alter_form_name( $prefix, $name ) { - $temp = explode( '[', $name ); - $temp = array_pop( $temp ); - $__name = trim( strval( $temp ), ']' ); - /* - * This means form is single-valued - */ - if ( $__name == $this->cf['slug'] ) { - return strval( $prefix ) . '[' - . $this->post->ID - . '][' . $this->slug . ']'; - /* - * - * Multi array case - */ - } else { - return strval( $prefix ) . '[' - . $this->post->ID - . '][' . $this->slug . '][' . $__name . ']'; - } - } - -} - -/* - * Usermeta Field class extends Field. - */ - -//require_once WPCF_EMBEDDED_ABSPATH . '/classes/field.php'; - - -class WPCF_Termmeta_Field extends WPCF_Field -{ - - /** - * Set current post and field. - * - * @param type $post - * @param type $cf - */ - function set( $term_id, $cf ) { - - global $wpcf; - - /* - * - * Check if $cf is string - */ - if ( is_string( $cf ) ) { - WPCF_Loader::loadInclude( 'fields' ); - $cf = types_get_field( $this->__get_slug_no_prefix( $cf ), 'termmeta' ); - if ( empty( $cf ) ) { - $this->_reset(); - return false; - } - } - - $this->term_id = $term_id; - $this->ID = $cf['id']; - $this->cf = $cf; - $this->slug = wpcf_types_get_meta_prefix( $this->cf ) . $this->cf['slug']; - $this->meta = $this->_get_meta(); - $this->config = $this->_get_config(); - $this->unique_id = wpcf_unique_id( serialize( (array) $this ) ); - $this->cf['value'] = $this->meta; - // Debug - $wpcf->debug->fieds[$this->unique_id] = $this->cf; - $wpcf->debug->meta[$this->slug][] = $this->meta; - - // Load files - if ( isset( $this->cf['type'] ) ) { - $file = WPCF_EMBEDDED_INC_ABSPATH . '/fields/' . $this->cf['type'] . '.php'; - if ( file_exists( $file ) ) { - include_once $file; - } - if ( defined( 'WPCF_INC_ABSPATH' ) ) { - $file = WPCF_INC_ABSPATH . '/fields/' . $this->cf['type'] . '.php'; - if ( file_exists( $file ) ) { - include_once $file; - } - } - } - } - - /** - * Save usermeta field. - * - * - * @param type $value - */ - function termmeta_save( $value = null ) { - - // If $value null, look for submitted data - if ( is_null( $value ) ) { - $value = $this->get_submitted_data(); - } - /* - * - * - * Since Types 1.2 - * We completely rewrite meta. - * It has no impact on frontend and covers a lot of cases - * (e.g. user change mode from single to repetitive) - */ - - delete_term_meta( $this->term_id, $this->slug ); - - - // Save - if ( !empty( $value ) || is_numeric( $value ) ) { - - // Trim - if ( is_string( $value ) ) { - $value = trim( $value ); - } - - // Apply filters - $_value = $this->_filter_save_termmeta_value( $value ); - $_value = $this->_filter_save_value( $_value ); - if ( !empty( $_value ) || is_numeric( $_value ) ) { - // Save field - $mid = update_term_meta( $this->term_id, $this->slug, $_value ); - $this->_action_save( $this->cf, $_value, $mid, $value ); - } - } - } - - /** - * Fetch and sort fields. - * - * @global object $wpdb - * - */ - function _get_meta() { - global $wpdb; - - $cache_key = md5( 'termmeta::_get_meta' . $this->term_id . $this->slug ); - $cache_group = 'types_cache'; - $cached_object = wp_cache_get( $cache_key, $cache_group ); - - if ( $this->use_cache ) { - if ( false != $cached_object && is_array( $cached_object ) && isset( $cached_object[0] ) ) {// WordPress cache - $r = $cached_object[0]; - } else { - // Cache all the postmeta for this same user - $all_termmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->termmeta} WHERE term_id=%d", $this->term_id), OBJECT ); - if ( !empty( $all_termmeta ) ) { - $cache_key_keys = array(); - foreach ( $all_termmeta as $metarow ) { - $mpid = intval($metarow->term_id); - $mkey = $metarow->meta_key; - $cache_key_keys[$mpid . $mkey][] = $metarow; - $cache_key_looped = md5( 'termmeta::_get_meta' . $mpid . $mkey ); - if ( $mkey == $this->slug ) { - $r = $metarow; - } - } - foreach ( $cache_key_keys as $single_meta_keys => $single_meta_values ) { - $cache_key_looped_new = md5( 'termmeta::_get_meta' . $single_meta_keys ); - wp_cache_add( $cache_key_looped_new, $single_meta_values, $cache_group );// WordPress cache - } - } - } - } else { - // Get straight from DB single value - $r = $wpdb->get_row( - $wpdb->prepare( - "SELECT * FROM {$wpdb->termmeta} - WHERE term_id=%d - AND meta_key=%s", - $this->term_id, $this->slug ) - ); - // Cache it - wp_cache_add( $cache_key, array( $r ), $cache_group );// WordPress cache - } - - // Sort meta - $meta = array(); - if ( !empty( $r ) ) { - $meta = maybe_unserialize( $r->meta_value ); - $this->meta_object = $r; - } else { - $meta = null; - $this->meta_object = new stdClass(); - $this->meta_object->meta_id = null; - $this->meta_object->meta_key = null; - $this->meta_object->meta_value = null; - } - - /* - * Secret public object :) - * Keeps original data - */ - $this->__meta = $meta; - - /* - * - * Apply filters - * !!! IMPORTANT !!! - * TODO Make this only place where field meta value is filtered - */ - $meta = apply_filters( 'wpcf_fields_value_get', $meta, $this ); - $meta = apply_filters( 'wpcf_fields_slug_' . $this->cf['slug'] . '_value_get', $meta, $this ); - $meta = apply_filters( 'wpcf_fields_type_' . $this->cf['type'] . '_value_get', $meta, $this ); - return $meta; - } - -} - diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/abstract.php deleted file mode 100644 index 731ea5e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/abstract.php +++ /dev/null @@ -1,81 +0,0 @@ -object_id = $object_id; - $this->meta_key = $meta_key; - $this->is_single = (bool) !$is_repetitive; - } - - - /** - * @return mixed Field value from the database. - */ - public abstract function get_raw_value(); - - - /** - * @param mixed $value New value to be saved to the database. - * @param mixed $prev_value Previous field value. Use if updating an item in a repetitive field. - * @return mixed - */ - public abstract function update_raw_value( $value, $prev_value = '' ); - - - /** - * Add new metadata. Note that if the accessor is set up for a repetitive field, the is_unique argument - * of add_*_meta should be false and otherwise it should be true. - * - * @link https://developer.wordpress.org/reference/functions/add_term_meta/ - * - * @param mixed $value New value to be saved to the database - * @return mixed - */ - public abstract function add_raw_value( $value ); - - - /** - * @return bool True, if the value is not empty. - */ - public function has_raw_value() { - $has_raw_value = $this->get_raw_value(); - $has_raw_value = ! empty( $has_raw_value ) - ? true - : false; - - return $has_raw_value; - } - - - /** - * Delete field value from the database. - * - * @param string $value Specific value to be deleted. Use if deleting an item in a repetitive field. - * @return mixed - */ - public abstract function delete_raw_value( $value = '' ); -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/dummy.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/dummy.php deleted file mode 100644 index af98fbd..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/dummy.php +++ /dev/null @@ -1,60 +0,0 @@ -object_id, $this->meta_key, false ); - } - - public function update_raw_value( $value, $prev_value = '' ) { - return update_term_meta( $this->object_id, $this->meta_key, $value, $prev_value ); - } - - - /** - * Add new metadata. - * - * @param mixed $value New value to be saved to the database - * @return mixed - */ - public function add_raw_value( $value ) { - return add_term_meta( $this->object_id, $this->meta_key, $value, $this->is_single ); - } - - - /** - * Delete field value from the database. - * - * @param string $value Specific value to be deleted. - * @return mixed - */ - public function delete_raw_value( $value = '' ) { - return delete_term_meta( $this->object_id, $this->meta_key, $value ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/termmeta_field.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/termmeta_field.php deleted file mode 100644 index b228041..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/accessor/termmeta_field.php +++ /dev/null @@ -1,55 +0,0 @@ -field = $field_instance; - } - - - public function delete_raw_value( $value = '' ) { - - $action = ( $this->field->get_definition()->get_is_repetitive() ? 'delete_repetitive' : 'delete' ); - - do_action( "wpcf_termeta_before_{$action}", $this->field ); - - $result = delete_term_meta( $this->object_id, $this->meta_key, $value ); - - do_action( "wpcf_termmeta_after_{$action}", $this->field ); - - return $result; - } - - /** - * Add new metadata. - * - * @param mixed $value New value to be saved to the database - * @return mixed - */ - public function add_raw_value( $value ) { - return add_term_meta( $this->object_id, $this->meta_key, $value, $this->is_single ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/data_saver.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/data_saver.php deleted file mode 100644 index 4cbdd47..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/data_saver.php +++ /dev/null @@ -1,151 +0,0 @@ -field = $field_instance; - $this->form_id = $form_id; - } - - - private $field_values = null; - - - /** - * Read the field values from $_POST. - * - * @return array Values in the "intermediate" format (see WPCF_Field_DataMapper_Abstract). For non-repetitive values, - * it will be an array with a single item. - */ - private function read_field_values() { - - if( null == $this->field_values ) { - $definition = $this->field->get_definition(); - - $form_data = wpcf_ensarr( wpcf_getpost( 'wpcf' ) ); - - $values = wpcf_getarr( $form_data, $definition->get_slug() ); - - // Handle single fields. - if ( ! $definition->get_is_repetitive() ) { - $values = array( $values ); - } - - // Map POST values to intermediate format. - $this->field_values = array(); - $data_mapper = $definition->get_data_mapper(); - foreach( $values as $value ) { - $this->field_values[] = $data_mapper->post_to_intermediate( $value, $form_data ); - } - } - - return wpcf_ensarr( $this->field_values ); - } - - - /** - * @return array Array of true and WP_Error, one for each field value. - */ - public function validate_field_data() { - - $field_config = Types_Field_Utils::get_toolset_forms_field_config( $this->field ); - - $this->toggle_adding_field_names_to_error_messages( false ); - - $values = $this->read_field_values(); - $results = array(); - foreach( $values as $key => $value ) { - $results[ $key ] = $this->validate_single_field_value( $field_config, $value ); - } - - $this->toggle_adding_field_names_to_error_messages( true ); - - return $results; - } - - - private function is_all_field_data_valid() { - $validation_results = $this->validate_field_data(); - foreach( $validation_results as $validation_result ) { - if( $validation_result instanceof WP_Error ) { - return false; - } - } - - return true; - } - - - /** - * Sets if toolset-forms will be adding field name to error messages (that will be returned as WP_Error objects). - * - * Default is to add field names, make sure you return to this state afterwards. - * - * @param bool $add_field_name True if field name should be added to error messages. - */ - private function toggle_adding_field_names_to_error_messages( $add_field_name ) { - if( false == $add_field_name ) { - add_filter( 'toolset_common_validation_add_field_name_to_error', '__return_false' ); - } else { - remove_filter( 'toolset_common_validation_add_field_name_to_error', '__return_false' ); - } - } - - - /** - * @param $field_config - * @param $value - * - * @return true|WP_Error - */ - private function validate_single_field_value( $field_config, $value ) { - return wptoolset_form_validate_field( $this->form_id, $field_config, $value ); - } - - - /** - * Update field value if it is valid. - * - * @return bool|WP_Error True on success, false or WP_Error on failure. - */ - public function save_field_data() { - - if( !$this->is_all_field_data_valid() ) { - return new WP_Error( 'Attempt to save a field with invalid value.' ); - } - - $values = $this->read_field_values(); - - $is_success = $this->field->update_all_values( $values ); - - return $is_success; - - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/abstract.php deleted file mode 100644 index 1c81f6b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/abstract.php +++ /dev/null @@ -1,47 +0,0 @@ -field_definition = $field_definition; - } - - - public function database_to_intermediate( $value ) { - return $value; - } - - public function intermediate_to_database( $value ) { - return $value; - } - - - /** - * @param mixed $post_value Field value as obtained from the POST data. - * @param array $form_data Complete form data. - * - * @return mixed - */ - public function post_to_intermediate( $post_value, /** @noinspection PhpUnusedParameterInspection */ $form_data ) { - return $post_value; - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/checkbox.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/checkbox.php deleted file mode 100644 index 99af602..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/checkbox.php +++ /dev/null @@ -1,28 +0,0 @@ -field_definition->get_slug(), $form_data ) ) { - // save 0 when option "When unchecked, save 0 to the database" is selected - $value = $this->field_definition->get_should_save_empty_value() ? 0 : false; - } else { - $value = $post_value; - } - return $value; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/checkboxes.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/checkboxes.php deleted file mode 100644 index b1eb3a7..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/checkboxes.php +++ /dev/null @@ -1,54 +0,0 @@ -get_type()->get_slug() != Types_Field_Type_Definition_Factory::CHECKBOXES ) { - throw new InvalidArgumentException( 'Wrong field definition type.' ); - } - } - - - /** - * Theoretically this should be placed in self::post_to_intermediate(), but toolset-forms & legacy code - * might expect the POST data instead what I think should be the intermediate format. - * - * First of all, $value is expected to be an array. If checkbox is checked, an element with its id as key and value - * will be present. In that case it will be stored in the same way. If it's not checked, we either store nothing - * or a zero, depending on the field definition setting "Save empty value". - * - * @param array|mixed $value - * - * @return array - */ - public function intermediate_to_database( $value ) { - - $options = $this->field_definition->get_field_options(); - - $result = array(); - - foreach ( $options as $option_id => $ignored ) { - $option_is_checked = isset( $value[ $option_id ] ); - - if ( $option_is_checked ) { - $result[ $option_id ] = $value[ $option_id ]; - } else if ( $this->field_definition->get_should_save_empty_value() ) { - $result[ $option_id ] = 0; - } - - } - - return $result; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/identity.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/identity.php deleted file mode 100644 index 8cfcb4c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/datamapper/identity.php +++ /dev/null @@ -1,12 +0,0 @@ -type = $type; - - if( ! $factory instanceof WPCF_Field_Definition_Factory ) { - throw new InvalidArgumentException( 'Invalid field definition factory object.' ); - } - - $this->factory = $factory; - - $this->definition_array = $this->get_type()->sanitize_field_definition_array( wpcf_ensarr( $definition_array ) ); - - $this->slug = wpcf_getarr( $this->definition_array, 'slug' ); - - if( sanitize_title( $this->slug ) != $this->slug ) { - throw new InvalidArgumentException( 'Invalid slug.' ); - } - - $this->name = sanitize_text_field( wpcf_getarr( $this->definition_array, 'name', $this->get_slug() ) ); - - } - - - - public function get_slug() { return $this->slug; } - - - public function get_name() { return $this->name; } - - - /** - * @return string Proper display name suitable for direct displaying to the user. - * - * Handles string translation and adds an asterisk if the field is required. - * - * @since 1.9 - */ - public function get_display_name() { - - // Try to translate through standard toolset-forms method - $string_name = sprintf( 'field %s name', $this->get_slug() ); - $display_name = WPToolset_Types::translate( $string_name, $this->get_name() ); - - // Add an asterisk if the field is required - if( $this->get_is_required() && !empty( $display_name ) ) { - $display_name .= '*'; - } - return $display_name; - } - - - /** - * @return string Field description as provided by the user. Sanitized. - */ - public function get_description() { return sanitize_text_field( wpcf_getarr( $this->definition_array, 'description' ) ); } - - - /** - * @return bool - * @deprecated - */ - public function is_under_types_control() { - $is_disabled = (bool) wpcf_getnest( $this->definition_array, array( 'data', 'disabled' ), false ); - return !$is_disabled; - } - - - /** - * Determine whether the field is currently under Types control. - * - * If it's not, we are only holding on to this definition in case user decides to return it to Types control in the - * future. In all other regards, such field definition should be handled as a generic one. - * - * @return bool - * @since 2.0 - */ - public function is_managed_by_types() { - return $this->is_under_types_control(); - } - - - private $meta_key = null; - - - /** - * @return string Meta_key use to store this field's values. Defaults to wpcf-$slug. - */ - public function get_meta_key() { - if( null == $this->meta_key ) { - $this->meta_key = sanitize_title( - wpcf_getarr( $this->definition_array, 'meta_key', self::FIELD_META_KEY_PREFIX . $this->get_slug() ) - ); - } - return $this->meta_key; - } - - - private $is_repetitive = null; - - - /** - * @return bool True if the field is repetitive, false otherwise. - */ - public function get_is_repetitive() { - if( null === $this->is_repetitive ) { - $this->is_repetitive = ( wpcf_getnest( $this->definition_array, array( 'data', 'repetitive' ), 0 ) != 0 ); - } - return $this->is_repetitive; - } - - - /** - * Get the underlying field definition array. - * - * Usage of this method is strongly discouraged, consider writing a custom (and safe) getter instead. - * - * @return array - */ - public function get_definition_array() { return $this->definition_array; } - - - public function get_type() { return $this->type; } - - - /** - * For binary fields (like checkbox), it is possible to specify a value that will be saved to the database - * if the field is checked/selected/whatever. - * - * Stored in $cf['data']['set_save']. - * - * @return mixed|null The value or null if none is defined (make sure to compare with ===). - * @since 1.9 - */ - public function get_forced_value() { - return wpcf_getnest( $this->definition_array, array( 'data', 'set_value' ), null ); - } - - - public function has_forced_value() { - return ( null !== $this->get_forced_value() ); - } - - - public function get_should_save_empty_value() { - return ( 'yes' == wpcf_getnest( $this->definition_array, array( 'data', 'save_empty' ), 'no' ) ); - } - - - public function get_is_required() { - return ( 1 == wpcf_getnest( $this->definition_array, array( 'data', 'validate', 'required', 'active' ), 0 ) ); - } - - - /** - * Retrieve an array of option definitions. - * - * Allowed only for the checkboxes, radio and select field types. - * - * @throws RuntimeException when the field type is invalid - * @throws InvalidArgumentException when option definitions are corrupted - * @return WPCF_Field_Option_Checkboxes[] An option_id => option_data array. - * @since 1.9 - */ - public function get_field_options() { - $this->check_allowed_types( - array( - Types_Field_Type_Definition_Factory::CHECKBOXES, - Types_Field_Type_Definition_Factory::RADIO, - Types_Field_Type_Definition_Factory::SELECT - ) - ); - $options_definition = wpcf_ensarr( wpcf_getnest( $this->definition_array, array( 'data', 'options' ) ) ); - $results = array(); - - // The 'default' key can be present, we have to remove it so it's not handled as another option. - $has_default = array_key_exists( 'default', $options_definition ); - $default = wpcf_getarr( $options_definition, 'default', 'no-default' ); - if( $has_default ) { - unset( $options_definition[ 'default' ] ); - } - - foreach( $options_definition as $option_id => $option_config ) { - try { - switch( $this->get_type()->get_slug() ) { - case Types_Field_Type_Definition_Factory::RADIO: - $option = new WPCF_Field_Option_Radio( $option_id, $option_config, $default, $this ); - break; - case Types_Field_Type_Definition_Factory::SELECT: - $option = new WPCF_Field_Option_Select( $option_id, $option_config, $default, $this ); - break; - case Types_Field_Type_Definition_Factory::CHECKBOXES: - $option = new WPCF_Field_Option_Checkboxes( $option_id, $option_config, $default ); - break; - default: - throw new InvalidArgumentException( 'Invalid field type' ); - } - $results[ $option_id ] = $option; - } catch( Exception $e ) { - // Corrupted data, can't do anything but skip the option. - } - } - return $results; - } - - - /** - * Determines whether the field should display both time and date or date only. - * - * Allowed field type: date. - * - * @throws RuntimeException - * @return string 'date'|'date_and_time' (note that for 'date_and_time' the actual value stored is 'and_time', - * we're translating it to sound more sensible) - * @since 1.9.1 - */ - public function get_datetime_option() { - $this->check_allowed_types( Types_Field_Type_Definition_Factory::DATE ); - $value = wpcf_getnest( $this->definition_array, array( 'data', 'date_and_time' ) ); - return ( 'and_time' == $value ? 'date_and_time' : 'date' ); - } - - - - /** - * Get an accessor for a specific field instance. - * - * @param WPCF_Field_Instance $field_instance Instance of the field the accessor should access. - * @return WPCF_Field_Accessor_Abstract - */ - public abstract function get_accessor( $field_instance ); - - - /** - * @return Types_Field_Group[] - */ - public function get_associated_groups() { - $field_groups = $this->get_factory()->get_group_factory()->query_groups(); - $associated_groups = array(); - foreach ( $field_groups as $field_group ) { - if ( $field_group->contains_field_definition( $this ) ) { - $associated_groups[] = $field_group; - } - } - - return $associated_groups; - } - - - /** - * Determine whether this field belongs to a specific group. - * - * @param Types_Field_Group $field_group - * @return bool - * @since 2.1 - */ - public function belongs_to_group( $field_group ) { - $associated_groups = $this->get_associated_groups(); - foreach( $associated_groups as $associated_group ) { - if( $associated_group === $field_group ) { - return true; - } - } - - return false; - } - - - - /** - * Get a mapper object that helps translating field data between database and rest of Types. - * - * Note: This happens here and not in field type definition because the information about field type might not - * be enough in the future. - * - * @todo This should probably be provided by type definition, no switch should be here. - * - * @return WPCF_Field_DataMapper_Abstract - */ - public function get_data_mapper() { - switch( $this->get_type()->get_slug() ) { - case Types_Field_Type_Definition_Factory::CHECKBOXES: - return new WPCF_Field_DataMapper_Checkboxes( $this ); - case Types_Field_Type_Definition_Factory::CHECKBOX: - return new WPCF_Field_DataMapper_Checkbox( $this ); - default: - return new WPCF_Field_DataMapper_Identity( $this ); - } - } - - - /** - * Delete all field values! - * - * @return bool - */ - public abstract function delete_all_fields(); - - - /** - * Throw a RuntimeException if current field type doesn't match the list of allowed ones. - * - * @param string|string[] $allowed_field_types Field type slugs - * @throws RuntimeException - * @since 1.9.1 - */ - protected function check_allowed_types( $allowed_field_types ) { - - $allowed_field_types = wpcf_wraparr( $allowed_field_types ); - - if( !in_array( $this->type->get_slug(), $allowed_field_types ) ) { - throw new RuntimeException( - sprintf( - 'Invalid operation for this field type "%s", expected one of the following: %s.', - $this->type->get_slug(), - implode( ', ', $allowed_field_types ) - ) - ); - } - } - - - /** - * @inheritdoc - * - * Adds properties: type, isRepetitive - * - * @return array - * @since 2.0 - */ - public function to_json() { - $object_data = parent::to_json(); - - $additions = array( - 'type' => $this->get_type()->get_slug(), - 'isRepetitive' => $this->get_is_repetitive(), - 'metaKey' => $this->get_meta_key() - ); - - return array_merge( $object_data, $additions ); - } - - - const XML_KEY_ID = 'id'; - const XML_KEY_MENU_ICON = 'menu_icon'; - const XML_KEY_WPML_ACTION = 'wpml_action'; - const XML_KEY_DATA = 'data'; - const XML_KEY_DATA_CONDITIONAL_DISPLAY = 'conditional_display'; - const XML_KEY_DATA_IS_REPEATING = 'repetitive'; - const XML_KEY_DATA_SUBMIT_KEY = 'submit-key'; - - - /** - * Add checksum to an export object, with some custom adjustments for compatibility with - * older Module Manager versions. - * - * @param array $data - * @return array Updated $data with checksum information. - * @since 2.1 - */ - private function add_checksum_to_export_object( $data ) { - - $checksum_source = $data; - - $ie_controller = Types_Import_Export::get_instance(); - - // Consider if this should go into the generic sanitization: - - // Remove *empty* conditional_display for consistent checksum computation with Module manager 1.1 during import. - $conditional_display = wpcf_getnest( $checksum_source, array( self::XML_KEY_DATA, self::XML_KEY_DATA_CONDITIONAL_DISPLAY ), null ); - if( null !== $conditional_display && empty( $conditional_display ) ) { - unset( $checksum_source[ self::XML_KEY_DATA ][ self::XML_KEY_DATA_CONDITIONAL_DISPLAY ] ); - } - - // Convert to integer value to provide correct checksum computation of this field during Module manager 1.1. import. - $checksum_source[ self::XML_KEY_DATA ][ self::XML_KEY_DATA_IS_REPEATING ] = - (int) wpcf_getnest( $checksum_source, array( self::XML_KEY_DATA, self::XML_KEY_DATA_IS_REPEATING ), 0 ); - - $checksum_source = $ie_controller->add_checksum_to_object( - $checksum_source, - null, - array( - self::XML_KEY_ID, self::XML_KEY_MENU_ICON, self::XML_KEY_WPML_ACTION, - self::XML_KEY_DATA => array( self::XML_KEY_DATA_SUBMIT_KEY ) - ) - ); - - $data[ Types_Import_Export::XML_KEY_CHECKSUM ] = $checksum_source[ Types_Import_Export::XML_KEY_CHECKSUM ]; - $data[ Types_Import_Export::XML_KEY_HASH ] = $checksum_source[ Types_Import_Export::XML_KEY_HASH ]; - - return $data; - } - - - /** - * Create an export object for this field definition, including checksums and annotations. - * - * @return array - * @since 2.1 - */ - public function get_export_object() { - - $data = $this->get_definition_array(); - - // legacy filter - $data = apply_filters( 'wpcf_export_field', $data ); - - $ie_controller = Types_Import_Export::get_instance(); - - $data = $this->add_checksum_to_export_object( $data ); - - $data = $ie_controller->annotate_object( $data, $this->get_name(), $this->get_slug() ); - - // Export WPML TM setting for this field's translation, if available. - $wpml_tm_settings = apply_filters( 'wpml_setting', null, 'translation-management' ); - $custom_field_translation_setting = wpcf_getnest( $wpml_tm_settings, array( 'custom_fields_translation', $this->get_meta_key() ), null ); - if( null !== $custom_field_translation_setting ) { - $data[ self::XML_KEY_WPML_ACTION ] = $custom_field_translation_setting; - } - - return $data; - } - - - /** - * @return WPCF_Field_Definition_Factory Factory object that is responsible for creating this object. - * @since 2.0 - */ - public function get_factory() { - return $this->factory; - } - - - /** - * Change type of this field definition. - * - * @param Types_Field_Type_Definition $target_type One of the allowed field types to convert to. - * @throws InvalidArgumentException when $target_type is not a field type definition. - * @return bool True if the conversion was successful, false otherwise. - * @since 2.0 - */ - public function change_type( $target_type ) { - - if( ! $target_type instanceof Types_Field_Type_Definition ) { - throw new InvalidArgumentException( 'Not a field type definition' ); - } - - if( ! Types_Field_Type_Converter::get_instance()->is_conversion_possible( $this->get_type(), $target_type ) ) { - return false; - } - - if( $this->get_is_repetitive() && !$target_type->can_be_repetitive() ) { - return false; - } - - // We need to immediately update this model. - $this->type = $target_type; - - $this->definition_array['type'] = $target_type->get_slug(); - - return $this->update_self(); - } - - - /** - * Convenience method for updating field definition in database after making some changes. - * - * @return bool True on success. - * @since 2.0 - */ - private function update_self() { - $this->definition_array = $this->get_type()->sanitize_field_definition_array( $this->get_definition_array() ); - $is_success = $this->get_factory()->update_definition( $this ); - return $is_success; - } - - - /** - * Convenience method for setting a 'data' attribute to the definition array safely. - * - * @param string $key - * @param mixed $value - * @since 2.0 - */ - private function set_data_key_safely( $key, $value ) { - if( !is_array( wpcf_getarr( $this->definition_array, 'data' ) ) ) { - $this->definition_array['data'] = array(); - } - $this->definition_array['data'][ $key ] = $value; - } - - - /** - * Set whether this field definition will be managed by Types or not. - * - * @param bool $is_managed - * @return bool True if the update was successful. - * @since 2.0 - */ - public function set_types_management_status( $is_managed ) { - $this->set_data_key_safely( 'disabled', ( $is_managed ? 0 : 1 ) ); - return $this->update_self(); - } - - - /** - * Set whether this will be a repeating or single field. - * - * Note that this has serious implications for already stored values. - * - * @param bool $is_repetitive - * @return bool True if the update was successful - * @since 2.0 - */ - public function set_is_repetitive( $is_repetitive ) { - $this->set_data_key_safely( 'repetitive', ( $is_repetitive ? 1 : 0 ) ); - return $this->update_self(); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_abstract.php deleted file mode 100644 index 46b458e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_abstract.php +++ /dev/null @@ -1,100 +0,0 @@ -get_name() ) - || Types_Utils::is_string_match( $search_string, $this->get_slug() ) - ); - } - - - /** - * @return string[] Slugs of field groups where this field belongs to. - * @since 2.1 - */ - private function get_group_slugs() { - $groups = $this->get_associated_groups(); - $group_slugs = array(); - foreach( $groups as $group ) { - $group_slugs[] = $group->get_slug(); - } - return $group_slugs; - } - - - /** - * Get field definition data as an associative array for coversion to JSON. - * - * Doesn't return the JSON string directly because child classes may reuse this method and add their own - * properties. - * - * Guaranteed properties are: isUnderTypesControl, slug, displayName, groups. - * - * @return array - * @since 2.0 - */ - public function to_json() { - - $object_data = array( - 'isUnderTypesControl' => $this->is_under_types_control(), - 'slug' => $this->get_slug(), - 'metaKey' => $this->get_slug(), - 'displayName' => stripslashes( $this->get_name() ), - 'groups' => $this->get_group_slugs() - ); - - return $object_data; - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory.php deleted file mode 100644 index 0a7c65a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory.php +++ /dev/null @@ -1,695 +0,0 @@ -field_definitions ) ) { - - // Get all field definitions for the option name we're using. No performance worries, it uses caching. - $fields_from_options = $this->get_fields_from_options(); - $field_configuration = null; - if( in_array( $field_key, array_keys( $fields_from_options ) ) ) { - $field_configuration = $fields_from_options[ $field_key ]; - } else { - - // Theoretically, the field key may differ from the field slug (we have no invariants defined anywhere). - // We can search the array and look for slugs. - foreach( $fields_from_options as $field_from_options ) { - if( wpcf_getarr( $field_from_options, 'slug' ) == $field_key ) { - $field_configuration = $fields_from_options; - break; - } - } - - if( null == $field_configuration ) { - // No such field is defined. - return null; - } - } - - // Prepare the field type information, fail if we can't. - $field_type_slug = wpcf_getarr( $field_configuration, 'type', null ); - $field_type = Types_Field_Type_Definition_Factory::load( $field_type_slug ); - if( null == $field_type ) { - return null; - } - - // Create the object and save it to cache. - try { - $class_name = $this->get_class_name(); - /** @var WPCF_Field_Definition $field_definition */ - $field_definition = new $class_name( $field_type, $field_configuration, $this ); - } catch( Exception $e ) { - return null; - } - - $this->field_definitions[ $field_key ] = $field_definition; - } - - return $this->field_definitions[ $field_key ]; - } - - - /** - * This method is to be used only for bringing existing fields under Types control. - * - * At this point it is assumed that there doesn't exist any field definition for given meta_key. - * See Types_Field_Utils::start_managing_field() for details. - * - * Maybe the usage could be wider, but that is not yet clear from the legacy code. The behaviour is slightly - * different for meta_keys with the wpcf- prefix from the ones without it. More details in the code. - * - * The field will be created as a text field. - * - * @param string $meta_key Field meta key. - * - * @return string|false New field slug on success, false otherwise. - * @since 2.0 - */ - final public function create_field_definition_for_existing_fields( $meta_key ) { - - // If the meta_key has our wpcf- prefix, we will not use it in the slug. - $field_slug = preg_replace( '/^wpcf\-/', '', $meta_key ); - - $definition_array = array( - 'slug' => $field_slug, - 'meta_key' => $meta_key, - 'meta_type' => Types_Field_Utils::domain_to_legacy_meta_type( $this->get_domain() ), - 'type' => Types_Field_Type_Definition_Factory::TEXTFIELD, - - // Use slug as name as well if we don't have anything better. - 'name' => $field_slug, - - 'description' => '', - - 'data' => array(), - - // This is not used anywhere but the sanitization in legacy code will exclude fields without this key. - 'id' => $field_slug - ); - - - // Now comes a funny part that I don't fully understand. When the field's meta_key does contain the Types - // prefix ('wpcf-'), we assume that this was most probably a Types field whose definition got lost. If not, - // it's a completely "foreign" field that we'll only manage from now on. - // - // In the first case, the legacy code says "let's take full control" and that means setting 'controlled' to 0, - // while for other fields (apparently without "full control") we set 'controlled' to 1... well, ok... - // - // But it also says "WATCH THIS! MUST NOT BE DROPPED IN ANY CASE", so let's not drop it. - // - // Name of the legacy function is: wpcf_types_cf_under_control(). - // - // I assume this setting is somehow related to toolset-forms. - $adding_field_with_prefix = ( - substr( $meta_key, 0, strlen( WPCF_Field_Definition::FIELD_META_KEY_PREFIX ) ) == WPCF_Field_Definition::FIELD_META_KEY_PREFIX - ); - - $definition_array['data']['controlled'] = ( $adding_field_with_prefix ? 0 : 1 ); - - - // Sanitize the definition array by type - $textfield_type = Types_Field_Type_Definition_Factory::get_instance()->load_field_type_definition( Types_Field_Type_Definition_Factory::TEXTFIELD ); - if( null == $textfield_type ) { - return false; - } - $definition_array = $textfield_type->sanitize_field_definition_array( $definition_array ); - - // Save the data - $this->set_field_definition( $field_slug, $definition_array ); - - // Indicate success - return $field_slug; - - } - - - /** - * @return array Raw field definition data from the options, including definitions of fields not currently - * managed by Types. - */ - private function get_fields_from_options() { - return wpcf_admin_fields_get_fields( false, false, false, $this->get_option_name() ); - } - - - /** - * Removes a single field definition from the storage of existing instances. - * - * It also completely clears the cache of the (legacy) wpcf_admin_fields_get_fields. - * Note that this method is public only temporarily and that this is not a mere cache clearing. - * - * @param string|null $field_slug If null, the cache will be emptied completely. - */ - public function clear_definition_storage( $field_slug = null ) { - if( null == $field_slug ) { - $this->field_definitions = array(); - } else { - unset( $this->field_definitions[ $field_slug ] ); - } - - wpcf_admin_fields_get_fields( false, false, false, $this->get_option_name(), false, true ); - } - - - /** - * Completely erase field definition from options and clear cache. - * - * @param string $field_slug - * @since 1.9 - */ - private function erase_field_definition_from_options( $field_slug ) { - - $fields_from_options = $this->get_fields_from_options(); - unset( $fields_from_options[ $field_slug ] ); - $this->update_field_definition_option( $fields_from_options ); - - $this->clear_definition_storage( $field_slug ); - } - - - /** - * Update the option that stores field definitions for current domain with new value. - * - * This is a low-level method. No validation or sanitization is performed whatsoever. - * - * @param array $updated_value New value to be stored. - * @since 2.0 - */ - private function update_field_definition_option( $updated_value ) { - update_option( $this->get_option_name(), $updated_value ); - } - - - /** - * @return string[] Slugs of fields that have a definition in Types. - */ - private function get_types_field_slugs() { - $fields_from_options = $this->get_fields_from_options(); - $field_slugs = array(); - foreach ( $fields_from_options as $field_configuration ) { - $slug = wpcf_getarr( $field_configuration, 'slug' ); - if( !empty( $slug ) ) { - $field_slugs[] = $slug; - } - } - return array_unique( $field_slugs ); - } - - - /** - * Determine if there exists any Types field definition (within the domain) that uses this key. - * - * @param string $meta_key - * @param string [$return='boolean'] For 'boolean', the method simply returns true/false answer, for 'definition' - * it returns either the field definition instance or null if no such one exists. - * @return bool|WPCF_Field_Definition|null - * @since 1.9 - */ - public function meta_key_belongs_to_types_field( $meta_key, $return = 'boolean' ) { - $field_definitions = $this->load_types_field_definitions(); - foreach( $field_definitions as $field_definition ) { - if( $field_definition->get_meta_key() == $meta_key ) { - return ( 'boolean' == $return ? true : $field_definition ); - } - } - return ( 'boolean' == $return ? false : null ); - } - - - /** - * @return WPCF_Field_Definition[] All existing Types field definitions. - */ - private function load_types_field_definitions() { - $field_slugs = $this->get_types_field_slugs(); - $field_definitions = array(); - - foreach ( $field_slugs as $slug ) { - $field_definition = $this->load_field_definition( $slug ); - if ( null != $field_definition ) { - $field_definitions[] = $field_definition; - } - } - - return $field_definitions; - } - - - /** - * @return string[] All meta keys that occur in the database (within the domain). - */ - protected abstract function get_existing_meta_keys(); - - - /** - * @return Types_Field_Group_Factory - * @since 2.0 - */ - public abstract function get_group_factory(); - - - /** - * @var null|WPCF_Field_Definition_Generic[] Cache. - */ - private $generic_field_definitions = null; - - - /** - * @return WPCF_Field_Definition_Generic[] Definitions of all generic fields that exist in the database within - * current domain. - */ - public function load_generic_field_definitions() { - - if( null == $this->generic_field_definitions ) { - $existing_meta_keys = $this->get_existing_meta_keys(); - - $results = array(); - foreach( $existing_meta_keys as $meta_key ) { - - if( $this->meta_key_belongs_to_types_field( $meta_key ) ) { - continue; - } - - $results[] = new WPCF_Field_Definition_Generic( $meta_key ); - } - - $this->generic_field_definitions = $results; - - } - - return $this->generic_field_definitions; - } - - - /** - * @return WPCF_Field_Definition_Abstract[] All field definitions (generic and Types-controlled). - */ - public function load_all_definitions() { - return array_merge( $this->load_types_field_definitions(), $this->load_generic_field_definitions() ); - } - - - /** - * Reorder an array of field definitions. - * - * @param WPCF_Field_Definition_Abstract[] $definitions - * @param string $orderby 'name'|'slug'|'is_under_types_control'|'field_type' - * @param string $order 'asc'|'desc' - * - * @return WPCF_Field_Definition_Abstract[] Reordered array. - */ - public function order_definitions( $definitions, $orderby = 'name', $order = 'asc' ) { - - $orderby_to_comparison_function = array( - 'name' => 'compare_definitions_by_name', - 'slug' => 'compare_definitions_by_slug', - 'is_under_types_control' => 'compare_definition_by_types_control', - 'field_type' => 'compare_definitions_by_field_type' - ); - - usort( $definitions, array( $this, wpcf_getarr( $orderby_to_comparison_function, $orderby, 'compare_definitions_by_name' ) ) ); - - if( 'desc' == $order ) { - $definitions = array_reverse( $definitions ); - } - - return $definitions; - } - - - /** - * Compare function for ordering by name in order_definitions(). - * - * @param $first WPCF_Field_Definition_Abstract - * @param $second WPCF_Field_Definition_Abstract - * - * @return int - */ - public function compare_definitions_by_name( $first, $second ) { - return strcoll( strtolower( $first->get_name() ), strtolower( $second->get_name() ) ); - } - - - /** - * Compare function for ordering by slug in order_definitions(). - * - * @param $first WPCF_Field_Definition_Abstract - * @param $second WPCF_Field_Definition_Abstract - * - * @return int - */ - public function compare_definitions_by_slug( $first, $second ) { - return strcmp( $first->get_slug(), $second->get_slug() ); - } - - - /** - * Compare function for ordering by the Types control status in order_definitions(). - * - * @param $first WPCF_Field_Definition_Abstract - * @param $second WPCF_Field_Definition_Abstract - * - * @return int - */ - public function compare_definition_by_types_control( $first, $second ) { - if( $first->is_under_types_control() == $second->is_under_types_control() ) { - return 0; - } else { - return $first->is_under_types_control() ? 1 : -1; - } - } - - - /** - * Compare function for ordering by field type in order_definitions(). - * - * @param $first WPCF_Field_Definition_Abstract - * @param $second WPCF_Field_Definition_Abstract - * - * @return int - */ - public function compare_definitions_by_field_type( $first, $second ) { - if( $first->is_under_types_control() == $second->is_under_types_control() ) { - if( $first->is_under_types_control() ) { - // Both are under Types control, compare their field types - /** @var WPCF_Field_Definition $first_t */ - $first_t = $first; - /** @var WPCF_Field_Definition $second_t */ - $second_t = $second; - return strcmp( $first_t->get_type()->get_slug(), $second_t->get_type()->get_slug() ); - } else { - // None are under Types control - return 0; - } - } else { - // The one that is under Types control wins. - return $first->is_under_types_control() ? -1 : 1; - } - } - - - /** - * Query field definitions. - * - * @param array $args Following arguments are recognized: - * - * - filter: What field definitions should be retrieved: 'types'|'generic'|'all' - * - orderby: 'name'|'slug'|'is_under_types_control'|'field_type' - * - order: 'asc'|'desc' - * - search: String for fulltext search. - * - field_type: string|array Field type slug(s). Allowed only for Types fields. - * - group_id: int Field group ID where this field belongs to. Allowed only for Types fields. - * - group_slug: string Slug of an existing firld group where this field belongs to. If defined, overrides - * the group_id argument. Allowed only for Types fields. - * - * @return WPCF_Field_Definition_Abstract[] Field definitions that match query arguments. - * - * @since 1.9 - */ - public function query_definitions( $args ) { - - $args = wp_parse_args( $args, array( 'filter' => 'all' ) ); - - // Get only certain type of field definitions (generic, Types or both) - $filter = wpcf_getarr( $args, 'filter' ); - if( 'types' == $filter ) { - $results = $this->load_types_field_definitions(); - } else if( 'generic' == $filter ) { - $results = $this->load_generic_field_definitions(); - } else if( 'all' == $filter ) { - $results = $this->load_all_definitions(); - } else { - $results = array(); - } - - // Save us some work if there will be no results at all - if( empty( $results ) ) { - return array(); - } - - // Perform fulltext search if needed - $search_string = wpcf_getarr( $args, 'search', '' ); - if( !empty( $search_string ) ) { - $matches = array(); - foreach( $results as $definition ) { - if( $definition->is_match( $search_string ) ) { - $matches[] = $definition; - } - } - $results = $matches; - } - - // Select only fields of desired type - $field_type = wpcf_getarr( $args, 'field_type', array() ); - $field_type = empty( $field_type ) ? array() : $field_type; - $field_type = is_array( $field_type ) ? $field_type : array( $field_type ); - if( !empty( $field_type ) ) { - $type_matches = array(); - foreach( $results as $definition ) { - if( $definition instanceof WPCF_Field_Definition ) { - $type = $definition->get_type(); - if( in_array( $type->get_slug(), $field_type ) ) { - $type_matches[] = $definition; - } - } - } - $results = $type_matches; - } - - // Select fields by field group. - $group_source = wpcf_getarr( $args, 'group_slug', (int) wpcf_getarr( $args, 'group_id' ) ); - if( !empty( $group_source ) ) { - $group_factory = $this->get_group_factory(); - $group = $group_factory->load_field_group( $group_source ); - $group_matches = array(); - if( null != $group ) { - foreach( $results as $field_definition ) { - if( $field_definition instanceof WPCF_Field_Definition - && $field_definition->belongs_to_group( $group ) ) - { - $group_matches[] = $field_definition; - } - } - } - $results = $group_matches; - } - - // Sort results - $orderby = wpcf_getarr( $args, 'orderby', 'name' ); - $order = wpcf_getarr( $args, 'order', 'asc', array( 'asc', 'desc' ) ); - - $results = $this->order_definitions( $results, $orderby, $order ); - - return $results; - } - - - /** - * Permanently delete field definition. - * - * That means: - * - remove it from all field groups, - * - delete field data from the database (sic!) and - * - delete the definition itself. - * - * After calling this method, the field definition object passed as parameter should never be used again. - * - * @param WPCF_Field_Definition $field_definiton - * @return bool - */ - public function delete_definition( $field_definiton ) { - - // We accept only fields that are under Types control - if( ! $field_definiton instanceof WPCF_Field_Definition ) { - return false; - } - - if( ! $field_definiton->is_under_types_control() ) { - return false; - } - - // Remove field from all groups - $associated_groups = $field_definiton->get_associated_groups(); - foreach( $associated_groups as $group ) { - $group->remove_field_definition( $field_definiton ); - } - - // Delete field data - $is_success = $field_definiton->delete_all_fields(); - - // Delete the definition - if( $is_success ) { - $slug_to_delete = $field_definiton->get_slug(); - $this->erase_field_definition_from_options( $slug_to_delete ); - } - - return $is_success; - } - - - /** - * Update existing field definition. - * - * @param WPCF_Field_Definition $field_definition - * @throws InvalidArgumentException - * @return bool True when the update was successful, false otherwise. - * @since 2.0 - */ - public function update_definition( $field_definition ) { - - if( ! $field_definition instanceof WPCF_Field_Definition ) { - throw new InvalidArgumentException( 'Not a Types field definition.' ); - } - - $fields_from_options = $this->get_fields_from_options(); - if( ! array_key_exists( $field_definition->get_slug(), $fields_from_options ) ) { - return false; - } - - $this->set_field_definition( $field_definition->get_slug(), $field_definition->get_definition_array() ); - - return true; - } - - - /** - * Store field definition array in the options. - * - * This is a low-level method that doesn't perform any kind of validation or sanitization. Use with care. - * - * @param string $field_slug - * @param array $definition_array - * @since 2.0 - */ - private function set_field_definition( $field_slug, $definition_array ) { - - $fields_from_options = $this->get_fields_from_options(); - - $fields_from_options[ $field_slug ] = $definition_array; - - $this->update_field_definition_option( $fields_from_options ); - - // This can be called during an AJAX call, in which case the legacy code is not loaded - Types_Main::get_instance()->require_legacy_functions(); - - // Clear the underlying legacy cache. - wpcf_admin_fields_get_fields( false, false, false, $this->get_option_name(), false, true ); - } - - - /** - * Temporary workaround to access field definitions on a very deep level. - * - * @param $field_slug - * @param $definition_array - * @deprecated Do not use, it will be removed. - * @since 2.1 - */ - public function set_field_definition_workaround( $field_slug, $definition_array ) { - $this->set_field_definition( $field_slug, $definition_array ); - } - - - /** - * Temporary workaround to access field definitions on a very deep level. Do not use, it will be removed. - * - * @return string - * @deprecated Do not use, it will be removed. - * @since 2.1 - */ - public function get_option_name_workaround() { - return $this->get_option_name(); - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_post.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_post.php deleted file mode 100644 index 501877c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_post.php +++ /dev/null @@ -1,57 +0,0 @@ -get_col( - "SELECT meta_key FROM {$wpdb->postmeta} GROUP BY meta_key HAVING meta_key NOT LIKE '\_%' ORDER BY meta_key" - ); - - return $meta_keys; - } - - - /** - * @inheritdoc - * @return Types_Field_Group_Post_Factory - * @since 2.0 - */ - public function get_group_factory() { - return Types_Field_Group_Post_Factory::get_instance(); - } - - - /** - * @inheritdoc - * @return string - */ - public function get_domain() { - return Types_Field_Utils::DOMAIN_POSTS; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_term.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_term.php deleted file mode 100644 index 8daa020..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_term.php +++ /dev/null @@ -1,57 +0,0 @@ -get_col( - "SELECT meta_key FROM {$wpdb->termmeta} GROUP BY meta_key HAVING meta_key NOT LIKE '\_%' ORDER BY meta_key" - ); - - return $meta_keys; - } - - - /** - * @inheritdoc - * @return Types_Field_Group_Post_Factory - * @since 2.0 - */ - public function get_group_factory() { - return Types_Field_Group_Term_Factory::get_instance(); - } - - - /** - * @inheritdoc - * @return string - * @since 2.0 - */ - public function get_domain() { - return Types_Field_Utils::DOMAIN_TERMS; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_user.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_user.php deleted file mode 100644 index 874ed3b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_factory_user.php +++ /dev/null @@ -1,57 +0,0 @@ -get_col( - "SELECT meta_key FROM {$wpdb->usermeta} GROUP BY meta_key HAVING meta_key NOT LIKE '\_%' ORDER BY meta_key" - ); - - return $meta_keys; - } - - - /** - * @inheritdoc - * @return Types_Field_Group_Post_Factory - * @since 2.0 - */ - public function get_group_factory() { - return Types_Field_Group_User_Factory::get_instance(); - } - - - /** - * @inheritdoc - * @return string - * @since 2.0 - */ - public function get_domain() { - return Types_Field_Utils::DOMAIN_USERS; - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_generic.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_generic.php deleted file mode 100644 index 4651187..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_generic.php +++ /dev/null @@ -1,42 +0,0 @@ -meta_key = $meta_key; - } - - - public function get_slug() { - return $this->meta_key; - } - - public function get_name() { - return $this->meta_key; - } - - public function get_description() { - return ''; - } - - public function get_meta_key() { - return $this->meta_key; - } - - public function is_under_types_control() { - return false; - } - - public function get_associated_groups() { - return array(); - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_post.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_post.php deleted file mode 100644 index e476d0c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_post.php +++ /dev/null @@ -1,68 +0,0 @@ -get_meta_key(); - - $postmeta_records = $wpdb->get_results( - $wpdb->prepare( - "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", - $meta_key - ) - ); - - // Delete one by one because we (probably) want all the WP hooks to fire. - foreach ( $postmeta_records as $postmeta ) { - delete_post_meta( $postmeta->post_id, $meta_key ); - } - - return true; - } - - - /** - * @inheritdoc - * - * Adds properties: domain - * - * @return array - * @since 2.0 - */ - public function to_json() { - $object_data = parent::to_json(); - - $additions = array( - 'domain' => 'posts' - ); - - return array_merge( $object_data, $additions ); - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_term.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_term.php deleted file mode 100644 index f560729..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_term.php +++ /dev/null @@ -1,71 +0,0 @@ -get_object_id(), - $this->get_meta_key(), - $this->get_is_repetitive(), - $field_instance - ); - } - - - /** - * Delete all field values! - * - * @return bool - */ - public function delete_all_fields() { - global $wpdb; - - $meta_key = $this->get_meta_key(); - - $termmeta_records = $wpdb->get_results( - $wpdb->prepare( - "SELECT term_id FROM $wpdb->termmeta WHERE meta_key = %s", - $meta_key - ) - ); - - // Delete one by one because we (probably) want all the WP hooks to fire. - foreach ( $termmeta_records as $termmeta ) { - delete_term_meta( $termmeta->term_id, $meta_key ); - } - - return true; - } - - - /** - * @inheritdoc - * - * Adds properties: domain - * - * @return array - * @since 2.0 - */ - public function to_json() { - $object_data = parent::to_json(); - - $additions = array( - 'domain' => 'terms' - ); - - return array_merge( $object_data, $additions ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_user.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_user.php deleted file mode 100644 index 4b2e91e..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/definition_user.php +++ /dev/null @@ -1,67 +0,0 @@ -get_meta_key(); - - $usermeta_records = $wpdb->get_results( - $wpdb->prepare( - "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", - $meta_key - ) - ); - - // Delete one by one because we (probably) want all the WP hooks to fire. - foreach ( $usermeta_records as $usermeta ) { - delete_user_meta( $usermeta->user_id, $meta_key ); - } - - return true; - } - - - /** - * @inheritdoc - * - * Adds properties: domain - * - * @return array - * @since 2.0 - */ - public function to_json() { - $object_data = parent::to_json(); - - $additions = array( - 'domain' => 'users' - ); - - return array_merge( $object_data, $additions ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/hooks_api.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/hooks_api.php deleted file mode 100644 index 50b0268..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/hooks_api.php +++ /dev/null @@ -1,31 +0,0 @@ -= (int) $object_id ) { - throw new InvalidArgumentException( 'Invalid object id.' ); - } - $this->object_id = (int) $object_id; - } - - - /** - * Accessor object to manipulate the database value directly. - * - * @return WPCF_Field_Accessor_Abstract - */ - protected function get_accessor() { - if( null == $this->accessor ) { - $this->accessor = $this->get_definition()->get_accessor( $this ); - } - return $this->accessor; - } - - - public function get_object_id() { - return $this->object_id; - } - - - /** - * Delete all field values (both for single and repetitive fields). - */ - public function delete_all_values() { - $this->get_accessor()->delete_raw_value(); - } - - - /** - * Overwrite current field values with new ones. - * - * @param array $values Array of values. For non-repetitive field there must be exactly one value. Order of values - * in this array will be stored as sort order. - * @return bool True on success, false if some error has occured. - */ - public abstract function update_all_values( $values ); - - - /** - * Add a single field value to the database. - * - * The value will be passed through filters as needed and stored, based on field configuration. - * - * @param mixed $value Raw value, which MUST be validated already. - * - * @return mixed - */ - public abstract function add_value( $value ); - - - /** - * @return string Meta key that is used to store value order for repetitive fields. - */ - protected function get_order_meta_name() { - return sprintf( '_%s-sort-order', $this->get_definition()->get_slug() ); - } - - - /** - * @return WPCF_Field_Accessor_Abstract An accessor to get the sort order for repetitive fields. - */ - protected abstract function get_order_accessor(); - - - /** - * For repetitive field, get the order of individual values. - * - * @return array Meta IDs in the order defining the field value order. - */ - protected function get_sort_order() { - $accessor = $this->get_order_accessor(); - return wpcf_ensarr( $accessor->get_raw_value() ); - } - - - /** - * Update order of inidvidual values for a repetitive field. - * - * @param int[] $order Array of meta IDs. It must be a complete match to actual values stored in the database. - * @return bool|mixed Update result. Depends on the underlying accessor. - */ - protected function set_sort_order( $order ) { - if( !is_array( $order ) ) { - return false; - } - $accessor = $this->get_order_accessor(); - return $accessor->update_raw_value( $order ); - } - - - /** - * @return mixed Value of the field in the "intermediate" format. - */ - public function get_value() { - return $this->get_definition()->get_data_mapper()->database_to_intermediate( $this->get_raw_value() ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_abstract.php deleted file mode 100644 index fa593b3..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_abstract.php +++ /dev/null @@ -1,70 +0,0 @@ -definition = $definition; - } - - - public function get_definition() { return $this->definition; } - - - public function get_field_type() { - $definition = $this->get_definition(); - return $definition->get_type(); - } - - - /** - * Get the accessor to the field value. - * - * We can't access it directly because we don't know how - it can be stored in post meta, user meta or term meta. - * - * @return WPCF_Field_Accessor_Abstract - */ - protected abstract function get_accessor(); - - - /** - * Get raw value of the field directly from the database. - * - * @deprecated Use with caution! Usually the value is expected in the intermediate format, which is what get_value() is for. - * @return mixed Raw value of the field. - */ - public function get_raw_value() { - $accessor = $this->get_accessor(); - return $accessor->get_raw_value(); - } - - - /** - * @return mixed Value of the field in the "intermediate" format. - */ - public function get_value() { - return $this->get_raw_value(); - } - - - /** - * @return int ID of the object that owns the field. - */ - public abstract function get_object_id(); - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_term.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_term.php deleted file mode 100644 index 793f12d..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_term.php +++ /dev/null @@ -1,217 +0,0 @@ -add_single_value( $value ); - - return ( true == $result || 0 < $result ); - - } - - - /** - * Add a single field value to the database. - * - * The value will be passed through filters as needed and stored, based on field configuration. - * - * @param mixed $value Value in the "intermediate" format (which is not well defined yet), which MUST be validated already. - * @return bool|int New meta ID or true if the value was added only virtually (no adding is needed). - */ - private function add_single_value( $value ) { - - // Shortcuts - $accessor = $this->get_accessor(); - $definition = $this->get_definition(); - - // Trim strings - if ( is_string( $value ) ) { - $value = trim( $value ); - } - - // If the field has defined value to store to database, use that one (e.g. checkbox). - if( $value && $definition->has_forced_value() ) { - $value = $definition->get_forced_value(); - } - - // Apply all filters on saving - $value_unfiltered = $value; - $value = $this->filter_single_value_before_saving( $value_unfiltered ); - - $is_value_empty = ( is_null( $value ) || $value === false || $value === '' ); - $should_save_empty_value = $definition->get_should_save_empty_value(); - $is_forced_value_empty = ( $definition->has_forced_value() && preg_match( '/^0$/', $value ) && preg_match( '/^0$/', $definition->get_forced_value() ) ); - - if( ( !$is_value_empty || $should_save_empty_value) || $is_forced_value_empty ) { - - $value = $definition->get_data_mapper()->intermediate_to_database( $value ); - - $meta_id = $accessor->add_raw_value( $value ); - - if( $meta_id > 0 ) { - $this->actions_after_single_value_saved( $value, $value_unfiltered, $meta_id ); - } - - return $meta_id; - - } else { - // We're not storing anything to database. - return true; - } - } - - - /** - * Push single field value through set of filters before it is saved to database. - * - * @param mixed $original_value - * @return mixed - */ - private function filter_single_value_before_saving( $original_value ) { - - $definition = $this->get_definition(); - $field_definition_array = $definition->get_definition_array(); - - // See wiki for filter description. - $value = apply_filters( 'wpcf_fields_termmeta_value_save', $original_value, $field_definition_array['type'], $definition, $field_definition_array, null ); - $value = apply_filters( 'wpcf_fields_value_save', $value, $field_definition_array['type'], $definition->get_slug(), null ); - $value = apply_filters( 'wpcf_fields_slug_' . $definition->get_slug() . '_value_save', $value, $field_definition_array, null ); - $value = apply_filters( 'wpcf_fields_type_' . $field_definition_array['type'] . '_value_save', $value, $field_definition_array, null ); - - return $value; - } - - - /** - * Execute actions after saving a single field value to database. - * - * @param mixed $value Value that was saved. - * @param mixed $value_unfiltered Value before passing it through pre-save filters. - * @param int $meta_id Meta ID of the value. - */ - private function actions_after_single_value_saved( $value, $value_unfiltered, $meta_id ) { - - $definition = $this->get_definition(); - $field_definition_array = $definition->get_definition_array(); - - /** - * Executed after each field value is saved (that means multiple times for repetitive fields). - * - * @param mixed $value The value that was stored in the database - * @param array $field_definition_array Field definition array. - * @param mixed $ignored Sometimes it may be WPCF_Field and sometimes null. Don't rely in this at all. - * @param int $meta_id ID of the meta record in the database. - * @param mixed $value_unfiltered The (more or less) original value before it was pushed through filters - * wpcf_fields_value_save & co. - * @since unknown - */ - do_action( 'wpcf_fields_save', $value, $field_definition_array, null, $meta_id, $value_unfiltered ); - do_action( 'wpcf_fields_slug_' . $definition->get_slug() . '_save', $value, $field_definition_array, null, $meta_id, $value_unfiltered ); - do_action( 'wpcf_fields_type_' . $field_definition_array['type'] . '_save', $value, $field_definition_array, null, $meta_id, $value_unfiltered ); - - } - - - /** - * Overwrite current field values with new ones. - * - * @param array $values Array of values. For non-repetitive field there must be exactly one value. Order of values - * in this array will be stored as sort order. - * @return bool True on success, false if some error has occured. - */ - public function update_all_values( $values ) { - - // Quoting from original code: - // Since Types 1.2 we completely rewrite meta. It has no impact on frontend and covers a lot of cases - // (e.g. user change mode from single to repetitive). - $this->delete_all_values(); - - if( ! $this->get_definition()->get_is_repetitive() ) { - - // Single field here. We expect exactly one value. - if( count( $values ) != 1 ) { - return false; - } - - return $this->add_value( $values[0] ); - - } else { - - // Saving repetitive field is a bit more complex, also because we need to execute these actions (mainly - // for WPML compatibility). - do_action( - 'wpcf_termmeta_before_adding_repetitive_field_values', - $this->get_object_id(), - $this->get_definition()->get_definition_array(), - $this - ); - - $is_success = true; - - $meta_ids = array(); - - // Because we need to fire a special action before the last value is stored - $total_value_count = count( $values ); - $current_value_number = 1; - - foreach( $values as $value ) { - - // They say it's needed only for Conditional case: - // https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/160422568/comments#comment_226301926 - // $value = apply_filters( 'types_field_get_submitted_data', $value, $this ); - - if ( $total_value_count == $current_value_number ) { - // After this action we will store the last value. - do_action( - 'wpcf_termmeta_before_adding_last_repetitive_field_value', - $this->get_object_id(), - $this->get_definition()->get_definition_array(), - $this - ); - } - $current_value_number++; - - $meta_id = $this->add_single_value( $value ); - $is_success = $is_success && ( 0 < $meta_id ); - $meta_ids[] = $meta_id; - } - - do_action( - 'wpcf_termmeta_after_adding_repetitive_field_values', - $this->get_object_id(), - $this->get_definition()->get_definition_array(), - $this - ); - - $this->set_sort_order( $meta_ids ); - - return $is_success; - } - } - - - /** - * @return WPCF_Field_Accessor_Abstract An accessor to get the sort order for repetitive fields. - */ - protected function get_order_accessor() { - return new WPCF_Field_Accessor_Termmeta( $this->get_object_id(), $this->get_order_meta_name(), false ); - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_unsaved.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_unsaved.php deleted file mode 100644 index fad0e0c..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/instance_unsaved.php +++ /dev/null @@ -1,22 +0,0 @@ - Label for the option (when entering data) - * - set_value => Value to be stored in database when this option is selected - * - display => Display mode, either 'db' for displaying raw database value or 'value' for displaying - * custom values (below) - * - display_value_selected - * - display_value_not_selected - */ - protected $config; - - - /** - * WPCF_Field_Value_Option constructor. - * - * @param string $option_id Unique ID of the option. - * @param string[] $config Option configuration. - * @param string $default Default field value - */ - public function __construct( $option_id, $config, $default ) { - - if( !is_string( $option_id ) || empty( $option_id ) ) { - throw new InvalidArgumentException( 'Invalid option ID.' ); - } - $this->option_id = $option_id; - - if( !is_array( $config ) ) { - throw new InvalidArgumentException( 'Invalid option configuration.' ); - } - $this->config = $config; - } - - - /** - * @param array $field_value Checkboxes field value in the "intermediate" format. - * @return bool Whether this option is checked in the field whose value is provided. - * @since 1.9.1 - */ - public function is_option_checked( $field_value ) { - // Value that should be stored in database if this option is checked - $option_value = wpcf_getnest( $field_value, array( $this->option_id, 0 ), null ); - $is_checked = ( null !== $option_value && $this->get_value_to_store() == $option_value ); - return $is_checked; - } - - - /** - * @return string Option label. - * @since 1.9.1 - */ - public function get_label() { - $value = wpcf_getarr( $this->config, 'title' ); - if( !is_string( $value ) ) { - $value = ''; - } - - return sanitize_text_field( $value ); - } - - - /** - * Determine value to be displayed for this option. - * - * @param bool $is_checked For which value should the output be rendered. - * @return string Display value depending on option definition. For unselected options in 'db' mode, empty string - * will be returned disregarding the field's "save zero to database" option. - * @since 1.9.1 - */ - public function get_display_value( $is_checked = true ) { - $display_mode = wpcf_getarr( $this->config, 'display', 'db', array( 'value', 'db' ) ); - if( 'db' == $display_mode ) { - return ( $is_checked ? $this->get_value_to_store() : '' ); - } else { - if ( $is_checked ) { - return wpcf_getarr( $this->config, 'display_value_selected' ); - } else { - return wpcf_getarr( $this->config, 'display_value_not_selected' ); - } - } - } - - - /** - * @return string Value that should be stored to database when this option is selected. - * @since 1.9.1 - */ - public function get_value_to_store() { - $value = wpcf_getarr( $this->config, 'set_value' ); - if( !is_string( $value ) ) { - return ''; - } - - return $value; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/option_radio.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/option_radio.php deleted file mode 100644 index 703690f..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/option_radio.php +++ /dev/null @@ -1,62 +0,0 @@ -field_definition = $field_definition; - } - - /** - * @return string Value that should be stored to database when this option is selected. - * @since 1.9.1 - */ - public function get_value_to_store() { - $value = wpcf_getarr( $this->config, 'value' ); - if( !is_string( $value ) ) { - return ''; - } - - return $value; - } - - - /** - * Determine value to be displayed for this option. - * - * @param bool $is_checked For which value should the output be rendered. - * @return string Display value depending on option definition and field display mode - * @since 1.9.1 - */ - public function get_display_value( $is_checked = true ) { - $field_definition_array = $this->field_definition->get_definition_array(); - $display_mode = wpcf_getnest( $field_definition_array, array( 'data', 'display' ), 'db' ); - $display_mode = ( 'value' == $display_mode ? 'value' : 'db' ); - - if( 'db' == $display_mode ) { - return ( $is_checked ? $this->get_value_to_store() : '' ); - } else { - if ( $is_checked ) { - return wpcf_getarr( $this->config, 'display_value' ); - } else { - return ''; - } - } - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/option_select.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/option_select.php deleted file mode 100644 index e65a420..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/option_select.php +++ /dev/null @@ -1,27 +0,0 @@ -get_value_to_store(); - } else { - return ''; - } - } -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/abstract.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/abstract.php deleted file mode 100644 index 542b8dd..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/abstract.php +++ /dev/null @@ -1,23 +0,0 @@ -field = $field; - } - - - /** - * @param bool $echo - * - * @return string - */ - public abstract function render( $echo = false ); - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/factory.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/factory.php deleted file mode 100644 index 4a7c4a6..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/factory.php +++ /dev/null @@ -1,86 +0,0 @@ -get_field_type(); - switch( $field_type->get_slug() ) { - - case Types_Field_Type_Definition_Factory::GOOGLE_ADDRESS: - return new WPCF_Field_Renderer_Preview_Address( $field, $args ); - - case Types_Field_Type_Definition_Factory::AUDIO: - case Types_Field_Type_Definition_Factory::FILE: - case Types_Field_Type_Definition_Factory::VIDEO: - return new WPCF_Field_Renderer_Preview_File( $field, $args ); - - case Types_Field_Type_Definition_Factory::COLORPICKER: - return new WPCF_Field_Renderer_Preview_Colorpicker( $field, $args ); - - case Types_Field_Type_Definition_Factory::DATE: - return new WPCF_Field_Renderer_Preview_Date( $field, $args ); - - case Types_Field_Type_Definition_Factory::EMBED: - case Types_Field_Type_Definition_Factory::URL: - return new WPCF_Field_Renderer_Preview_URL( $field, $args ); - - case Types_Field_Type_Definition_Factory::CHECKBOX: - return new WPCF_Field_Renderer_Preview_Checkbox( $field, $args ); - - case Types_Field_Type_Definition_Factory::CHECKBOXES: - return new WPCF_Field_Renderer_Preview_Checkboxes( $field, $args ); - - case Types_Field_Type_Definition_Factory::IMAGE: - return new WPCF_Field_Renderer_Preview_Image( $field, $args ); - - case Types_Field_Type_Definition_Factory::RADIO: - case Types_Field_Type_Definition_Factory::SELECT: - return new WPCF_Field_Renderer_Preview_Radio( $field, $args ); - - case Types_Field_Type_Definition_Factory::SKYPE: - return new WPCF_Field_Renderer_Preview_Skype( $field, $args ); - - default: - return new WPCF_Field_Renderer_Preview_Textfield( $field, $args ); - break; - } - } -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/address.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/address.php deleted file mode 100644 index 1891f65..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/address.php +++ /dev/null @@ -1,54 +0,0 @@ -get_maximum_item_length(); - if( 0 < $max_length && $max_length < strlen( $label ) ) { - $label = substr( $label, 0, $max_length - 3 ) . '...'; - } - - $url = esc_url( - add_query_arg( - array( - 'q' => $value - ), - 'http://maps.google.com/' - ) - ); - - $link = sprintf( - '%s', - $url, - sanitize_text_field( $label ) - ); - - return $link; - } - - - protected function get_maximum_total_length() { - return 0; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/base.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/base.php deleted file mode 100644 index 015ff14..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/base.php +++ /dev/null @@ -1,171 +0,0 @@ - Maximum count of field values that should be displayed. - * - maximum_item_length => Maximum length of single item. - * - maximum_total_length => Maximum length of output. - * - value_separator => Separator to be used between multiple field values. - * - ellipsis => Ellipsis to be added when some field values are omitted. - * - * Specialized renderers may interpret the settings in a different way or add their own. - * - * @since 1.9.1 - */ - public function __construct( $field, $args = array() ) { - parent::__construct( $field ); - - $this->args = wpcf_ensarr( $args ); - } - - - /** - * Render the field value. Handle both single and repetitive fields. - * - * Rendering of a single value is defined in render_single() and multiple values are concatenated by - * separator provided by get_value_separator(). - * - * @param bool $echo Echo the output? - * @return string Rendered HTML. - * @since 1.9.1 - */ - public function render( $echo = false ) { - - $field_value = $this->field->get_value(); - - // Handle all fields as repetitive, we allways have array of individual field values. - $output_values = array(); - - // Optionally limit the number of rendered items - $max_item_count = $this->get_maximum_item_count(); - $loop_limit = ( - $max_item_count > 0 - ? min( $max_item_count, count( $field_value ) ) - : count( $field_value ) - ); - - $is_limited_by_max_count = ( $loop_limit < count( $field_value ) ); - for( $i = 0; $i < $loop_limit; ++$i ) { - $value = array_shift( $field_value ); - $output_values[] = $this->render_single( $value ); - } - - $output = implode( $this->get_value_separator(), $output_values ); - $ellipsis = $this->get_ellipsis(); - - $is_limited_by_max_total_length = $this->limit_by_maximum_total_length( $output ); - - $needs_separator = $is_limited_by_max_count && ! $is_limited_by_max_total_length; - $needs_ellipsis = ( $is_limited_by_max_count || $is_limited_by_max_total_length ); - - if( $needs_separator ) { - $output .= $this->get_value_separator(); - } - if( $needs_ellipsis ) { - $output .= $ellipsis; - } - - if( $echo ) { - echo $output; - } - - return $output; - } - - - /** - * Apply maximum total length limit on a value. - * - * @param string &$value Value to be shortened if needed. - * @return bool True if the limit was applied. - * @since 2.1 - */ - protected function limit_by_maximum_total_length( &$value ) { - $ellipsis = $this->get_ellipsis(); - $ellipsis_length = strlen( $ellipsis ); - - $maximum_total_length = $this->get_maximum_total_length(); - $is_limited_by_max_total_length = ( 0 < $maximum_total_length && $maximum_total_length < strlen( $value ) ); - if( $is_limited_by_max_total_length ) { - $value = substr( $value, 0, $maximum_total_length - $ellipsis_length ); - } - - return $is_limited_by_max_total_length; - } - - - /** - * @return string Separator to be used between multiple field values. - */ - protected function get_value_separator() { - return wpcf_getarr( $this->args, 'value_separator', ', ' ); - } - - - /** - * @param mixed $value Single field value in the intermediate format (see data mappers for details) - * @return string Rendered HTML - */ - protected abstract function render_single( $value ); - - - /** - * @return int Maximum count of field values that should be displayed. Zero means no limit. - * @since 1.9.1 - */ - protected function get_maximum_item_count() { - return absint( wpcf_getarr( $this->args, 'maximum_item_count' ) ); - } - - - /** - * @return int Maximum length of single item. Interpretation depends on specific renderer (on a field type); it - * may be completely ignored. Zero means no limit. - * @since 1.9.1 - */ - protected function get_maximum_item_length() { - return absint( wpcf_getarr( $this->args, 'maximum_item_length' ) ); - } - - - /** - * @return int Maximum length of the final output. Zero means no limit. When some HTML is rendered, this method - * needs to be overridden to allways return zero, otherwise the markup might be broken. - * @since 1.9.1 - */ - protected function get_maximum_total_length() { - return absint( wpcf_getarr( $this->args, 'maximum_total_length' ) ); - } - - - - /** - * @return string Ellipsis to be added when some field values are omitted. - * @since 1.9.1 - */ - protected function get_ellipsis() { - return wpcf_getarr( $this->args, 'ellipsis', '...' ); - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/checkbox.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/checkbox.php deleted file mode 100644 index 8811e1b..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/checkbox.php +++ /dev/null @@ -1,36 +0,0 @@ -field->get_definition(); - $value_of_checked = $field_definition->get_forced_value(); - - if( null != $value_of_checked && $value_of_checked == $value ) { - return '✔'; // ballot box with check - checkbox - checkmark - miscellaneous symbols - } - - // We may not even get here without the checkbox being checked (when no value is saved to database) - return ''; - } - - - protected function get_maximum_total_length() { - return 0; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/checkboxes.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/checkboxes.php deleted file mode 100644 index 74f5bd0..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/checkboxes.php +++ /dev/null @@ -1,63 +0,0 @@ -field->get_definition()->get_field_options(); - $output = array(); - - // Let each checkbox option definition handle how it should be displayed. - foreach( $options as $option ) { - $display_value = $option->get_display_value( $option->is_option_checked( $value ) ); - if( !empty( $display_value ) ) { - $output[] = $display_value; - } - } - - // Apply maximum count here - $max_item_count = $this->get_maximum_item_count(); - $is_limited_by_max_count = ( 0 < $max_item_count && $max_item_count < count( $output ) ); - if( $is_limited_by_max_count ) { - $output = array_slice( $output, 0, $this->get_maximum_item_count() ); - } - - $output = implode( $this->get_value_separator(), $output ); - - // We need to additionally apply a limit for maximum total length - // because if we only apply item length and count, and perhaps add separator and ellipsis at the end, - // the parent::render() method will see it as one item and it might add another ellipsis if - // output of this function hits the maximum total length limit there. - // - // Note: limit_by_maximum_total_length() should subtract the length of the ellipsis from the resulting - // total length, so we should be completely covered here. - $is_limited_by_max_total_length = $this->limit_by_maximum_total_length( $output ); - - $needs_separator = $is_limited_by_max_count && ! $is_limited_by_max_total_length; - $needs_ellipsis = ( $is_limited_by_max_count || $is_limited_by_max_total_length ); - - if( $needs_separator ) { - $output .= $this->get_value_separator(); - } - if( $needs_ellipsis ) { - $output .= $this->get_ellipsis(); - } - - return sanitize_text_field( $output ); - } - - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/colorpicker.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/colorpicker.php deleted file mode 100644 index 924f9cc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/colorpicker.php +++ /dev/null @@ -1,48 +0,0 @@ -
                ', - $value, - $value - ); - - return $result; - } - - - protected function get_value_separator() { - return ' '; - } - - - /** - * @inheritdoc - * @return int - */ - protected function get_maximum_total_length() { - return 0; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/date.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/date.php deleted file mode 100644 index 8269122..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/date.php +++ /dev/null @@ -1,44 +0,0 @@ -field->get_definition()->get_datetime_option() == 'date_and_time' ); - if( $add_time ) { - $output .= ' ' . date( get_option( 'time_format' ), $timestamp ); - } - - return sanitize_text_field( $output ); - } - - - /** - * @inheritdoc - * - * @return string - */ - protected function get_value_separator() { - // Semicolon is less likely to cause conflicts with date and time formats. - return '; '; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/file.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/file.php deleted file mode 100644 index 56f6414..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/file.php +++ /dev/null @@ -1,25 +0,0 @@ -try_finding_attachment( $original_image_url ); - $image_size = esc_attr( $this->get_maximum_image_size() ); - - $output = sprintf( - '
                - -
                ', - esc_url( $image_url ), - $image_size, - $image_size, - esc_url( $original_image_url ) - ); - - return $output; - } - - - /** - * For given URL, try to find an attachment with this file and if successful, try finding thumbnail URL. - * - * Returns original URL on failure. - * - * @param string $url Image URL - * @return string URl of the thumbnail or original image. - * @since 1.9.1 - */ - protected function try_finding_attachment( $url ) { - $attachment_id = Types_Utils::get_attachment_id_by_url( $url ); - if( 0 == $attachment_id ) { - return $url; - } - - $attachment_src = wp_get_attachment_image_src( $attachment_id, 'thumbnail' ); - if( false == $attachment_src ) { - return $url; - } - - return ( is_string( $attachment_src[0] ) ? $attachment_src[0] : $url ); - } - - - protected function get_value_separator() { - return ' '; - } - - - protected function get_maximum_image_size() { - return wpcf_getarr( $this->args, 'maximum_image_size', self::DEFAULT_MAX_IMAGE_SIZE ); - } - - /** - * @inheritdoc - * @return int - */ - protected function get_maximum_total_length() { - return 0; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/radio.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/radio.php deleted file mode 100644 index d09d8ab..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/radio.php +++ /dev/null @@ -1,45 +0,0 @@ -get_option_for_value( $value ); - if( null == $option ) { - return ''; - } - - $output = $option->get_display_value( true ); - - return sanitize_text_field( $output ); - } - - - /** - * Get radio field option definition from field value. - * - * @param string $value Value stored in the database. - * @return WPCF_Field_Option_Radio Corresponding option definition. - */ - private function get_option_for_value( $value ) { - $options = $this->field->get_definition()->get_field_options(); - foreach( $options as $option ) { - if( $value == $option->get_value_to_store() ) { - return $option; - } - } - return null; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/skype.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/skype.php deleted file mode 100644 index a386927..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/skype.php +++ /dev/null @@ -1,24 +0,0 @@ -get_maximum_item_length(); - if( 0 < $max_length && $max_length < strlen( $value ) ) { - $ellipsis = $this->get_ellipsis(); - $value = substr( $value, 0, $max_length - strlen( $ellipsis ) ) . $ellipsis; - } - - return $value; - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/url.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/url.php deleted file mode 100644 index e4db129..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/preview/url.php +++ /dev/null @@ -1,75 +0,0 @@ -get_link_label( $url_components ); - - // Apply maximum item length on the link label, not the whole output - $max_length = $this->get_maximum_item_length(); - if( 0 < $max_length && $max_length < strlen( $label ) ) { - $label = substr( $label, 0, $max_length - 3 ) . '...'; - } - - // Build the actual link - $link = sprintf( - '%s', - esc_url( $value ), - sanitize_text_field( $label ) - ); - - return $link; - } else { - return ''; - } - } - - - protected function get_maximum_total_length() { - return 0; - } - - - /** - * @param string[] $url_components Result of parse_url(). - * @return string Label of the resulting link. - * @since 1.9.1 - */ - protected function get_link_label( $url_components ) { - - // Build link label only from host, path and query. - $url_query = wpcf_getarr( $url_components, 'query' ); - $url_query = ( empty( $url_query ) ? '' : '?' . $url_query ); - - $url_path = wpcf_getarr( $url_components, 'path' ); - $path_ends_with_slash = ( substr( $url_path, -1 ) == '/' ); - - if( empty( $url_query ) && $path_ends_with_slash ) { - // Omit last slash when it would be the last label character - $url_path = substr( $url_path, 0, strlen( $url_path ) -1 ); - } - - $label = sprintf( - '%s%s%s', - wpcf_getarr( $url_components, 'host' ), - $url_path, - $url_query - ); - - return $label; - } - -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/toolset_forms.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/toolset_forms.php deleted file mode 100644 index 64951e9..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/field/renderer/toolset_forms.php +++ /dev/null @@ -1,81 +0,0 @@ -form_id = $form_id; - } - - - /** - * Additional setup of the renderer. - * - * @param $args array Following arguments are supported: - * @type string $form_id - * @type bool $hide_field_title - */ - public function setup( $args = array() ) { - - $this->form_id = wpcf_getarr( $args, 'form_id', $this->form_id ); - - $this->hide_field_title = (bool) wpcf_getarr( $args, 'hide_field_title', $this->hide_field_title ); - } - - /** - * @param bool $echo - * - * @return string - */ - public function render( $echo = false ) { - - $field_config = $this->get_toolset_forms_config(); - - if( $this->hide_field_title ) { - $field_config['title'] = ''; - } - - $value_in_intermediate_format = $this->field->get_value(); - $output = wptoolset_form_field( $this->get_form_id(), $field_config, $value_in_intermediate_format ); - - if( $echo ) { - echo $output; - } - - return $output; - } - - - protected function get_form_id() { return $this->form_id; } - - - protected function get_toolset_forms_config() { - //$this->ensure_toolset_forms_includes(); - return wptoolset_form_filter_types_field( $this->field->get_definition()->get_definition_array(), $this->field->get_object_id() ); - } - - - // Not needed - // - // private static $toolset_forms_included = false; - // - // protected function ensure_toolset_forms_includes() { - // if( ! self::$toolset_forms_included ) { - // // ... - // } - // - // self::$toolset_forms_included = true; - //} -} \ No newline at end of file diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/fields.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/fields.php deleted file mode 100644 index 52f5cbc..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/fields.php +++ /dev/null @@ -1,188 +0,0 @@ - - */ -class WPCF_Fields -{ - - /** - * Holds all available field types and their config data. - * - * @var type - */ - static $fieldTypesData = null; - - /** - * Returns array of available (registered) field types - * and paths to config files. - * - * @return array - */ - public static function getFieldsTypes() { - $fields = array( - 'audio' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/audio.php', - 'checkboxes' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/checkboxes.php', - 'checkbox' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/checkbox.php', - 'colorpicker' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/colorpicker.php', - 'date' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/date.php', - 'email' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/email.php', - 'embed' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/embed.php', - 'file' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/file.php', - 'image' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/image.php', - 'map' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/map.php', - 'numeric' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/numeric.php', - 'phone' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/phone.php', - 'radio' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/radio.php', - 'select' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/select.php', - 'skype' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/skype.php', - 'textarea' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/textarea.php', - 'textfield' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/textfield.php', - 'twitter' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/twitter.php', - 'url' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/url.php', - 'video' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/video.php', - 'wysiwyg' => WPCF_EMBEDDED_INC_ABSPATH . '/fields/wysiwyg.php', - ); - return apply_filters( 'types_register_fields', $fields ); - } - - /** - * Returns array of available (registered) field types - * and their config data. - * - * @return type - */ - public static function getFieldsTypesData() { - if ( !is_null( self::$fieldTypesData ) ) { - return self::$fieldTypesData; - } - self::$fieldTypesData = self::getFieldsTypes(); - foreach ( self::$fieldTypesData as $type => $path ) { - $data = self::getFieldTypeConfig( $path ); - if ( !empty( $data ) ) { - self::$fieldTypesData[$type] = $data; - } else { - unset( self::$fieldTypesData[$type] ); - } - if ( isset($data['wp_version']) - && wpcf_compare_wp_version( $data['wp_version'], '<' ) ) { - unset( self::$fieldTypesData[$type] ); - } - } - return self::$fieldTypesData; - } - - /** - * Get field type data. - * - * @param type $type - * @return type - */ - public static function getFieldTypeData( $type ) { - $fields = self::getFieldsTypes(); - return isset( $fields[$type] ) ? self::getFieldTypeConfig( $fields[$type] ) : array(); - } - - /** - * Returns data for certain field type. - * - * @param string $path - * @return array - */ - public static function getFieldTypeConfig( $path ) { - if ( !is_string( $path ) ) { - return array(); - } - if ( file_exists( $path ) ) { - require_once $path; - if ( function_exists( 'wpcf_fields_' . basename( $path, '.php' ) ) ) { - return call_user_func( 'wpcf_fields_' . basename( $path, '.php' ) ); - } - } - return array(); - } - - /** - * Get fields. - * - * Parameters for - * wpcf_admin_fields_get_fields() - * - * $only_active = false - * $disabled_by_type = false - * $strictly_active = false - * - * @return \stdClass - */ - public static function getFields( $args = array(), $toolset = 'types' ) { - $active = isset( $args['active'] ) ? (bool) $args['active'] : true; - return wpcf_admin_fields_get_fields( $active ); - } - - /** - * Checks if field is under control. - * - * @param type $field_key - * @return type - */ - public static function isUnderControl( $field_key ) { - $fields = self::getFields(); - return !empty( $fields[$field_key] ); - } - - /** - * Enqueue all files from config - */ - public static function enqueueScript( $field ) { - $config = (object) self::getFieldTypeData( $field ); - if ( !empty( $config->meta_box_js ) ) { - foreach ( $config->meta_box_js as $handle => $data_script ) { - if ( isset( $data_script['inline'] ) ) { - add_action( 'admin_footer', $data_script['inline'] ); - continue; - } - if ( !isset( $data_script['src'] ) ) { - continue; - } - $deps = isset($data_script['deps']) && !empty( $data_script['deps'] ) ? $data_script['deps'] : array(); - $ver = !empty( $data_script['ver'] ) ? $data_script['ver'] : WPCF_VERSION; - wp_enqueue_script( $handle, $data_script['src'], $deps, $ver); - } - } - } - - /** - * Enqueue all files from config - */ - public static function enqueueStyle( $field ) { - $config = (object) self::getFieldTypeData( $field ); - if ( !empty( $config->meta_box_css ) ) { - foreach ( $config->meta_box_css as $handle => $data_script ) { - $deps = !empty( $data_script['deps'] ) ? $data_script['deps'] : array(); - if ( isset( $data_script['inline'] ) ) { - add_action( 'admin_head', $data_script['inline'] ); - continue; - } - if ( !isset( $data_script['src'] ) ) { - continue; - } - wp_enqueue_style( $handle, $data_script['src'], $deps, - WPCF_VERSION ); - } - } - } - -} diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/forms.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/forms.php deleted file mode 100644 index 1acf00a..0000000 --- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/types/embedded/classes/forms.php +++ /dev/null @@ -1,1170 +0,0 @@ - 'markup', - '#markup' => wp_nonce_field( $id, '_wpnonce_wpcf', true, false ) - ); - - $this->_id = $id; - $this->_elements = $form; - - do_action( 'wpcf_form_autohandle', $id, $form, $this ); - do_action( 'wpcf_form_autohandle_' . $id, $form, $this ); - - // get submitted data - if ( $this->isSubmitted() ) { - - do_action( 'wpcf_form_autohandle_submit', $id, $form, $this ); - do_action( 'wpcf_form_autohandle_submit_' . $id, $form, $this ); - - // check if errors (validation) - $this->validate( $this->_elements ); - - do_action( 'wpcf_form_autohandle_validate', $id, $form, $this ); - do_action( 'wpcf_form_autohandle_validate_' . $id, $form, $this ); - - // callback - if ( empty( $this->_errors ) ) { - - if ( isset( $form['#form']['callback'] ) ) { - if ( is_array( $form['#form']['callback'] ) ) { - foreach ( $form['#form']['callback'] as $callback ) { - if ( is_callable( $callback ) ) { - call_user_func( $callback, $this ); - } - } - } else { - if ( is_callable( $form['#form']['callback'] ) ) { - call_user_func( $form['#form']['callback'], $this ); - } - } - } - // Maybe triggered by callback function - if ( empty( $this->_errors ) ) { - // redirect - do_action( 'wpcf_form_autohandle_redirection', $id, $form, - $this ); - do_action( 'wpcf_form_autohandle_redirection_' . $id, $form, - $this ); - if( ! headers_sent() ) { - if ( !isset( $form['#form']['redirection'] ) ) { - header( 'Location: ' . $_SERVER['REQUEST_URI'] ); - } else if ( $form['#form']['redirection'] != false ) { - header( 'Location: ' . $form['#form']['redirection'] ); - } - } - } - } - } - } - - /** - * Checks if form is submitted. - * - * @param type $id - * @return type - */ - public function isSubmitted( $id = '' ) - { - if ( empty( $id ) ) { - $id = $this->_id; - } - return ( - isset( $_REQUEST['_wpnonce_wpcf'] ) - && wp_verify_nonce( $_REQUEST['_wpnonce_wpcf'], $id ) - ); - } - - /** - * Loops over elements and validates them. - * - * @param type $elements - */ - public function validate( &$elements ) - { - require_once WPCF_EMBEDDED_ABSPATH . '/classes/validate.php'; - foreach ( $elements as $key => &$element ) { - if ( !isset( $element['#type'] ) - || !$this->_isValidType( $element['#type'] ) ) { - continue; - } - if ( $element['#type'] != 'fieldset' ) { - if ( isset( $element['#name'] ) - && !in_array( $element['#type'], - array('submit', 'reset', 'button') ) ) { - // Set submitted data - if ( !in_array( $element['#type'], array('checkboxes') ) - && empty( $element['#forced_value'] ) ) { - $element['#value'] = $this->getSubmittedData( $element ); - } else if ( !empty( $element['#options'] ) - && empty( $element['#forced_value'] ) ) { - foreach ( $element['#options'] as $option_key => $option ) { - $option['#type'] = 'checkbox'; - $element['#options'][$option_key]['#value'] = $this->getSubmittedData( $option ); - } - } - } - // Validate - if ( isset( $element['#validate'] ) ) { - $this->validateElement( $element ); - } - } else if ( isset( $element['#type'] ) - && $element['#type'] == 'fieldset' ) { - $this->validate( $element ); - } else if ( is_array( $element ) ) { - $this->validate( $element ); - } - } - } - - /** - * Validates element. - * - * @param type $element - */ - public function validateElement( &$element ) - { - $check = Wpcf_Validate::check( $element['#validate'], $element['#value'] ); - if ( isset( $check['error'] ) ) { - $this->_errors = true; - $element['#error'] = $check['message']; - if ( isset( $element['wpcf-id'] ) ) { - $this->_elements_not_valid[$element['wpcf-id']] = $element; - } - } - } - - /** - * Returns not valid elements. - * - * @return type - */ - public function get_not_valid() { - return $this->_elements_not_valid; - } - - /** - * Checks if there are errors. - * - * @return type - */ - public function isError() - { - return $this->_errors; - } - - /** - * Sets errors to true. - */ - public function triggerError() - { - $this->_errors = true; - } - - /** - * Renders form. - */ - public function renderForm() - { - // loop over elements and render them - return $this->renderElements( $this->_elements ); - } - - /** - * Counts element types. - * - * @param type $type - * @return type - */ - private function _count( $type ) { - if ( !isset( $this->_count[$type] ) ) { - $this->_count[$type] = 0; - } - $this->_count[$type] += 1; - return $this->_count[$type]; - } - - /** - * Check if element is of valid type - * - * @param string $type - * @return boolean - */ - private function _isValidType( $type ) - { - return in_array( - $type, - array( - 'button', - 'checkbox', - 'checkboxes', - 'fieldset', - 'file', - 'hidden', - 'markup', - 'radio', - 'radios', - 'reset', - 'select', - 'submit', - 'textarea', - 'textfield', - 'thumbnail', - 'notice', - ) - ); - } - - /** - * Renders elements. - * - * @param type $elements - * @return type - */ - public function renderElements( $elements ) - { - $output = ''; - foreach ( $elements as $key => $element ) { - if ( !isset( $element['#type'] ) - || !$this->_isValidType( $element['#type'] ) ) { - continue; - } - if ( $element['#type'] != 'fieldset' ) { - $output .= $this->renderElement( $element ); - } else if ( isset( $element['#type'] ) - && $element['#type'] == 'fieldset' ) { - $buffer = $this->renderElements( $element ); - $output .= $this->fieldset( $element, 'wrap', $buffer ); - } else if ( is_array( $element ) ) { - $output .= $this->renderElements( $element ); - } - } - return $output; - } - - /** - * Renders element. - * - * Depending on element type, it calls class methods. - * - * @param array $element - * @return HTML formatted output - */ - public function renderElement( $element ) - { - $method = $element['#type']; - if ( !isset( $element['#name'] ) && !in_array($element['#type'], array('notice', 'markup') )) { - if ( !isset( $element['#attributes']['name'] ) ) { - return '#name or #attributes[\'name\'] required!'; - } else { - $element['#name'] = $element['#attributes']['name']; - } - } - if ( is_callable( array($this, $method) ) ) { - if ( !isset( $element['#id'] ) ) { - if ( isset( $element['#attributes']['id'] ) ) { - $element['#id'] = $element['#attributes']['id']; - } elseif ( isset($element['#name']) ) { - $element['#id'] = sprintf('wpcf-%s-%s', $element['#type'], md5($element['#name'])); - } else { - $element['#id'] = $element['#type'] . '-' . $this->_count( $element['#type'] ); - } - } - if ( isset( $this->_errors[$element['#id']] ) ) { - $element['#error'] = $this->_errors[$element['#id']]; - } - // Add JS validation - if ( !empty( $element['#validate'] ) ) { - wpcf_form_add_js_validation( $element ); - } - return $this->{$method}( $element ); - } - } - - /** - * Sets other element attributes. - * - * @param array $element - * @return string - */ - private function _setElementAttributes( $element ) - { - /** - * sanitize #attributes type - */ - if ( - !isset( $element['#attributes'] ) - || !is_array($element['#attributes']) - ) { - $element['#attributes'] = array(); - } - $attributes = ''; - $error_class = isset( $element['#error'] ) ? ' ' . $this->css_class . '-error ' . $this->css_class . '-' . $element['#type'] . '-error ' . ' form-' . $element['#type'] . '-error ' . $element['#type'] . '-error form-error ' : ''; - $class = $this->css_class . '-' . $element['#type'] . ' form-' . $element['#type'] . ' ' . $element['#type']; - foreach ( $element['#attributes'] as $attribute => $value ) { - // Prevent undesired elements - if ( in_array( $attribute, array('id', 'name') ) ) { - continue; - } - // Append class values - if ( $attribute == 'class' ) { - $value = $value . ' ' . $class . $error_class; - } - // Set return string - $attributes .= ' ' . $attribute . '="' . $value . '"'; - } - if ( !isset( $element['#attributes']['class'] ) ) { - $attributes .= ' class="' . $class . $error_class . '"'; - } - /** - * disable if is setup #disable - */ - if ( - !in_array('disabled', $element['#attributes']) - && isset( $element['#disable'] ) - && $element['#disable'] - ) { - $attributes .= ' disabled="disabled"'; - } - /** - * disable if is setup #disable - */ - if ( - !in_array('readonly', $element['#attributes']) - && isset( $element['#disable'] ) - && $element['#disable'] - ) { - $attributes .= ' readonly="readonly"'; - } - return $attributes; - } - - /** - * Sets render elements. - * - * @param array $element - */ - private function _setRender( $element ) - { - if ( !isset( $element['#id'] ) ) { - if ( isset( $element['#attributes']['id'] ) ) { - $element['#id'] = $element['#attributes']['id']; - } else { - $element['#id'] = 'form-' . md5( serialize( $element ) ) . '-' - . $this->_count( $element['#type'] ); - } - } - $element['_attributes_string'] = $this->_setElementAttributes( $element ); - $element['_render'] = array(); - $element['_render']['prefix'] = isset( $element['#prefix'] ) ? $element['#prefix'] . "\r\n" : ''; - $element['_render']['suffix'] = isset( $element['#suffix'] ) ? $element['#suffix'] . "\r\n" : ''; - $element['_render']['before'] = isset( $element['#before'] ) ? $element['#before'] . "\r\n" : ''; - $element['_render']['after'] = isset( $element['#after'] ) ? $element['#after'] . "\r\n" : ''; - /** - * label - */ - $element['_render']['label'] = $lebel = ''; - if (isset($element['#label'])) { - $label = $element['#label']; - } else if (isset($element['#title'])) { - $label = $element['#title']; - } - if ( !empty($label) ) { - /** - * add tooltip - */ - if ( isset( $element['#attributes']['tooltip'] ) ) { - $label .= sprintf( - ' ', - esc_attr($element['#attributes']['tooltip']) - ); - } - $element['_render']['label'] = sprintf( - '', - esc_attr($this->css_class), - esc_attr($this->css_class), - esc_attr($element['#type']), - esc_attr($element['#id']), - stripslashes( $label ) - ); - } - /** - * title - */ - $element['_render']['title'] = $this->_setElementTitle( $element ); - $element['_render']['description'] = !empty( $element['#description'] ) ? $this->_setElementDescription( $element ) : ''; - $element['_render']['error'] = $this->renderError( $element ) . "\r\n"; - - return $element; - } - - /** - * Applies pattern to output. - * - * Pass element property #pattern to get custom renedered element. - * - * @param array $pattern - * Accepts: