Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* SlideImage - moved statics from config.yml to class * FlexSlider - added requirements to `contentcontrollerInit()` * FlexSliderExtension - added depreciation method as this file is no longer used * updated README to remove references to `FlexSliderExtension`
- Loading branch information
Showing
5 changed files
with
164 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
--- | ||
Name: FlexSlider | ||
--- | ||
SlideImage: | ||
db: | ||
Name: Varchar(255) | ||
Headline: Varchar(255) | ||
Description: Text | ||
SortOrder: Int | ||
ShowSlide: Boolean | ||
has_one: | ||
Image: Image | ||
Page: Page | ||
PageLink: SiteTree | ||
singular_name: | ||
- Slide | ||
plural_name: | ||
- Slides | ||
default_order: | ||
- SortOrder | ||
summary_fields: | ||
Image.CMSThumbnail: Image | ||
Name: Name | ||
searchable_fields: | ||
Name: Name | ||
Title: Title | ||
Description: Description | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,15 @@ | ||
<?php | ||
|
||
/** | ||
* Class FlexSliderExtension | ||
* | ||
* @deprecated 1.0.0 This class's methods have been moved to {@link FlexSlider} | ||
*/ | ||
class FlexSliderExtension extends Extension | ||
{ | ||
public function onAfterInit() | ||
public function __construct() | ||
{ | ||
|
||
// Flexslider options | ||
$animate = ($this->owner->Animate) ? 'true' : 'false'; | ||
$loop = ($this->owner->Loop) ? 'true' : 'false'; | ||
$sync = ($this->owner->ThumbnailNav == true) ? "sync: '#carousel'," : ''; | ||
$before = (method_exists($this->owner->ClassName, 'flexSliderBeforeAction')) | ||
? $this->owner->flexSliderBeforeAction() | ||
: 'function(){}'; | ||
$after = (method_exists($this->owner->ClassName, 'flexSliderAfterAction')) | ||
? $this->owner->flexSliderAfterAction() | ||
: 'function(){}'; | ||
$speed = (method_exists($this->owner->ClassName, 'setFlexSliderSpeed')) | ||
? $this->owner->setFlexSliderSpeed() | ||
: 7000; | ||
|
||
// only call custom script if page has Slides and DataExtension | ||
if (Object::has_extension($this->owner->data()->ClassName, 'FlexSlider')) { | ||
if ($this->owner->data()->Slides()->exists()) { | ||
Requirements::customScript(" | ||
(function($) { | ||
$(document).ready(function(){ | ||
$('.flexslider').flexslider({ | ||
slideshow: ".$animate.", | ||
animation: '".$this->owner->Animation."', | ||
animationLoop: ".$loop.", | ||
controlNav: true, | ||
directionNav: true, | ||
prevText: '', | ||
nextText: '', | ||
pauseOnAction: true, | ||
pauseOnHover: true, | ||
".$sync." | ||
start: function(slider){ | ||
$('body').removeClass('loading'); | ||
}, | ||
before: ".$before.', | ||
after: '.$after.', | ||
slideshowSpeed: '.$speed.' | ||
}); | ||
}); | ||
}(jQuery));'); | ||
} | ||
} | ||
trigger_error('Class no longer used, please remove references to this class from any extension declarations.', E_USER_NOTICE); | ||
parent::__construct(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters