Skip to content

Commit

Permalink
first pass revamped timeline component
Browse files Browse the repository at this point in the history
* this is a breaking change *

the filter for aesop_timeline_scroll_container has chnage to article from 'entry-content'. this means the timeline component is now compatible with 99% of themes.
  • Loading branch information
Bearded Avenger committed Sep 4, 2014
1 parent 05caf74 commit 98749ab
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 19 deletions.
2 changes: 1 addition & 1 deletion public/assets/css/ai-core.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/assets/css/components/timeline.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/assets/img/timeline-break.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/assets/less/components/base.less
Expand Up @@ -44,4 +44,15 @@
padding: @caption-padding;
background: @caption-bg;
font-size: @font-size-small;
}

.clearfix() {
&:before,
&:after {
content: " "; // 1
display: table; // 2
}
&:after {
clear: both;
}
}
33 changes: 33 additions & 0 deletions public/assets/less/components/timeline.less
@@ -0,0 +1,33 @@
@import 'base.less';

.aesop-timeline {
position: fixed;
bottom:0;
left:0;
right:0;

ol {
margin:0;
padding:0;
.clearfix();
position:relative;
background:@baseContrast;
padding:5px 10px;

li {
display: inline-block;
margin-right:5px;

&:last-child {
margin-right:0;
}

a {
text-transform: uppercase;
font-size:12px;
color:inherit;
padding:2px 4px;
}
}
}
}
19 changes: 19 additions & 0 deletions public/assets/less/theme.less
Expand Up @@ -228,6 +228,25 @@
}
}

//timelnie
.aesop-timeline {

ol {

&:after {
content:'';
background-image: url('../img/timeline-break.png');
background-repeat: repeat-x;
position: absolute;
height:10px;
width:100%;
left:0;
right:0;
bottom:-5px;
}
}
}

.aesop-error {
background: #d9534f;
color:white;
Expand Down
26 changes: 8 additions & 18 deletions public/includes/components/component-timeline.php
Expand Up @@ -55,35 +55,30 @@ function __construct(){
// add a body class if timeline is active
add_filter('body_class', array($this,'body_class'));

// draw the timeline div, conditionally depending on version
if (AI_CORE_VERSION < '1.0.5') {
_deprecated_function( 'aesop_inside_body_top', '1.0.5', 'ase_theme_body_inside_top' );
} else {
add_action('ase_theme_body_inside_top', array($this,'draw_timeline')); // post 1.0.5
}

}

function aesop_timeline_loader(){

// maintain backwards compatibility
$offset = 0;

// allow theme developers to determine the offset amount
$timelineOffset = apply_filters('aesop_timeline_scroll_offset', $offset );
$timelineOffset = apply_filters('aesop_timeline_scroll_offset', 0 );

// filterable content class
$contentClass = apply_filters('aesop_timeline_scroll_container', '.aesop-entry-content');
$contentClass = apply_filters('aesop_timeline_scroll_container', 'article');

// filterable target class
$appendTo = apply_filters('aesop_timeline_scroll_nav', '.aesop-timeline');

?>
<!-- Aesop Timeline -->
<script>
jQuery(document).ready(function(){

jQuery('body').append('<div class="aesop-timeline"></div>');

jQuery('<?php echo $contentClass;?>').scrollNav({
sections: '.aesop-timeline-stop',
arrowKeys: true,
insertTarget: '.aesop-timeline',
insertTarget: '<?php echo $appendTo;?>',
insertLocation: 'appendTo',
showTopLink: false,
showHeadline: false,
Expand All @@ -102,11 +97,6 @@ function aesop_timeline_loader(){
<?php
}

function draw_timeline(){

?><div class="aesop-timeline"></div><?php

}

function body_class($classes) {

Expand Down

0 comments on commit 98749ab

Please sign in to comment.