diff --git a/flexslider.info.yml b/flexslider.info.yml index 84bc1fb..be6da59 100644 --- a/flexslider.info.yml +++ b/flexslider.info.yml @@ -5,4 +5,4 @@ dependencies: - drupal:image type: module configure: entity.flexslider.collection -core_version_requirement: ^8 || ^9 || ^10 +core_version_requirement: ^9 || ^10 diff --git a/flexslider.install b/flexslider.install index 1eb3559..ede4cab 100755 --- a/flexslider.install +++ b/flexslider.install @@ -28,23 +28,14 @@ function flexslider_requirements($phase) { // Check to see if the flexslider library is available. if ($phase == 'runtime') { - // @todo Remove this conditional once 8.9 is the minimum supported core - // version. - if (\Drupal::hasService('library.libraries_directory_file_finder')) { - /** @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder $library_file_finder */ - $library_file_finder = \Drupal::service('library.libraries_directory_file_finder'); - $found = (bool) $library_file_finder->find('flexslider/jquery.flexslider-min.js'); - } - else { - $path = DRUPAL_ROOT . '/libraries/flexslider/jquery.flexslider-min.js'; - $found = file_exists($path); + $path = DRUPAL_ROOT . '/libraries/flexslider/jquery.flexslider-min.js'; + $found = file_exists($path); - // Find the library in the profiles path if not found. - if (!$found) { - $path = \Drupal::service('extension.list.profile')->getPath(\Drupal::installProfile()); - $path .= '/libraries/flexslider/jquery.flexslider-min.js'; - $found = file_exists($path); - } + // Find the library in the profiles path if not found. + if (!$found) { + $path = \Drupal::service('extension.list.profile')->getPath(\Drupal::installProfile()); + $path .= '/libraries/flexslider/jquery.flexslider-min.js'; + $found = file_exists($path); } if (!$found) { diff --git a/flexslider.module b/flexslider.module index e9dc616..0103d80 100755 --- a/flexslider.module +++ b/flexslider.module @@ -8,65 +8,6 @@ use Drupal\Core\Url; use Drupal\flexslider\Entity\Flexslider; -/** - * Implements hook_libraries_info(). - * - * @todo Remove this once 8.9 is the minimal core version and Libraries is no - * longer required. - */ -function flexslider_libraries_info() { - $libraries['flexslider'] = [ - 'name' => 'FlexSlider', - 'vendor url' => 'http://www.woothemes.com/flexslider/', - 'download url' => 'https://github.com/woothemes/FlexSlider', - 'version arguments' => [ - 'file' => 'jquery.flexslider-min.js', - // e.g. jQuery FlexSlider v2.1. - 'pattern' => '/jQuery FlexSlider v(\d+\.+\d+(\.+\d+)?)/', - 'lines' => 2, - ], - 'files' => [ - 'js' => [ - 'jquery.flexslider-min.js', - ], - 'css' => [ - 'flexslider.css', - ], - ], - ]; - - return $libraries; -} - -/** - * Implements hook_libraries_info_alter(). - * - * @todo Remove this once 8.9 is the minimal core version and Libraries is no - * longer required. - */ -function flexslider_libraries_info_alter(&$libraries) { - $debug = \Drupal::config('flexslider.settings')->get('flexslider_debug'); - if ($debug) { - // Switch to the unminified version of the library. - if (isset($libraries['flexslider'])) { - $libraries['flexslider']['files']['js'] = [ - 'jquery.flexslider.js', - ]; - } - } - - // Add support for jQuery Easing module. - if (\Drupal::moduleHandler()->moduleExists('jqeasing')) { - $libraries['flexslider']['dependencies'][] = 'easing (>=1.3)'; - } - - // Remove the library css if privileged user disabled it. - if (!\Drupal::config('flexslider.settings')->get('flexslider_css')) { - if (!empty($libraries['flexslider']['files']['css']) && ($key = array_search('flexslider.css', $libraries['flexslider']['files']['css']))) { - unset($libraries['flexslider']['files']['css'][$key]); - } - } -} /** * Implements hook_library_info_alter(). @@ -107,12 +48,6 @@ function flexslider_library_info_alter(&$libraries, $extension) { ]; } - // Add support for jQuery Easing module. - if (\Drupal::moduleHandler()->moduleExists('jqeasing')) { - // Using the jqeasing module. - $libraries['flexslider']['dependencies'][] = 'jqeasing.easing'; - } - } } @@ -256,46 +191,3 @@ function flexslider_add($id = NULL, $optionset = NULL) { return $attached; } - -/** - * List of all easing methods available from jQuery Easing v1.3. - * - * @return array - * Array of easing methods - */ -function _flexslider_jqeasing_options() { - return [ - "jswing" => "jswing", - "def" => "def", - "easeInQuad" => "easeInQuad", - "easeOutQuad" => "easeOutQuad", - "easeInOutQuad" => "easeInOutQuad", - "easeInCubic" => "easeInCubic", - "easeOutCubic" => "easeOutCubic", - "easeInOutCubic" => "easeInOutCubic", - "easeInQuart" => "easeInQuart", - "easeOutQuart" => "easeOutQuart", - "easeInOutQuart" => "easeInOutQuart", - "easeInQuint" => "easeInQuint", - "easeOutQuint" => "easeOutQuint", - "easeInOutQuint" => "easeInOutQuint", - "easeInSine" => "easeInSine", - "easeOutSine" => "easeOutSine", - "easeInOutSine" => "easeInOutSine", - "easeInExpo" => "easeInExpo", - "easeOutExpo" => "easeOutExpo", - "easeInOutExpo" => "easeInOutExpo", - "easeInCirc" => "easeInCirc", - "easeOutCirc" => "easeOutCirc", - "easeInOutCirc" => "easeInOutCirc", - "easeInElastic" => "easeInElastic", - "easeOutElastic" => "easeOutElastic", - "easeInOutElastic" => "easeInOutElastic", - "easeInBack" => "easeInBack", - "easeOutBack" => "easeOutBack", - "easeInOutBack" => "easeInOutBack", - "easeInBounce" => "easeInBounce", - "easeOutBounce" => "easeOutBounce", - "easeInOutBounce" => "easeInOutBounce", - ]; -} diff --git a/flexslider_example/flexslider_example.info.yml b/flexslider_example/flexslider_example.info.yml index af21634..2dcbd02 100644 --- a/flexslider_example/flexslider_example.info.yml +++ b/flexslider_example/flexslider_example.info.yml @@ -1,7 +1,7 @@ name: 'FlexSlider Example' description: 'Provide FlexSlider Example content type and related configuration. Used for generating example FlexSlider implementations' type: module -core_version_requirement: ^8 || ^9 || ^10 +core_version_requirement: ^9 || ^10 package: FlexSlider dependencies: - drupal:field diff --git a/flexslider_fields/flexslider_fields.info.yml b/flexslider_fields/flexslider_fields.info.yml index 70e288b..d30b317 100644 --- a/flexslider_fields/flexslider_fields.info.yml +++ b/flexslider_fields/flexslider_fields.info.yml @@ -1,6 +1,6 @@ name: 'FlexSlider Fields' description: 'Adds a display mode in Fields for FlexSlider' -core_version_requirement: ^8 || ^9 || ^10 +core_version_requirement: ^9 || ^10 package: FlexSlider dependencies: - flexslider:flexslider diff --git a/flexslider_views/flexslider_views.info.yml b/flexslider_views/flexslider_views.info.yml index f5e510d..a8a3319 100644 --- a/flexslider_views/flexslider_views.info.yml +++ b/flexslider_views/flexslider_views.info.yml @@ -1,6 +1,6 @@ name: 'FlexSlider Views Style' description: 'Adds a Views style plugin for FlexSlider' -core_version_requirement: ^8 || ^9 || ^10 +core_version_requirement: ^9 || ^10 package: FlexSlider dependencies: - drupal:views