You are here

private function RoyalSliderOptionSetEntity::getOptionDefault in RoyalSlider Integration 8

1 call to RoyalSliderOptionSetEntity::getOptionDefault()
RoyalSliderOptionSetEntity::buildJsOptionSet in src/Entity/RoyalSliderOptionSetEntity.php
Build the javascript array from an optionset.

File

src/Entity/RoyalSliderOptionSetEntity.php, line 682
Contains \Drupal\royalslider\Entity\RoyalSliderOptionSetEntity.

Class

RoyalSliderOptionSetEntity
Defines a RoyalSliderOptionSet configuration entity class.

Namespace

Drupal\royalslider\Entity

Code

private function getOptionDefault($key) {
  $defaults = [
    // General.
    'manuallyInit' => (bool) FALSE,
    'loop' => (bool) FALSE,
    'loopRewind' => (bool) FALSE,
    'randomizeSlides' => (bool) FALSE,
    'usePreloader' => (bool) TRUE,
    'numImagesToPreload' => 4,
    'slidesOrientation' => 'horizontal',
    'globalCaption' => FALSE,
    // Full Screen.
    'fullscreen' => array(
      'enabled' => FALSE,
      'keyboardNav' => TRUE,
      'buttonFS' => TRUE,
      'nativeFS' => FALSE,
    ),
    // Navigation.
    'controlNavigation' => 'bullets',
    'controlsInside' => TRUE,
    'sliderDrag' => TRUE,
    'sliderTouch' => TRUE,
    'keyboardNavEnabled' => FALSE,
    'navigateByClick' => TRUE,
    'arrowsNav' => TRUE,
    'arrowsNavAutoHide' => TRUE,
    'arrowsNavHideOnTouch' => FALSE,
    // Thumbnails.
    'thumbs' => array(
      'drag' => TRUE,
      'touch' => TRUE,
      'orientation' => 'horizontal',
      'arrows' => TRUE,
      'spacing' => 4,
      'arrowsAutoHide' => FALSE,
      'autoCenter' => TRUE,
      'transitionSpeed' => 600,
      'fitInViewport' => TRUE,
      'firstMargin' => TRUE,
      'arrowLeft' => NULL,
      'arrowRight' => NULL,
      'appendSpan' => FALSE,
    ),
    // Transitions.
    'transitionType' => 'move',
    'transitionSpeed' => 600,
    'easeInOut' => 'easeInOutSine',
    'easeOut' => 'easeOutSine',
    'allowCSS3' => TRUE,
    // Note: that since only 3 easing methods are available
    // in CSS3 by default with RoyalSlider and we'd have to implement the rest
    // ourselves, it's probably best to set this to FALSE in most Option Sets.
    // However, in order to maintain compatibility with the RoyalSlider API
    // we're leaving this be.
    'addActiveClass' => FALSE,
    'fadeinLoadedSlide' => TRUE,
    // Dimensions.
    'autoScaleSlider' => FALSE,
    'autoScaleSliderWidth' => 800,
    'autoScaleSliderHeight' => 400,
    'autoHeight' => FALSE,
    'imageScaleMode' => 'fit-if-smaller',
    'imageScalePadding' => 4,
    'imageAlignCenter' => TRUE,
    'imgWidth' => NULL,
    'imgHeight' => NULL,
    'slidesSpacing' => 8,
    // Autoplay
    'autoplay' => array(
      'enabled' => FALSE,
      'stopAtAction' => TRUE,
      'pauseOnHover' => TRUE,
      'delay' => 300,
    ),
    // Visible Nearby
    'visibleNearby' => array(
      'enabled' => TRUE,
      'centerArea' => 0.6,
      'center' => TRUE,
      'navigateByCenterClick' => TRUE,
      'breakpoint' => 0,
      'breakpointCenterArea' => 0.8,
    ),
    // Deep linking
    'deeplinking' => array(
      'enabled' => FALSE,
      'change' => FALSE,
      'prefix' => '',
    ),
    // Video
    'video' => array(
      'autoHideArrows' => TRUE,
      'autoHideControlNav' => FALSE,
      'autoHideBlocks' => FALSE,
      'youTubeCode' => '<iframe src="http://www.youtube.com/embed/%id%?rel=1&autoplay=1&showinfo=0" frameborder="no"></iframe>',
      'vimeoCode' => '<iframe src="http://player.vimeo.com/video/%id%?byline=0&amp;portrait=0&amp;autoplay=1" frameborder="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
    ),
    // Drupal-specific.
    'drupalAutoSetSliderDimensions' => FALSE,
    'drupalAutoSetImageDimensions' => TRUE,
  ];
  return $defaults[$key];
}