mirror of
https://ghproxy.net/https://github.com/AlxMedia/blogside.git
synced 2025-08-26 16:48:09 +08:00
Start of 1.0.1
This commit is contained in:
parent
750225534a
commit
7d6260f863
18 changed files with 6851 additions and 120 deletions
|
@ -1,7 +0,0 @@
|
|||
Theme : Blogline
|
||||
Version : 1.0.0
|
||||
Author : Alexander "Alx" Agnarson - http://alxmedia.se
|
||||
|
||||
February 3 2016 - 1.0.0
|
||||
===========================================================
|
||||
- Theme released
|
|
@ -2,7 +2,7 @@
|
|||
<div class="post-inner post-hover">
|
||||
|
||||
<div class="post-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-medium'); ?>
|
||||
<?php elseif ( get_theme_mod('placeholder') != 'off' ): ?>
|
||||
|
@ -18,7 +18,7 @@
|
|||
</div><!--/.post-thumbnail-->
|
||||
|
||||
<h3 class="post-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h3><!--/.post-title-->
|
||||
|
||||
<ul class="post-meta group">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="post-inner post-hover">
|
||||
|
||||
<div class="post-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-medium'); ?>
|
||||
<?php elseif ( get_theme_mod('placeholder') != 'off' ): ?>
|
||||
|
@ -20,7 +20,7 @@
|
|||
<div class="post-content">
|
||||
|
||||
<h2 class="post-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h2><!--/.post-title-->
|
||||
|
||||
<ul class="post-meta group">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="post-inner post-hover">
|
||||
|
||||
<div class="post-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-list'); ?>
|
||||
<?php elseif ( get_theme_mod('placeholder') != 'off' ): ?>
|
||||
|
@ -20,7 +20,7 @@
|
|||
<div class="post-content">
|
||||
|
||||
<h2 class="post-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h2><!--/.post-title-->
|
||||
|
||||
<ul class="post-meta group">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<?php endif; ?>
|
||||
|
||||
<h2 class="post-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h2><!--/.post-title-->
|
||||
|
||||
<ul class="post-meta group">
|
||||
|
|
2337
fonts/font-awesome.css
vendored
Normal file
2337
fonts/font-awesome.css
vendored
Normal file
File diff suppressed because it is too large
Load diff
|
@ -66,12 +66,12 @@
|
|||
<div class="grid one-half">
|
||||
|
||||
<?php if ( get_theme_mod('footer-logo') ): ?>
|
||||
<img id="footer-logo" src="<?php echo get_theme_mod('footer-logo'); ?>" alt="<?php get_bloginfo('name'); ?>">
|
||||
<img id="footer-logo" src="<?php echo esc_url( get_theme_mod('footer-logo') ); ?>" alt="<?php get_bloginfo('name'); ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="copyright">
|
||||
<?php if ( get_theme_mod( 'copyright' ) ): ?>
|
||||
<p><?php echo get_theme_mod( 'copyright' ); ?></p>
|
||||
<p><?php echo esc_html( get_theme_mod( 'copyright' ) ); ?></p>
|
||||
<?php else: ?>
|
||||
<p><?php bloginfo(); ?> © <?php echo date( 'Y' ); ?>. <?php esc_html_e( 'All Rights Reserved.', 'blogline' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
@ -79,7 +79,7 @@
|
|||
|
||||
<?php if ( get_theme_mod( 'credit', 'on' ) == 'on' ): ?>
|
||||
<div id="credit">
|
||||
<p><?php esc_html_e('Powered by','blogline'); ?> <a href="<?php echo esc_url( 'http://wordpress.org' ); ?>" rel="nofollow">WordPress</a>. <?php esc_html_e('Theme by','blogline'); ?> <a href="<?php echo esc_url( 'http://alxmedia.se' ); ?>" rel="nofollow">Alx</a>.</p>
|
||||
<p><?php esc_html_e('Powered by','blogline'); ?> <a href="http://wordpress.org" rel="nofollow">WordPress</a>. <?php esc_html_e('Theme by','blogline'); ?> <a href="http://alxmedia.se" rel="nofollow">Alx</a>.</p>
|
||||
</div><!--/#credit-->
|
||||
<?php endif; ?>
|
||||
|
||||
|
|
|
@ -122,11 +122,11 @@ add_action( 'widgets_init', 'alx_sidebars' );
|
|||
if ( ! function_exists( 'alx_scripts' ) ) {
|
||||
|
||||
function alx_scripts() {
|
||||
wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/jquery.flexslider.min.js', array( 'jquery' ),'', false );
|
||||
wp_enqueue_script( 'fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array( 'jquery' ),'', true );
|
||||
wp_enqueue_script( 'owl-carousel', get_template_directory_uri() . '/js/owl.carousel.min.js', array( 'jquery' ),'', true );
|
||||
wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', array( 'jquery' ),'', true );
|
||||
if ( is_singular() ) { wp_enqueue_script( 'sharrre', get_template_directory_uri() . '/js/jquery.sharrre.min.js', array( 'jquery' ),'', true ); }
|
||||
wp_enqueue_script( 'blogline-flexslider', get_template_directory_uri() . '/js/jquery.flexslider.min.js', array( 'jquery' ),'', false );
|
||||
wp_enqueue_script( 'blogline-fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array( 'jquery' ),'', true );
|
||||
wp_enqueue_script( 'blogline-owl-carousel', get_template_directory_uri() . '/js/owl.carousel.min.js', array( 'jquery' ),'', true );
|
||||
wp_enqueue_script( 'blogline-scripts', get_template_directory_uri() . '/js/scripts.js', array( 'jquery' ),'', true );
|
||||
if ( is_singular() ) { wp_enqueue_script( 'blogline-sharrre', get_template_directory_uri() . '/js/jquery.sharrre.min.js', array( 'jquery' ),'', true ); }
|
||||
if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
|
||||
}
|
||||
|
||||
|
@ -139,10 +139,10 @@ add_action( 'wp_enqueue_scripts', 'alx_scripts' );
|
|||
if ( ! function_exists( 'alx_styles' ) ) {
|
||||
|
||||
function alx_styles() {
|
||||
wp_enqueue_style( 'style', get_stylesheet_uri() );
|
||||
if ( get_theme_mod('responsive','on') =='on' ) { wp_enqueue_style( 'responsive', get_template_directory_uri().'/responsive.css' ); }
|
||||
if ( get_theme_mod('custom','off') == 'on' ) { wp_enqueue_style( 'custom', get_template_directory_uri().'/custom.css' ); }
|
||||
wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/fonts/font-awesome.min.css' );
|
||||
wp_enqueue_style( 'blogline-style', get_stylesheet_uri() );
|
||||
if ( get_theme_mod('responsive','on') =='on' ) { wp_enqueue_style( 'blogline-responsive', get_template_directory_uri().'/responsive.css' ); }
|
||||
if ( get_theme_mod('custom','off') == 'on' ) { wp_enqueue_style( 'blogline-custom', get_template_directory_uri().'/custom.css' ); }
|
||||
wp_enqueue_style( 'blogline-font-awesome', get_template_directory_uri().'/fonts/font-awesome.min.css' );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -301,13 +301,13 @@ if ( ! function_exists( 'alx_social_links' ) ) {
|
|||
if ( isset($item['social-title']) && !empty($item['social-title']) )
|
||||
{ $title = 'title="' .esc_attr( $item['social-title'] ). '"'; } else $title = '';
|
||||
if ( isset($item['social-link']) && !empty($item['social-link']) )
|
||||
{ $link = 'href="' .esc_attr( $item['social-link'] ). '"'; } else $link = '';
|
||||
{ $link = 'href="' .esc_url( $item['social-link'] ). '"'; } else $link = '';
|
||||
if ( isset($item['social-target']) && !empty($item['social-target']) )
|
||||
{ $target = 'target="_blank"'; } else $target = '';
|
||||
if ( isset($item['social-icon']) && !empty($item['social-icon']) )
|
||||
{ $icon = 'class="fa ' .esc_attr( $item['social-icon'] ). '"'; } else $icon = '';
|
||||
if ( isset($item['social-color']) && !empty($item['social-color']) )
|
||||
{ $color = 'style="color: ' .$item['social-color']. ';"'; } else $color = '';
|
||||
{ $color = 'style="color: ' .esc_attr( $item['social-color'] ). ';"'; } else $color = '';
|
||||
|
||||
// Put them together
|
||||
if ( isset($item['social-title']) && !empty($item['social-title']) && isset($item['social-icon']) && !empty($item['social-icon']) && ($item['social-icon'] !='fa-') ) {
|
||||
|
@ -330,12 +330,12 @@ if ( ! function_exists( 'alx_site_title' ) ) {
|
|||
|
||||
// Text or image?
|
||||
if ( get_theme_mod('custom-logo') ) {
|
||||
$logo = '<img src="'.get_theme_mod('custom-logo').'" alt="'.get_bloginfo('name').'">';
|
||||
$logo = '<img src="'.esc_url( get_theme_mod('custom-logo') ).'" alt="'.get_bloginfo('name').'">';
|
||||
} else {
|
||||
$logo = get_bloginfo('name');
|
||||
}
|
||||
|
||||
$link = '<a href="'.home_url('/').'" rel="home">'.$logo.'</a>';
|
||||
$link = '<a href="'.esc_url( home_url('/') ).'" rel="home">'.$logo.'</a>';
|
||||
|
||||
if ( is_front_page() || is_home() ) {
|
||||
$sitename = '<h1 class="site-title">'.$link.'</h1>'."\n";
|
||||
|
@ -766,4 +766,49 @@ function alx_admin_panel_css() {
|
|||
.rwmb-text { width: 100%; }
|
||||
</style>';
|
||||
}
|
||||
add_action('admin_head', 'alx_admin_panel_css');
|
||||
add_action('admin_head', 'alx_admin_panel_css');
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
* Frontend scripts
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Flexslider gallery post format
|
||||
/* ------------------------------------ */
|
||||
if ( ! function_exists( 'alx_flexslider_gallery' ) ) {
|
||||
|
||||
function alx_flexslider_gallery() {
|
||||
|
||||
if( has_post_format( 'gallery' ) ) {
|
||||
|
||||
$script = '
|
||||
jQuery(document).ready(function(){
|
||||
var firstImage = jQuery("#flexslider-' . get_the_ID() . '").find("img").filter(":first"),
|
||||
checkforloaded = setInterval(function() {
|
||||
var image = firstImage.get(0);
|
||||
if (image.complete || image.readyState == "complete" || image.readyState == 4) {
|
||||
clearInterval(checkforloaded);
|
||||
jQuery("#flexslider-' . get_the_ID() . '").flexslider({
|
||||
animation: "fade",
|
||||
slideshow: false,
|
||||
directionNav: true,
|
||||
controlNav: false,
|
||||
pauseOnHover: true,
|
||||
slideshowSpeed: 7000,
|
||||
animationSpeed: 600,
|
||||
smoothHeight: true,
|
||||
touch: false
|
||||
});
|
||||
}
|
||||
}, 20);
|
||||
});
|
||||
';
|
||||
|
||||
wp_add_inline_script( 'blogline-scripts', $script );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'alx_flexslider_gallery' );
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@
|
|||
<h3>Social Links</h3>
|
||||
<p>Here you create and re-order your Social Links as you wish. These links will appear in the header and footer of your theme in most cases. </p>
|
||||
<p>The icons can be given a specific color if you wish, or you can just leave that option blank and it will use the default setting.</p>
|
||||
<p>The icon names can be found <a target="_blank" href="http://fortawesome.github.io/Font-Awesome/icons/">here</a> - FontAwesome gives you the option to choose between 370 unique icons to use. Example of names to fill in the admin panel would be "fa-facebook", "fa-twitter" and "fa-google-plus".</p>
|
||||
<p>The icon names can be found <a target="_blank" href="https://fontawesome.com/v4.7.0/icons/">here</a> - FontAwesome gives you the option to choose between 370 unique icons to use. Example of names to fill in the admin panel would be "fa-facebook", "fa-twitter" and "fa-google-plus".</p>
|
||||
|
||||
<h3>Styling</h3>
|
||||
<p>The dynamic styles in this theme gives you the ability to change color of large parts of theme in seconds.</p>
|
||||
|
|
|
@ -30,34 +30,34 @@ if ( ! function_exists( 'alx_hex2rgb' ) ) {
|
|||
|
||||
/* Google fonts
|
||||
/* ------------------------------------ */
|
||||
if ( ! function_exists( 'alx_google_fonts' ) ) {
|
||||
if ( ! function_exists( 'alx_enqueue_google_fonts' ) ) {
|
||||
|
||||
function alx_google_fonts () {
|
||||
function alx_enqueue_google_fonts () {
|
||||
if ( get_theme_mod('dynamic-styles', 'on') == 'on' ) {
|
||||
if ( get_theme_mod( 'font' ) == 'titillium-web-ext' ) { echo '<link href="//fonts.googleapis.com/css?family=Titillium+Web:400,400italic,300italic,300,600&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'droid-serif' ) { echo '<link href="//fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'source-sans-pro' ) { echo '<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,300italic,300,400italic,600&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'lato' ) { echo '<link href="//fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,700" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
/*default*/ if ( ( get_theme_mod( 'font' ) == '' ) || ( get_theme_mod( 'font' ) == 'raleway' ) ) { echo '<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'ubuntu' ) { echo '<link href="//fonts.googleapis.com/css?family=Ubuntu:400,400italic,300italic,300,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'ubuntu-cyr' ) { echo '<link href="//fonts.googleapis.com/css?family=Ubuntu:400,400italic,300italic,300,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto' ) { echo '<link href="//fonts.googleapis.com/css?family=Roboto:400,300italic,300,400italic,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-cyr' ) { echo '<link href="//fonts.googleapis.com/css?family=Roboto:400,300italic,300,400italic,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-condensed' ) { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-condensed-cyr' ) { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-slab' ) { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Slab:400,300italic,300,400italic,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-slab-cyr' ) { echo '<link href="//fonts.googleapis.com/css?family=Roboto+Slab:400,300italic,300,400italic,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'playfair-display' ) { echo '<link href="//fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'playfair-display-cyr' ) { echo '<link href="//fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700&subset=latin,cyrillic" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'open-sans' ) { echo '<link href="//fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,600&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'open-sans-cyr' ) { echo '<link href="//fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,600&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'pt-serif' ) { echo '<link href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'pt-serif-cyr' ) { echo '<link href="//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">'. "\n"; }
|
||||
if ( get_theme_mod( 'font' ) == 'titillium-web-ext' ) { wp_enqueue_style( 'titillium-web-ext', '//fonts.googleapis.com/css?family=Titillium+Web:400,400italic,300italic,300,600&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'droid-serif' ) { wp_enqueue_style( 'droid-serif', '//fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'source-sans-pro' ) { wp_enqueue_style( 'source-sans-pro', '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,300italic,300,400italic,600&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'lato' ) { wp_enqueue_style( 'lato', '//fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,700' ); }
|
||||
/*default*/ if ( ( get_theme_mod( 'font' ) == '' ) || ( get_theme_mod( 'font' ) == 'raleway' ) ) { wp_enqueue_style( 'raleway', '//fonts.googleapis.com/css?family=Raleway:400,300,600' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'ubuntu' ) { wp_enqueue_style( 'ubuntu', '//fonts.googleapis.com/css?family=Ubuntu:400,400italic,300italic,300,700&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'ubuntu-cyr' ) { wp_enqueue_style( 'ubuntu-cyr', '//fonts.googleapis.com/css?family=Ubuntu:400,400italic,300italic,300,700&subset=latin,cyrillic-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto' ) { wp_enqueue_style( 'roboto', '//fonts.googleapis.com/css?family=Roboto:400,300italic,300,400italic,700&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-cyr' ) { wp_enqueue_style( 'roboto-cyr', '//fonts.googleapis.com/css?family=Roboto:400,300italic,300,400italic,700&subset=latin,cyrillic-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-condensed' ) { wp_enqueue_style( 'roboto-condensed', '//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-condensed-cyr' ) { wp_enqueue_style( 'roboto-condensed-cyr', '//fonts.googleapis.com/css?family=Roboto+Condensed:400,300italic,300,400italic,700&subset=latin,cyrillic-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-slab' ) { wp_enqueue_style( 'roboto-slab', '//fonts.googleapis.com/css?family=Roboto+Slab:400,300italic,300,400italic,700&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'roboto-slab-cyr' ) { wp_enqueue_style( 'roboto-slab-cyr', '//fonts.googleapis.com/css?family=Roboto+Slab:400,300italic,300,400italic,700&subset=latin,cyrillic-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'playfair-display' ) { wp_enqueue_style( 'playfair-display', '//fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'playfair-display-cyr' ) { wp_enqueue_style( 'playfair-display-cyr', '//fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700&subset=latin,cyrillic' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'open-sans' ) { wp_enqueue_style( 'open-sans', '//fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,600&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'open-sans-cyr' ) { wp_enqueue_style( 'open-sans-cyr', '//fonts.googleapis.com/css?family=Open+Sans:400,400italic,300italic,300,600&subset=latin,cyrillic-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'pt-serif' ) { wp_enqueue_style( 'pt-serif', '//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic&subset=latin,latin-ext' ); }
|
||||
if ( get_theme_mod( 'font' ) == 'pt-serif-cyr' ) { wp_enqueue_style( 'pt-serif-cyr', '//fonts.googleapis.com/css?family=PT+Serif:400,700,400italic&subset=latin,cyrillic-ext' ); }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
add_action( 'wp_head', 'alx_google_fonts', 2 );
|
||||
add_action( 'wp_enqueue_scripts', 'alx_enqueue_google_fonts' );
|
||||
|
||||
|
||||
/* Dynamic css output
|
||||
|
@ -72,8 +72,7 @@ if ( ! function_exists( 'alx_dynamic_css' ) ) {
|
|||
$color_1_rgb = alx_hex2rgb($color_1);
|
||||
|
||||
// start output
|
||||
$styles = '<style type="text/css">'."\n";
|
||||
$styles .= '/* Dynamic CSS: For no styles in head, copy and put the css below in your custom.css or child theme\'s style.css, disable dynamic styles */'."\n";
|
||||
$styles = '';
|
||||
|
||||
// google fonts
|
||||
if ( get_theme_mod( 'font' ) == 'titillium-web-ext' ) { $styles .= 'body { font-family: "Titillium Web", Arial, sans-serif; }'."\n"; }
|
||||
|
@ -96,17 +95,17 @@ if ( ! function_exists( 'alx_dynamic_css' ) ) {
|
|||
// container width
|
||||
if ( get_theme_mod('container-width','1120') != '1120' ) {
|
||||
if ( get_theme_mod( 'boxed' ) ) {
|
||||
$styles .= '.boxed #wrapper, .container-inner { max-width: '.get_theme_mod('container-width').'px; }'."\n";
|
||||
$styles .= '.boxed #wrapper, .container-inner { max-width: '.esc_attr( get_theme_mod('container-width') ).'px; }'."\n";
|
||||
}
|
||||
else {
|
||||
$styles .= '.container-inner { max-width: '.get_theme_mod('container-width').'px; }'."\n";
|
||||
$styles .= '.container-inner { max-width: '.esc_attr( get_theme_mod('container-width') ).'px; }'."\n";
|
||||
}
|
||||
}
|
||||
// primary color
|
||||
if ( get_theme_mod('color-1','#55acee') != '#55acee' ) {
|
||||
$styles .= '
|
||||
::selection { background-color: '.get_theme_mod('color-1').'; }
|
||||
::-moz-selection { background-color: '.get_theme_mod('color-1').'; }
|
||||
::selection { background-color: '.esc_attr( get_theme_mod('color-1') ).'; }
|
||||
::-moz-selection { background-color: '.esc_attr( get_theme_mod('color-1') ).'; }
|
||||
|
||||
a,
|
||||
.themeform label .required,
|
||||
|
@ -134,7 +133,7 @@ a,
|
|||
.comment-awaiting-moderation,
|
||||
.child-menu a:hover,
|
||||
.child-menu .current_page_item > a,
|
||||
.wp-pagenavi a { color: '.get_theme_mod('color-1').'; }
|
||||
.wp-pagenavi a { color: '.esc_attr( get_theme_mod('color-1') ).'; }
|
||||
|
||||
.themeform input[type="submit"],
|
||||
.themeform button[type="submit"],
|
||||
|
@ -145,9 +144,9 @@ a,
|
|||
.author-bio .bio-avatar:after,
|
||||
.post-comments,
|
||||
.commentlist li.bypostauthor > .comment-body:after,
|
||||
.commentlist li.comment-author-admin > .comment-body:after { background-color: '.get_theme_mod('color-1').'; }
|
||||
.commentlist li.comment-author-admin > .comment-body:after { background-color: '.esc_attr( get_theme_mod('color-1') ).'; }
|
||||
|
||||
.alx-tabs-nav li.active a { border-color: '.get_theme_mod('color-1').'; }
|
||||
.alx-tabs-nav li.active a { border-color: '.esc_attr( get_theme_mod('color-1') ).'; }
|
||||
|
||||
#nav-topbar .nav li > a:hover,
|
||||
#nav-topbar .nav li:hover > a,
|
||||
|
@ -158,7 +157,7 @@ a,
|
|||
#nav-topbar .nav > li.current_page_item > a:before,
|
||||
#nav-topbar .nav > li.current-menu-item > a:before,
|
||||
#nav-topbar .nav > li.current-menu-ancestor > a:before,
|
||||
#nav-topbar .nav > li.current-post-parent > a:before { border-top-color: '.get_theme_mod('color-1').'; }
|
||||
#nav-topbar .nav > li.current-post-parent > a:before { border-top-color: '.esc_attr( get_theme_mod('color-1') ).'; }
|
||||
|
||||
#footer-bottom .container-inner,
|
||||
.widget > h3 > span,
|
||||
|
@ -166,23 +165,23 @@ a,
|
|||
.comment-tabs li.active a,
|
||||
.wp-pagenavi a:hover,
|
||||
.wp-pagenavi a:active,
|
||||
.wp-pagenavi span.current { border-bottom-color: '.get_theme_mod('color-1').'!important; }
|
||||
.wp-pagenavi span.current { border-bottom-color: '.esc_attr( get_theme_mod('color-1') ).'!important; }
|
||||
'."\n";
|
||||
}
|
||||
// image border radius
|
||||
if ( get_theme_mod('image-border-radius') != '0' ) {
|
||||
$styles .= 'img { -webkit-border-radius: '.get_theme_mod('image-border-radius').'px; border-radius: '.get_theme_mod('image-border-radius').'px; }'."\n";
|
||||
$styles .= 'img { -webkit-border-radius: '.esc_attr( get_theme_mod('image-border-radius') ).'px; border-radius: '.esc_attr( get_theme_mod('image-border-radius') ).'px; }'."\n";
|
||||
}
|
||||
// body background
|
||||
if ( get_theme_mod('body-background','') != '' ) {
|
||||
|
||||
$body_background = get_theme_mod('body-background');
|
||||
$body_color = $body_background['background-color'];
|
||||
$body_image = $body_background['background-image'];
|
||||
$body_position = $body_background['background-position'];
|
||||
$body_attachment = $body_background['background-attachment'];
|
||||
$body_repeat = $body_background['background-repeat'];
|
||||
$body_size = $body_background['background-size'];
|
||||
$body_color = esc_attr( $body_background['background-color'] );
|
||||
$body_image = esc_url( $body_background['background-image'] );
|
||||
$body_position = esc_attr( $body_background['background-position'] );
|
||||
$body_attachment = esc_attr( $body_background['background-attachment'] );
|
||||
$body_repeat = esc_attr( $body_background['background-repeat'] );
|
||||
$body_size = esc_attr( $body_background['background-size'] );
|
||||
|
||||
if ( $body_image && $body_size == "" ) {
|
||||
$styles .= 'body { background: '.$body_color.' url('.$body_image.') '.$body_attachment.' '.$body_position.' '.$body_repeat.'; }'."\n";
|
||||
|
@ -195,12 +194,9 @@ a,
|
|||
}
|
||||
}
|
||||
|
||||
$styles .= '</style>'."\n";
|
||||
// end output
|
||||
|
||||
echo $styles;
|
||||
wp_add_inline_style( 'blogline-style', $styles );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
add_action( 'wp_head', 'alx_dynamic_css', 100 );
|
||||
add_action( 'wp_enqueue_scripts', 'alx_dynamic_css' );
|
||||
|
|
|
@ -645,7 +645,7 @@ Kirki::add_field( 'alx_theme', array(
|
|||
'label' => esc_attr__( 'Create Social Links', 'blogline' ),
|
||||
'description' => esc_attr__( 'Create and organize your social links', 'blogline' ),
|
||||
'section' => 'social',
|
||||
'tooltip' => esc_attr__( 'Font Awesome names:', 'blogline' ) . ' <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank"><strong>' . esc_attr__( 'View All', 'blogline' ) . ' </strong></a>',
|
||||
'tooltip' => esc_attr__( 'Font Awesome names:', 'blogline' ) . ' <a href="https://fontawesome.com/v4.7.0/icons/" target="_blank"><strong>' . esc_attr__( 'View All', 'blogline' ) . ' </strong></a>',
|
||||
'row_label' => array(
|
||||
'type' => 'text',
|
||||
'value' => esc_attr__('social link', 'blogline' ),
|
||||
|
@ -662,7 +662,7 @@ Kirki::add_field( 'alx_theme', array(
|
|||
'social-icon' => array(
|
||||
'type' => 'text',
|
||||
'label' => esc_attr__( 'Icon Name', 'blogline' ),
|
||||
'description' => esc_attr__( 'Font Awesome icons. Ex: fa-facebook ', 'blogline' ) . ' <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank"><strong>' . esc_attr__( 'View All', 'blogline' ) . ' </strong></a>',
|
||||
'description' => esc_attr__( 'Font Awesome icons. Ex: fa-facebook ', 'blogline' ) . ' <a href="https://fontawesome.com/v4.7.0/icons/" target="_blank"><strong>' . esc_attr__( 'View All', 'blogline' ) . ' </strong></a>',
|
||||
'default' => 'fa-',
|
||||
),
|
||||
'social-link' => array(
|
||||
|
|
|
@ -54,7 +54,7 @@ class AlxPosts extends WP_Widget {
|
|||
|
||||
<?php if($instance['posts_thumb']) { // Thumbnails enabled? ?>
|
||||
<div class="post-item-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-medium'); ?>
|
||||
<?php else: ?>
|
||||
|
@ -69,7 +69,7 @@ class AlxPosts extends WP_Widget {
|
|||
|
||||
<div class="post-item-inner group">
|
||||
<?php if($instance['posts_category']) { ?><p class="post-item-category"><?php the_category(' / '); ?></p><?php } ?>
|
||||
<p class="post-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
|
||||
<p class="post-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
|
||||
<?php if($instance['posts_date']) { ?><p class="post-item-date"><?php the_time('M j, Y'); ?></p><?php } ?>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class AlxTabs extends WP_Widget {
|
|||
|
||||
<?php if($instance['recent_thumbs']) { // Thumbnails enabled? ?>
|
||||
<div class="tab-item-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-small'); ?>
|
||||
<?php else: ?>
|
||||
|
@ -103,7 +103,7 @@ class AlxTabs extends WP_Widget {
|
|||
|
||||
<div class="tab-item-inner group">
|
||||
<?php if($instance['tabs_category']) { ?><p class="tab-item-category"><?php the_category(' / '); ?></p><?php } ?>
|
||||
<p class="tab-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
|
||||
<p class="tab-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
|
||||
<?php if($instance['tabs_date']) { ?><p class="tab-item-date"><?php the_time('M j, Y'); ?></p><?php } ?>
|
||||
</div>
|
||||
|
||||
|
@ -139,7 +139,7 @@ class AlxTabs extends WP_Widget {
|
|||
|
||||
<?php if($instance['popular_thumbs']) { // Thumbnails enabled? ?>
|
||||
<div class="tab-item-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-small'); ?>
|
||||
<?php else: ?>
|
||||
|
@ -154,7 +154,7 @@ class AlxTabs extends WP_Widget {
|
|||
|
||||
<div class="tab-item-inner group">
|
||||
<?php if($instance['tabs_category']) { ?><p class="tab-item-category"><?php the_category(' / '); ?></p><?php } ?>
|
||||
<p class="tab-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></p>
|
||||
<p class="tab-item-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
|
||||
<?php if($instance['tabs_date']) { ?><p class="tab-item-date"><?php the_time('M j, Y'); ?></p><?php } ?>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<article <?php post_class(); ?>>
|
||||
|
||||
<div class="post-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
||||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
|
||||
<?php if ( has_post_thumbnail() ): ?>
|
||||
<?php the_post_thumbnail('thumb-medium'); ?>
|
||||
<?php elseif ( get_theme_mod('placeholder') != 'off' ): ?>
|
||||
|
@ -28,7 +28,7 @@
|
|||
<div class="related-inner">
|
||||
|
||||
<h4 class="post-title">
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
|
||||
</h4><!--/.post-title-->
|
||||
|
||||
<div class="post-meta group">
|
||||
|
|
903
js/jquery.flexslider.js
Normal file
903
js/jquery.flexslider.js
Normal file
|
@ -0,0 +1,903 @@
|
|||
/*
|
||||
* jQuery FlexSlider v2.1
|
||||
* http://www.woothemes.com/flexslider/
|
||||
*
|
||||
* Copyright 2012 WooThemes
|
||||
* Free to use under the GPLv2 license.
|
||||
* http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributing author: Tyler Smith (@mbmufffin)
|
||||
*/
|
||||
|
||||
;(function ($) {
|
||||
|
||||
//FlexSlider: Object Instance
|
||||
$.flexslider = function(el, options) {
|
||||
var slider = $(el),
|
||||
vars = $.extend({}, $.flexslider.defaults, options),
|
||||
namespace = vars.namespace,
|
||||
touch = ("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch,
|
||||
eventType = (touch) ? "touchend" : "click",
|
||||
vertical = vars.direction === "vertical",
|
||||
reverse = vars.reverse,
|
||||
carousel = (vars.itemWidth > 0),
|
||||
fade = vars.animation === "fade",
|
||||
asNav = vars.asNavFor !== "",
|
||||
methods = {};
|
||||
|
||||
// Store a reference to the slider object
|
||||
$.data(el, "flexslider", slider);
|
||||
|
||||
// Privat slider methods
|
||||
methods = {
|
||||
init: function() {
|
||||
slider.animating = false;
|
||||
slider.currentSlide = vars.startAt;
|
||||
slider.animatingTo = slider.currentSlide;
|
||||
slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last);
|
||||
slider.containerSelector = vars.selector.substr(0,vars.selector.search(' '));
|
||||
slider.slides = $(vars.selector, slider);
|
||||
slider.container = $(slider.containerSelector, slider);
|
||||
slider.count = slider.slides.length;
|
||||
// SYNC:
|
||||
slider.syncExists = $(vars.sync).length > 0;
|
||||
// SLIDE:
|
||||
if (vars.animation === "slide") vars.animation = "swing";
|
||||
slider.prop = (vertical) ? "top" : "marginLeft";
|
||||
slider.args = {};
|
||||
// SLIDESHOW:
|
||||
slider.manualPause = false;
|
||||
// TOUCH/USECSS:
|
||||
slider.transitions = !vars.video && !fade && vars.useCSS && (function() {
|
||||
var obj = document.createElement('div'),
|
||||
props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
|
||||
for (var i in props) {
|
||||
if ( obj.style[ props[i] ] !== undefined ) {
|
||||
slider.pfx = props[i].replace('Perspective','').toLowerCase();
|
||||
slider.prop = "-" + slider.pfx + "-transform";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}());
|
||||
// CONTROLSCONTAINER:
|
||||
if (vars.controlsContainer !== "") slider.controlsContainer = $(vars.controlsContainer).length > 0 && $(vars.controlsContainer);
|
||||
// MANUAL:
|
||||
if (vars.manualControls !== "") slider.manualControls = $(vars.manualControls).length > 0 && $(vars.manualControls);
|
||||
|
||||
// RANDOMIZE:
|
||||
if (vars.randomize) {
|
||||
slider.slides.sort(function() { return (Math.round(Math.random())-0.5); });
|
||||
slider.container.empty().append(slider.slides);
|
||||
}
|
||||
|
||||
slider.doMath();
|
||||
|
||||
// ASNAV:
|
||||
if (asNav) methods.asNav.setup();
|
||||
|
||||
// INIT
|
||||
slider.setup("init");
|
||||
|
||||
// CONTROLNAV:
|
||||
if (vars.controlNav) methods.controlNav.setup();
|
||||
|
||||
// DIRECTIONNAV:
|
||||
if (vars.directionNav) methods.directionNav.setup();
|
||||
|
||||
// KEYBOARD:
|
||||
if (vars.keyboard && ($(slider.containerSelector).length === 1 || vars.multipleKeyboard)) {
|
||||
$(document).bind('keyup', function(event) {
|
||||
var keycode = event.keyCode;
|
||||
if (!slider.animating && (keycode === 39 || keycode === 37)) {
|
||||
var target = (keycode === 39) ? slider.getTarget('next') :
|
||||
(keycode === 37) ? slider.getTarget('prev') : false;
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
}
|
||||
// MOUSEWHEEL:
|
||||
if (vars.mousewheel) {
|
||||
slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
|
||||
event.preventDefault();
|
||||
var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
});
|
||||
}
|
||||
|
||||
// PAUSEPLAY
|
||||
if (vars.pausePlay) methods.pausePlay.setup();
|
||||
|
||||
// SLIDSESHOW
|
||||
if (vars.slideshow) {
|
||||
if (vars.pauseOnHover) {
|
||||
slider.hover(function() {
|
||||
if (!slider.manualPlay && !slider.manualPause) slider.pause();
|
||||
}, function() {
|
||||
if (!slider.manualPause && !slider.manualPlay) slider.play();
|
||||
});
|
||||
}
|
||||
// initialize animation
|
||||
(vars.initDelay > 0) ? setTimeout(slider.play, vars.initDelay) : slider.play();
|
||||
}
|
||||
|
||||
// TOUCH
|
||||
if (touch && vars.touch) methods.touch();
|
||||
|
||||
// FADE&&SMOOTHHEIGHT || SLIDE:
|
||||
if (!fade || (fade && vars.smoothHeight)) $(window).bind("resize focus", methods.resize);
|
||||
|
||||
|
||||
// API: start() Callback
|
||||
setTimeout(function(){
|
||||
vars.start(slider);
|
||||
}, 200);
|
||||
},
|
||||
asNav: {
|
||||
setup: function() {
|
||||
slider.asNav = true;
|
||||
slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
|
||||
slider.currentItem = slider.currentSlide;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
|
||||
slider.slides.click(function(e){
|
||||
e.preventDefault();
|
||||
var $slide = $(this),
|
||||
target = $slide.index();
|
||||
if (!$(vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) {
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction, false, true, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
controlNav: {
|
||||
setup: function() {
|
||||
if (!slider.manualControls) {
|
||||
methods.controlNav.setupPaging();
|
||||
} else { // MANUALCONTROLS:
|
||||
methods.controlNav.setupManual();
|
||||
}
|
||||
},
|
||||
setupPaging: function() {
|
||||
var type = (vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
|
||||
j = 1,
|
||||
item;
|
||||
|
||||
slider.controlNavScaffold = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>');
|
||||
|
||||
if (slider.pagingCount > 1) {
|
||||
for (var i = 0; i < slider.pagingCount; i++) {
|
||||
item = (vars.controlNav === "thumbnails") ? '<img src="' + slider.slides.eq(i).attr("data-thumb") + '"/>' : '<a>' + j + '</a>';
|
||||
slider.controlNavScaffold.append('<li>' + item + '</li>');
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
(slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold);
|
||||
methods.controlNav.set();
|
||||
|
||||
methods.controlNav.active();
|
||||
|
||||
slider.controlNavScaffold.delegate('a, img', eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this),
|
||||
target = slider.controlNav.index($this);
|
||||
|
||||
if (!$this.hasClass(namespace + 'active')) {
|
||||
slider.direction = (target > slider.currentSlide) ? "next" : "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.controlNavScaffold.delegate('a', "click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
setupManual: function() {
|
||||
slider.controlNav = slider.manualControls;
|
||||
methods.controlNav.active();
|
||||
|
||||
slider.controlNav.live(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this),
|
||||
target = slider.controlNav.index($this);
|
||||
|
||||
if (!$this.hasClass(namespace + 'active')) {
|
||||
(target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.controlNav.live("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
set: function() {
|
||||
var selector = (vars.controlNav === "thumbnails") ? 'img' : 'a';
|
||||
slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider);
|
||||
},
|
||||
active: function() {
|
||||
slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active");
|
||||
},
|
||||
update: function(action, pos) {
|
||||
if (slider.pagingCount > 1 && action === "add") {
|
||||
slider.controlNavScaffold.append($('<li><a>' + slider.count + '</a></li>'));
|
||||
} else if (slider.pagingCount === 1) {
|
||||
slider.controlNavScaffold.find('li').remove();
|
||||
} else {
|
||||
slider.controlNav.eq(pos).closest('li').remove();
|
||||
}
|
||||
methods.controlNav.set();
|
||||
(slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active();
|
||||
}
|
||||
},
|
||||
directionNav: {
|
||||
setup: function() {
|
||||
var directionNavScaffold = $('<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + vars.nextText + '</a></li></ul>');
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
if (slider.controlsContainer) {
|
||||
$(slider.controlsContainer).append(directionNavScaffold);
|
||||
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer);
|
||||
} else {
|
||||
slider.append(directionNavScaffold);
|
||||
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider);
|
||||
}
|
||||
|
||||
methods.directionNav.update();
|
||||
|
||||
slider.directionNav.bind(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.directionNav.bind("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
update: function() {
|
||||
var disabledClass = namespace + 'disabled';
|
||||
if (slider.pagingCount === 1) {
|
||||
slider.directionNav.addClass(disabledClass);
|
||||
} else if (!vars.animationLoop) {
|
||||
if (slider.animatingTo === 0) {
|
||||
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass);
|
||||
} else if (slider.animatingTo === slider.last) {
|
||||
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass);
|
||||
} else {
|
||||
slider.directionNav.removeClass(disabledClass);
|
||||
}
|
||||
} else {
|
||||
slider.directionNav.removeClass(disabledClass);
|
||||
}
|
||||
}
|
||||
},
|
||||
pausePlay: {
|
||||
setup: function() {
|
||||
var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a></a></div>');
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
if (slider.controlsContainer) {
|
||||
slider.controlsContainer.append(pausePlayScaffold);
|
||||
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer);
|
||||
} else {
|
||||
slider.append(pausePlayScaffold);
|
||||
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider);
|
||||
}
|
||||
|
||||
methods.pausePlay.update((vars.slideshow) ? namespace + 'pause' : namespace + 'play');
|
||||
|
||||
slider.pausePlay.bind(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
if ($(this).hasClass(namespace + 'pause')) {
|
||||
slider.manualPause = true;
|
||||
slider.manualPlay = false;
|
||||
slider.pause();
|
||||
} else {
|
||||
slider.manualPause = false;
|
||||
slider.manualPlay = true;
|
||||
slider.play();
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.pausePlay.bind("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
update: function(state) {
|
||||
(state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').text(vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').text(vars.pauseText);
|
||||
}
|
||||
},
|
||||
touch: function() {
|
||||
var startX,
|
||||
startY,
|
||||
offset,
|
||||
cwidth,
|
||||
dx,
|
||||
startT,
|
||||
scrolling = false;
|
||||
|
||||
el.addEventListener('touchstart', onTouchStart, false);
|
||||
function onTouchStart(e) {
|
||||
if (slider.animating) {
|
||||
e.preventDefault();
|
||||
} else if (e.touches.length === 1) {
|
||||
slider.pause();
|
||||
// CAROUSEL:
|
||||
cwidth = (vertical) ? slider.h : slider. w;
|
||||
startT = Number(new Date());
|
||||
// CAROUSEL:
|
||||
offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
|
||||
(carousel && reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
|
||||
(carousel && slider.currentSlide === slider.last) ? slider.limit :
|
||||
(carousel) ? ((slider.itemW + vars.itemMargin) * slider.move) * slider.currentSlide :
|
||||
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
|
||||
startX = (vertical) ? e.touches[0].pageY : e.touches[0].pageX;
|
||||
startY = (vertical) ? e.touches[0].pageX : e.touches[0].pageY;
|
||||
|
||||
el.addEventListener('touchmove', onTouchMove, false);
|
||||
el.addEventListener('touchend', onTouchEnd, false);
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchMove(e) {
|
||||
dx = (vertical) ? startX - e.touches[0].pageY : startX - e.touches[0].pageX;
|
||||
scrolling = (vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)) : (Math.abs(dx) < Math.abs(e.touches[0].pageY - startY));
|
||||
|
||||
if (!scrolling || Number(new Date()) - startT > 500) {
|
||||
e.preventDefault();
|
||||
if (!fade && slider.transitions) {
|
||||
if (!vars.animationLoop) {
|
||||
dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1);
|
||||
}
|
||||
slider.setProps(offset + dx, "setTouch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchEnd(e) {
|
||||
// finish the touch by undoing the touch session
|
||||
el.removeEventListener('touchmove', onTouchMove, false);
|
||||
|
||||
if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
|
||||
var updateDx = (reverse) ? -dx : dx,
|
||||
target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
|
||||
if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
} else {
|
||||
if (!fade) slider.flexAnimate(slider.currentSlide, vars.pauseOnAction, true);
|
||||
}
|
||||
}
|
||||
el.removeEventListener('touchend', onTouchEnd, false);
|
||||
startX = null;
|
||||
startY = null;
|
||||
dx = null;
|
||||
offset = null;
|
||||
}
|
||||
},
|
||||
resize: function() {
|
||||
if (!slider.animating && slider.is(':visible')) {
|
||||
if (!carousel) slider.doMath();
|
||||
|
||||
if (fade) {
|
||||
// SMOOTH HEIGHT:
|
||||
methods.smoothHeight();
|
||||
} else if (carousel) { //CAROUSEL:
|
||||
slider.slides.width(slider.computedW);
|
||||
slider.update(slider.pagingCount);
|
||||
slider.setProps();
|
||||
}
|
||||
else if (vertical) { //VERTICAL:
|
||||
slider.viewport.height(slider.h);
|
||||
slider.setProps(slider.h, "setTotal");
|
||||
} else {
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
slider.newSlides.width(slider.computedW);
|
||||
slider.setProps(slider.computedW, "setTotal");
|
||||
}
|
||||
}
|
||||
},
|
||||
smoothHeight: function(dur) {
|
||||
if (!vertical || fade) {
|
||||
var $obj = (fade) ? slider : slider.viewport;
|
||||
(dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).height()}, dur) : $obj.height(slider.slides.eq(slider.animatingTo).height());
|
||||
}
|
||||
},
|
||||
sync: function(action) {
|
||||
var $obj = $(vars.sync).data("flexslider"),
|
||||
target = slider.animatingTo;
|
||||
|
||||
switch (action) {
|
||||
case "animate": $obj.flexAnimate(target, vars.pauseOnAction, false, true); break;
|
||||
case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break;
|
||||
case "pause": $obj.pause(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// public methods
|
||||
slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
|
||||
if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
|
||||
if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) {
|
||||
if (asNav && withSync) {
|
||||
var master = $(vars.asNavFor).data('flexslider');
|
||||
slider.atEnd = target === 0 || target === slider.count - 1;
|
||||
master.flexAnimate(target, true, false, true, fromNav);
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
master.direction = slider.direction;
|
||||
|
||||
if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) {
|
||||
slider.currentItem = target;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
||||
target = Math.floor(target/slider.visible);
|
||||
} else {
|
||||
slider.currentItem = target;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
slider.animating = true;
|
||||
slider.animatingTo = target;
|
||||
// API: before() animation Callback
|
||||
vars.before(slider);
|
||||
|
||||
// SLIDESHOW:
|
||||
if (pause) slider.pause();
|
||||
|
||||
// SYNC:
|
||||
if (slider.syncExists && !fromNav) methods.sync("animate");
|
||||
|
||||
// CONTROLNAV
|
||||
if (vars.controlNav) methods.controlNav.active();
|
||||
|
||||
// !CAROUSEL:
|
||||
// CANDIDATE: slide active class (for add/remove slide)
|
||||
if (!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide');
|
||||
|
||||
// INFINITE LOOP:
|
||||
// CANDIDATE: atEnd
|
||||
slider.atEnd = target === 0 || target === slider.last;
|
||||
|
||||
// DIRECTIONNAV:
|
||||
if (vars.directionNav) methods.directionNav.update();
|
||||
|
||||
if (target === slider.last) {
|
||||
// API: end() of cycle Callback
|
||||
vars.end(slider);
|
||||
// SLIDESHOW && !INFINITE LOOP:
|
||||
if (!vars.animationLoop) slider.pause();
|
||||
}
|
||||
|
||||
// SLIDE:
|
||||
if (!fade) {
|
||||
var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW,
|
||||
margin, slideString, calcNext;
|
||||
|
||||
// INFINITE LOOP / REVERSE:
|
||||
if (carousel) {
|
||||
margin = (vars.itemWidth > slider.w) ? vars.itemMargin * 2 : vars.itemMargin;
|
||||
calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo;
|
||||
slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext;
|
||||
} else if (slider.currentSlide === 0 && target === slider.count - 1 && vars.animationLoop && slider.direction !== "next") {
|
||||
slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0;
|
||||
} else if (slider.currentSlide === slider.last && target === 0 && vars.animationLoop && slider.direction !== "prev") {
|
||||
slideString = (reverse) ? 0 : (slider.count + 1) * dimension;
|
||||
} else {
|
||||
slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension;
|
||||
}
|
||||
slider.setProps(slideString, "", vars.animationSpeed);
|
||||
if (slider.transitions) {
|
||||
if (!vars.animationLoop || !slider.atEnd) {
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
}
|
||||
slider.container.unbind("webkitTransitionEnd transitionend");
|
||||
slider.container.bind("webkitTransitionEnd transitionend", function() {
|
||||
slider.wrapup(dimension);
|
||||
});
|
||||
} else {
|
||||
slider.container.animate(slider.args, vars.animationSpeed, vars.easing, function(){
|
||||
slider.wrapup(dimension);
|
||||
});
|
||||
}
|
||||
} else { // FADE:
|
||||
if (!touch) {
|
||||
slider.slides.eq(slider.currentSlide).fadeOut(vars.animationSpeed, vars.easing);
|
||||
slider.slides.eq(target).fadeIn(vars.animationSpeed, vars.easing, slider.wrapup);
|
||||
} else {
|
||||
slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
|
||||
slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
|
||||
|
||||
slider.slides.unbind("webkitTransitionEnd transitionend");
|
||||
slider.slides.eq(slider.currentSlide).bind("webkitTransitionEnd transitionend", function() {
|
||||
// API: after() animation Callback
|
||||
vars.after(slider);
|
||||
});
|
||||
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
}
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight(vars.animationSpeed);
|
||||
}
|
||||
}
|
||||
slider.wrapup = function(dimension) {
|
||||
// SLIDE:
|
||||
if (!fade && !carousel) {
|
||||
if (slider.currentSlide === 0 && slider.animatingTo === slider.last && vars.animationLoop) {
|
||||
slider.setProps(dimension, "jumpEnd");
|
||||
} else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && vars.animationLoop) {
|
||||
slider.setProps(dimension, "jumpStart");
|
||||
}
|
||||
}
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
// API: after() animation Callback
|
||||
vars.after(slider);
|
||||
}
|
||||
|
||||
// SLIDESHOW:
|
||||
slider.animateSlides = function() {
|
||||
if (!slider.animating) slider.flexAnimate(slider.getTarget("next"));
|
||||
}
|
||||
// SLIDESHOW:
|
||||
slider.pause = function() {
|
||||
clearInterval(slider.animatedSlides);
|
||||
slider.playing = false;
|
||||
// PAUSEPLAY:
|
||||
if (vars.pausePlay) methods.pausePlay.update("play");
|
||||
// SYNC:
|
||||
if (slider.syncExists) methods.sync("pause");
|
||||
}
|
||||
// SLIDESHOW:
|
||||
slider.play = function() {
|
||||
slider.animatedSlides = setInterval(slider.animateSlides, vars.slideshowSpeed);
|
||||
slider.playing = true;
|
||||
// PAUSEPLAY:
|
||||
if (vars.pausePlay) methods.pausePlay.update("pause");
|
||||
// SYNC:
|
||||
if (slider.syncExists) methods.sync("play");
|
||||
}
|
||||
slider.canAdvance = function(target, fromNav) {
|
||||
// ASNAV:
|
||||
var last = (asNav) ? slider.pagingCount - 1 : slider.last;
|
||||
return (fromNav) ? true :
|
||||
(asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true :
|
||||
(asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false :
|
||||
(target === slider.currentSlide && !asNav) ? false :
|
||||
(vars.animationLoop) ? true :
|
||||
(slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false :
|
||||
(slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false :
|
||||
true;
|
||||
}
|
||||
slider.getTarget = function(dir) {
|
||||
slider.direction = dir;
|
||||
if (dir === "next") {
|
||||
return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1;
|
||||
} else {
|
||||
return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// SLIDE:
|
||||
slider.setProps = function(pos, special, dur) {
|
||||
var target = (function() {
|
||||
var posCheck = (pos) ? pos : ((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo,
|
||||
posCalc = (function() {
|
||||
if (carousel) {
|
||||
return (special === "setTouch") ? pos :
|
||||
(reverse && slider.animatingTo === slider.last) ? 0 :
|
||||
(reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
|
||||
(slider.animatingTo === slider.last) ? slider.limit : posCheck;
|
||||
} else {
|
||||
switch (special) {
|
||||
case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos;
|
||||
case "setTouch": return (reverse) ? pos : pos;
|
||||
case "jumpEnd": return (reverse) ? pos : slider.count * pos;
|
||||
case "jumpStart": return (reverse) ? slider.count * pos : pos;
|
||||
default: return pos;
|
||||
}
|
||||
}
|
||||
}());
|
||||
return (posCalc * -1) + "px";
|
||||
}());
|
||||
|
||||
if (slider.transitions) {
|
||||
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)";
|
||||
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
|
||||
slider.container.css("-" + slider.pfx + "-transition-duration", dur);
|
||||
}
|
||||
|
||||
slider.args[slider.prop] = target;
|
||||
if (slider.transitions || dur === undefined) slider.container.css(slider.args);
|
||||
}
|
||||
|
||||
slider.setup = function(type) {
|
||||
// SLIDE:
|
||||
if (!fade) {
|
||||
var sliderOffset, arr;
|
||||
|
||||
if (type === "init") {
|
||||
slider.viewport = $('<div class="' + namespace + 'viewport"></div>').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container);
|
||||
// INFINITE LOOP:
|
||||
slider.cloneCount = 0;
|
||||
slider.cloneOffset = 0;
|
||||
// REVERSE:
|
||||
if (reverse) {
|
||||
arr = $.makeArray(slider.slides).reverse();
|
||||
slider.slides = $(arr);
|
||||
slider.container.empty().append(slider.slides);
|
||||
}
|
||||
}
|
||||
// INFINITE LOOP && !CAROUSEL:
|
||||
if (vars.animationLoop && !carousel) {
|
||||
slider.cloneCount = 2;
|
||||
slider.cloneOffset = 1;
|
||||
// clear out old clones
|
||||
if (type !== "init") slider.container.find('.clone').remove();
|
||||
slider.container.append(slider.slides.first().clone().addClass('clone')).prepend(slider.slides.last().clone().addClass('clone'));
|
||||
}
|
||||
slider.newSlides = $(vars.selector, slider);
|
||||
|
||||
sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset;
|
||||
// VERTICAL:
|
||||
if (vertical && !carousel) {
|
||||
slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%");
|
||||
setTimeout(function(){
|
||||
slider.newSlides.css({"display": "block"});
|
||||
slider.doMath();
|
||||
slider.viewport.height(slider.h);
|
||||
slider.setProps(sliderOffset * slider.h, "init");
|
||||
}, (type === "init") ? 100 : 0);
|
||||
} else {
|
||||
slider.container.width((slider.count + slider.cloneCount) * 200 + "%");
|
||||
slider.setProps(sliderOffset * slider.computedW, "init");
|
||||
setTimeout(function(){
|
||||
slider.doMath();
|
||||
slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"});
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
}, (type === "init") ? 100 : 0);
|
||||
}
|
||||
} else { // FADE:
|
||||
slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});
|
||||
if (type === "init") {
|
||||
if (!touch) {
|
||||
slider.slides.eq(slider.currentSlide).fadeIn(vars.animationSpeed, vars.easing);
|
||||
} else {
|
||||
slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2});
|
||||
}
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
}
|
||||
// !CAROUSEL:
|
||||
// CANDIDATE: active slide
|
||||
if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide");
|
||||
}
|
||||
|
||||
slider.doMath = function() {
|
||||
var slide = slider.slides.first(),
|
||||
slideMargin = vars.itemMargin,
|
||||
minItems = vars.minItems,
|
||||
maxItems = vars.maxItems;
|
||||
|
||||
slider.w = slider.width();
|
||||
slider.h = slide.height();
|
||||
slider.boxPadding = slide.outerWidth() - slide.width();
|
||||
|
||||
// CAROUSEL:
|
||||
if (carousel) {
|
||||
slider.itemT = vars.itemWidth + slideMargin;
|
||||
slider.minW = (minItems) ? minItems * slider.itemT : slider.w;
|
||||
slider.maxW = (maxItems) ? maxItems * slider.itemT : slider.w;
|
||||
slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * minItems))/minItems :
|
||||
(slider.maxW < slider.w) ? (slider.w - (slideMargin * maxItems))/maxItems :
|
||||
(vars.itemWidth > slider.w) ? slider.w : vars.itemWidth;
|
||||
slider.visible = Math.floor(slider.w/(slider.itemW + slideMargin));
|
||||
slider.move = (vars.move > 0 && vars.move < slider.visible ) ? vars.move : slider.visible;
|
||||
slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1);
|
||||
slider.last = slider.pagingCount - 1;
|
||||
slider.limit = (slider.pagingCount === 1) ? 0 :
|
||||
(vars.itemWidth > slider.w) ? ((slider.itemW + (slideMargin * 2)) * slider.count) - slider.w - slideMargin : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin;
|
||||
} else {
|
||||
slider.itemW = slider.w;
|
||||
slider.pagingCount = slider.count;
|
||||
slider.last = slider.count - 1;
|
||||
}
|
||||
slider.computedW = slider.itemW - slider.boxPadding;
|
||||
}
|
||||
|
||||
slider.update = function(pos, action) {
|
||||
slider.doMath();
|
||||
|
||||
// update currentSlide and slider.animatingTo if necessary
|
||||
if (!carousel) {
|
||||
if (pos < slider.currentSlide) {
|
||||
slider.currentSlide += 1;
|
||||
} else if (pos <= slider.currentSlide && pos !== 0) {
|
||||
slider.currentSlide -= 1;
|
||||
}
|
||||
slider.animatingTo = slider.currentSlide;
|
||||
}
|
||||
|
||||
// update controlNav
|
||||
if (vars.controlNav && !slider.manualControls) {
|
||||
if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) {
|
||||
methods.controlNav.update("add");
|
||||
} else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) {
|
||||
if (carousel && slider.currentSlide > slider.last) {
|
||||
slider.currentSlide -= 1;
|
||||
slider.animatingTo -= 1;
|
||||
}
|
||||
methods.controlNav.update("remove", slider.last);
|
||||
}
|
||||
}
|
||||
// update directionNav
|
||||
if (vars.directionNav) methods.directionNav.update();
|
||||
|
||||
}
|
||||
|
||||
slider.addSlide = function(obj, pos) {
|
||||
var $obj = $(obj);
|
||||
|
||||
slider.count += 1;
|
||||
slider.last = slider.count - 1;
|
||||
|
||||
// append new slide
|
||||
if (vertical && reverse) {
|
||||
(pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj);
|
||||
} else {
|
||||
(pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj);
|
||||
}
|
||||
|
||||
// update currentSlide, animatingTo, controlNav, and directionNav
|
||||
slider.update(pos, "add");
|
||||
|
||||
// update slider.slides
|
||||
slider.slides = $(vars.selector + ':not(.clone)', slider);
|
||||
// re-setup the slider to accomdate new slide
|
||||
slider.setup();
|
||||
|
||||
//FlexSlider: added() Callback
|
||||
vars.added(slider);
|
||||
}
|
||||
slider.removeSlide = function(obj) {
|
||||
var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj;
|
||||
|
||||
// update count
|
||||
slider.count -= 1;
|
||||
slider.last = slider.count - 1;
|
||||
|
||||
// remove slide
|
||||
if (isNaN(obj)) {
|
||||
$(obj, slider.slides).remove();
|
||||
} else {
|
||||
(vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove();
|
||||
}
|
||||
|
||||
// update currentSlide, animatingTo, controlNav, and directionNav
|
||||
slider.doMath();
|
||||
slider.update(pos, "remove");
|
||||
|
||||
// update slider.slides
|
||||
slider.slides = $(vars.selector + ':not(.clone)', slider);
|
||||
// re-setup the slider to accomdate new slide
|
||||
slider.setup();
|
||||
|
||||
// FlexSlider: removed() Callback
|
||||
vars.removed(slider);
|
||||
}
|
||||
|
||||
//FlexSlider: Initialize
|
||||
methods.init();
|
||||
}
|
||||
|
||||
//FlexSlider: Default Settings
|
||||
$.flexslider.defaults = {
|
||||
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
|
||||
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
|
||||
animation: "fade", //String: Select your animation type, "fade" or "slide"
|
||||
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
|
||||
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
|
||||
reverse: false, //{NEW} Boolean: Reverse the animation direction
|
||||
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
|
||||
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
|
||||
startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
|
||||
slideshow: true, //Boolean: Animate slider automatically
|
||||
slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds
|
||||
animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds
|
||||
initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds
|
||||
randomize: false, //Boolean: Randomize slide order
|
||||
|
||||
// Usability features
|
||||
pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
|
||||
pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
|
||||
useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available
|
||||
touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
|
||||
video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
|
||||
|
||||
// Primary Controls
|
||||
controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
|
||||
directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false)
|
||||
prevText: "Previous", //String: Set the text for the "previous" directionNav item
|
||||
nextText: "Next", //String: Set the text for the "next" directionNav item
|
||||
|
||||
// Secondary Navigation
|
||||
keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys
|
||||
multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
|
||||
mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
|
||||
pausePlay: false, //Boolean: Create pause/play dynamic element
|
||||
pauseText: "Pause", //String: Set the text for the "pause" pausePlay item
|
||||
playText: "Play", //String: Set the text for the "play" pausePlay item
|
||||
|
||||
// Special properties
|
||||
controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found.
|
||||
manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
|
||||
sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
|
||||
asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
|
||||
|
||||
// Carousel Options
|
||||
itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
|
||||
itemMargin: 0, //{NEW} Integer: Margin between carousel items.
|
||||
minItems: 0, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
|
||||
maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
|
||||
move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
|
||||
|
||||
// Callback API
|
||||
start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
|
||||
before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation
|
||||
after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
|
||||
end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
|
||||
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
|
||||
removed: function(){} //{NEW} Callback: function(slider) - Fires after a slide is removed
|
||||
}
|
||||
|
||||
|
||||
//FlexSlider: Plugin Function
|
||||
$.fn.flexslider = function(options) {
|
||||
if (options === undefined) options = {};
|
||||
|
||||
if (typeof options === "object") {
|
||||
return this.each(function() {
|
||||
var $this = $(this),
|
||||
selector = (options.selector) ? options.selector : ".slides > li",
|
||||
$slides = $this.find(selector);
|
||||
|
||||
if ($slides.length === 1) {
|
||||
$slides.fadeIn(400);
|
||||
if (options.start) options.start($this);
|
||||
} else if ($this.data('flexslider') == undefined) {
|
||||
new $.flexslider(this, options);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Helper strings to quickly perform functions on the slider
|
||||
var $slider = $(this).data('flexslider');
|
||||
switch (options) {
|
||||
case "play": $slider.play(); break;
|
||||
case "pause": $slider.pause(); break;
|
||||
case "next": $slider.flexAnimate($slider.getTarget("next"), true); break;
|
||||
case "prev":
|
||||
case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break;
|
||||
default: if (typeof options === "number") $slider.flexAnimate(options, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
3448
js/owl.carousel.js
Normal file
3448
js/owl.carousel.js
Normal file
File diff suppressed because it is too large
Load diff
71
readme.txt
71
readme.txt
|
@ -1,46 +1,55 @@
|
|||
View more themes from this author: http://alxmedia.se/themes/
|
||||
=== Blogline ===
|
||||
Contributors: alxmedia
|
||||
Requires at least: 4.9
|
||||
Tested up to: 4.9
|
||||
Version: 1.0.1
|
||||
License: GPLv2 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: one-column, two-columns, right-sidebar, left-sidebar, custom-colors, custom-menu, featured-images, flexible-header, full-width-template, post-formats, sticky-post, theme-options, threaded-comments, translation-ready
|
||||
|
||||
== Description ==
|
||||
|
||||
/* Theme License
|
||||
/* ------------------------------------ */
|
||||
Blogline is a responsive 100% high resolution theme for personal blogs. Unique toggle sidebars give a great browsing and reading experience on both tablet and mobile. The feature list is long: Unlimited accent colors, unlimited widget areas, 0-1 sidebars to the left or right that can be uniquely specified for each page or post, 300px fixed width sidebar, 0-4 footer widget columns, almost zero layout images, related posts and post nav, 5 post formats, good SEO, 3 flexible custom widgets, localisation support, social links, logo upload and many more useful admin panel features.
|
||||
|
||||
The theme itself is nothing but 100% GPLv3. See headers of files for further details.
|
||||
== Installation ==
|
||||
|
||||
1. In your admin panel, go to Appearance -> Themes and click the 'Add New' button.
|
||||
2. Type in Blogline in the search form and press the 'Enter' key on your keyboard.
|
||||
3. Click on the 'Activate' button to use your new theme right away.
|
||||
4. Navigate to Appearance > Customize in your admin panel and customize to taste.
|
||||
|
||||
/* Font Awesome License
|
||||
/* ------------------------------------ */
|
||||
== Copyright ==
|
||||
|
||||
Font License - http://fontawesome.io
|
||||
License: SIL OFL 1.1
|
||||
License URI: http://scripts.sil.org/OFL
|
||||
Copyright: Dave Gandy, http://fontawesome.io
|
||||
Blogline is distributed under the terms of the GNU GPL
|
||||
|
||||
Code License - http://fontawesome.io
|
||||
License: MIT License
|
||||
License URI: http://opensource.org/licenses/mit-license.html
|
||||
Copyright: Dave Gandy, http://fontawesome.io
|
||||
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.
|
||||
|
||||
Brand Icons
|
||||
All brand icons are trademarks of their respective owners.
|
||||
The use of these trademarks does not indicate endorsement of the trademark holder by Font Awesome, nor vice versa.
|
||||
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.
|
||||
|
||||
Blogline bundles the following third-party resources:
|
||||
|
||||
/* Titillium License
|
||||
/* ------------------------------------ */
|
||||
Font Awesome icons, Copyright Dave Gandy
|
||||
License: SIL Open Font License, version 1.1.
|
||||
Source: http://fontawesome.com/
|
||||
|
||||
Titillium Font - http://www.campivisivi.net/titillium/
|
||||
License: SIL OFL 1.1
|
||||
License URI: http://scripts.sil.org/OFL
|
||||
Copyright: Accademia di Belle Arti di Urbino, http://campivisivi.net
|
||||
Titillium font, Copyright Accademia di Belle Arti di Urbino
|
||||
License: SIL Open Font License, version 1.1.
|
||||
Source: http://www.campivisivi.net/titillium/
|
||||
|
||||
Screenshot images
|
||||
License: CC0 1.0 Universal (CC0 1.0)
|
||||
Source: http://pixabay.com/
|
||||
|
||||
/* Theme screenshot images
|
||||
/* ------------------------------------ */
|
||||
== Changelog ==
|
||||
|
||||
CC0-licensed (GPL-compatible) images from http://pixabay.com/ and http://unsplash.com/
|
||||
= 1.0.1 - 2018-05-26 =
|
||||
* Numerous required fixes for wordpress.org
|
||||
|
||||
|
||||
/* Other Licenses
|
||||
/* ------------------------------------ */
|
||||
|
||||
See headers of files for further details.
|
||||
= 1.0.0 - 2016-02-03 =
|
||||
* Initial release
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/*
|
||||
Theme Name: Blogline
|
||||
Theme URI: http://alxmedia.se/themes/blogline/
|
||||
Version: 1.0.0
|
||||
Version: 1.0.1
|
||||
Description: <a href="http://alxmedia.se/themes/blogline/">Blogline</a> is a responsive 100% high resolution theme for personal blogs. Unique toggle sidebars give a great browsing and reading experience on both tablet and mobile. The feature list is long: Unlimited accent colors, unlimited widget areas, 0-1 sidebars to the left or right that can be uniquely specified for each page or post, 300px fixed width sidebar, 0-4 footer widget columns, almost zero layout images, related posts and post nav, 5 post formats, good SEO, 3 flexible custom widgets, localisation support, social links, logo upload and many more useful admin panel features.
|
||||
Author: Alexander Agnarson
|
||||
Author URI: http://alxmedia.se
|
||||
Tags: one-column, two-columns, right-sidebar, left-sidebar, custom-colors, custom-menu, featured-images, flexible-header, full-width-template, post-formats, sticky-post, theme-options, threaded-comments, translation-ready
|
||||
Text Domain: blogline
|
||||
|
||||
Copyright: (c) 2016 Alexander "Alx" Agnarson
|
||||
Copyright: (c) 2018 Alexander "Alx" Agnarson
|
||||
License: GNU General Public License v3.0
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue