Logo Carousel - Version 1.4.0

Version Description

Download this release

Release Info

Developer ysdbjorn
Plugin Icon 128x128 Logo Carousel
Version 1.4.0
Comparing to
See all releases

Version 1.4.0

custom-styles.css ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .bx-wrapper .bx-viewport {
2
+ -moz-box-shadow:none;
3
+ -webkit-box-shadow:none;
4
+ box-shadow:none;
5
+ border: solid transparent 5px;
6
+ background: transparent;
7
+ height: auto!important;
8
+ }
9
+
10
+ .bx-wrapper .bx-loading {
11
+ background: url(third-party/jquery.bxslider/images/bx_loader.gif) center center no-repeat transparent;
12
+ }
13
+
14
+ .bx-wrapper .bx-controls {
15
+ opacity:0;
16
+ transition:500ms;
17
+ -webkit-transition:500ms;
18
+ -moz-transition:500ms;
19
+ }
20
+
21
+ .bx-wrapper:hover .bx-controls {
22
+ opacity:1;
23
+ }
24
+
25
+ .bx-wrapper ul {
26
+ list-style-type:none;
27
+ padding:0;
28
+ margin:0;
29
+ }
30
+
31
+ .bx-wrapper ul li {
32
+ text-align:center;
33
+ }
34
+ .bx-wrapper ul li img {
35
+ max-height:100%;
36
+ max-width:100%;
37
+ display:inline-block;
38
+ }
39
+
40
+ .bx-wrapper ul.gray li img, .bx-wrapper ul.grayhovercolor li img {
41
+ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+ */
42
+ filter: gray; /* IE6-9 */
43
+ -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */
44
+ /* -webkit-backface-visibility: hidden; /* Fix for transition flickering */
45
+ }
46
+
47
+ .bx-wrapper ul.grayhovercolor li img:hover {
48
+ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale");
49
+ -webkit-filter: grayscale(0%);
50
+ }
51
+
52
+ @media all and (-webkit-min-device-pixel-ratio: 2) {
53
+ .bx-wrapper .bx-prev { background: url(third-party/jquery.bxslider/images/controls@2x.png) no-repeat 0 -32px; background-size:96px,63px; }
54
+ .bx-wrapper .bx-next { background: url(third-party/jquery.bxslider/images/controls@2x.png) no-repeat -43px -32px; background-size:96px,63px; }
55
+ }
56
+
57
+ @media all and (-webkit-min-device-pixel-ratio: 3) {
58
+ .bx-wrapper .bx-prev { background: url(third-party/jquery.bxslider/images/controls@3x.png) no-repeat 0 -32px; background-size:96px,63px; }
59
+ .bx-wrapper .bx-next { background: url(third-party/jquery.bxslider/images/controls@3x.png) no-repeat -43px -32px; background-size:96px,63px; }
60
+ }
images/icon.png ADDED
Binary file
images/icon@2x.png ADDED
Binary file
kiwi_logo_carousel.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Plugin Name: Kiwi Logo Carousel
3
+ Plugin URL: http://www.yourstyledesign.nl/
4
+ Description: Highlight your clients, partners and sponsors on your website in a Logo Carousel
5
+ Author: Kiwi Plugins by Yourstyledesign
6
+ Version: 1.4.0
7
+ Author URI: http://www.yourstyledesign.nl/
8
+ License: GPLv2
9
+ */
10
+
11
+ if ( ! class_exists( 'kiwi_logo_carousel' ) ) :
12
+
13
+ class kiwi_logo_carousel {
14
+
15
+ public $klcadmin = null;
16
+
17
+ // Lets run some basics
18
+ function __construct($class_admin) {
19
+
20
+ $this->klcadmin = $class_admin;
21
+
22
+ // Add support for translations
23
+ load_plugin_textdomain( 'kiwi_logo_carousel', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
24
+
25
+ // Website Header Scripts
26
+ add_action('wp_head', array( &$this, 'load_scripts' ) );
27
+ add_action('wp_head', array( &$this, 'load_javascript_parameters' ) );
28
+
29
+ // Custom Post Type
30
+ add_action( 'init', array( &$this->klcadmin, 'cpt' ) );
31
+
32
+ // Custom Post Type Taxonomy Carousel
33
+ add_action( 'init', array( &$this->klcadmin, 'cpt_taxonomy' ), 0);
34
+
35
+ // Make Featured Image Meta Box Bigger
36
+ add_action( 'do_meta_boxes', array( &$this->klcadmin, 'metabox_logo' ) );
37
+
38
+ // Admin Menu
39
+ add_action( 'admin_menu', array( &$this->klcadmin, 'admin_pages' ) );
40
+
41
+ // Shortcodes
42
+ add_shortcode( 'logo-carousel', 'kiwi_logo_carousel_shortcode' );
43
+
44
+ // Register Settings
45
+ add_action( 'admin_init', array( &$this, 'register_settings' ) );
46
+ //add_option( 'kiwiLGCRSL-library', '1' );
47
+
48
+ }
49
+
50
+ // Register the settings
51
+ function register_settings() {
52
+ //register_setting( 'kiwi_logo_carousel_settings', 'kiwiLGCRSL-library');
53
+ }
54
+
55
+ // Load scripts
56
+ function load_scripts() {
57
+ wp_deregister_script( 'bxslider' );
58
+ wp_register_script( 'bxslider', plugins_url( '/third-party/jquery.bxslider/jquery.bxslider.js', __FILE__), array(), false, false);
59
+ wp_enqueue_script( 'bxslider' );
60
+
61
+ wp_deregister_style( 'bxslider-css' );
62
+ wp_register_style( 'bxslider-css', plugins_url( '/third-party/jquery.bxslider/jquery.bxslider.css', __FILE__) , array() , false, false);
63
+ wp_enqueue_style( 'bxslider-css' );
64
+
65
+ wp_register_style( 'kiwi-logo-carousel-styles', plugins_url( 'custom-styles.css', __FILE__) , array() , false, false);
66
+ wp_enqueue_style( 'kiwi-logo-carousel-styles' );
67
+ }
68
+
69
+ // Register carousels and get the Javascript parameters
70
+ function load_javascript_parameters(){
71
+ echo '<script> jQuery(document).ready(function(){';
72
+ $carousels = $this->klcadmin->return_carousels();
73
+ foreach ($carousels as $key => $value){
74
+ $parameters = $this->klcadmin->find_parameters( $key );
75
+ if ( $parameters == false ) {
76
+ echo 'jQuery(".kiwi-logo-carousel-'.$key.'").bxSlider();';
77
+ }
78
+ else {
79
+ echo 'jQuery(".kiwi-logo-carousel-'.$key.'").bxSlider({';
80
+ unset($parameters['klco_style']);
81
+ unset($parameters['klco_orderby']);
82
+ unset($parameters['klco_clickablelogos']);
83
+ $parameters['useCSS'] = 'false';
84
+ $lastkey = key( array_slice( $parameters, -1, 1, TRUE ) );
85
+ foreach ($parameters as $func => $var){
86
+ echo $func.':';
87
+ if ( $var=="true" || $var=="false" || is_numeric($var) ) { echo $var; } else { echo '"'.$var.'"'; }
88
+ if ($lastkey == $func) { echo ''; }
89
+ else { echo ','; }
90
+ }
91
+ echo '});';
92
+ }
93
+ }
94
+ echo '}); </script>';
95
+ }
96
+
97
+ }
98
+
99
+ endif;
100
+
101
+ require('kiwi_logo_carousel_admin.php');
102
+ require('kiwi_logo_carousel_order.php');
103
+ $KWLGCRSLDMN = new kiwi_logo_carousel_admin();
104
+ $KWLGCRSL = new kiwi_logo_carousel($KWLGCRSLDMN);
105
+ $KWLGSRSLRDR = new kiwi_logo_carousel_order();
106
+
107
+ function kiwi_logo_carousel_shortcode( $atts, $content = null ) {
108
+ extract( shortcode_atts( array(
109
+ 'id' => 'default',
110
+ ), $atts ) );
111
+ $klcadmin = new kiwi_logo_carousel_admin();
112
+ $parameters = $klcadmin->find_parameters( $id );
113
+ if ($id == 'default') { $tax_query = ''; }
114
+ else { $tax_query = array ( array( 'taxonomy' => 'kwlogos-carousel', 'field' => 'slug', 'terms' => $id ) ); }
115
+ $kiwi_cpt_array = get_posts ( array (
116
+ 'posts_per_page' => -1,
117
+ 'post_type' => 'kwlogos',
118
+ 'post_status' => 'publish',
119
+ 'order' => 'ASC',
120
+ 'orderby' => $parameters['klco_orderby'],
121
+ 'tax_query' => $tax_query,
122
+ ) );
123
+ if (empty($kiwi_cpt_array)){ return __('This carousel is empty, please add some logos.','kiwi_logo_carousel'); }
124
+ else {
125
+ $returnstring = '<ul class="kiwi-logo-carousel-'.$id.' '.$parameters['klco_style'].' col4">';
126
+ foreach ( $kiwi_cpt_array as $logo ):
127
+ $image = wp_get_attachment_url( get_post_thumbnail_id($logo->ID) );
128
+ $url = get_post_meta( $logo->ID, '_kwlogos_link', true );
129
+ if ( !isset( $parameters['klco_clickablelogos'] )) { $parameters['klco_clickablelogos'] = 'newtab'; }
130
+ if ( !empty($url) && $parameters['klco_clickablelogos']!="off" ) {
131
+ if ( $parameters['klco_clickablelogos'] == "newtab" ) { $returnstring.= '<li><a target="_blank" href="'.$url.'"><img src="'.$image.'" alt="'.$logo->post_title.'" title="'.$logo->post_title.'"></a></li>'; }
132
+ else if ( $parameters['klco_clickablelogos'] == "samewindow" ) { $returnstring.= '<li><a href="'.$url.'"><img src="'.$image.'" alt="'.$logo->post_title.'" title="'.$logo->post_title.'"></a></li>'; }
133
+ }
134
+ else { $returnstring.= '<li><img src="'.$image.'" alt="'.$logo->post_title.'" title="'.$logo->post_title.'"></li>'; }
135
+ endforeach;
136
+ $returnstring.= '</ul>';
137
+ return $returnstring;
138
+ }
139
+ }
140
+
141
+ if ( ! function_exists('kw_sc_logo_carousel')) {
142
+ function kw_sc_logo_carousel($id = 'default') {
143
+ echo do_shortcode('[logo-carousel '.$id.']');
144
+ }
145
+ }
kiwi_logo_carousel_admin.php ADDED
@@ -0,0 +1,435 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists( 'kiwi_logo_carousel_admin' ) ) :
4
+
5
+ class kiwi_logo_carousel_admin {
6
+
7
+ function __construct() {
8
+
9
+ //Wordpress 3.8 Icon
10
+ add_action( 'init', array( &$this, 'cpt_wordpress_font_icon' ) );
11
+ // Meta Box Link Attachment
12
+ add_action("add_meta_boxes", array( &$this, "metabox_link" ) );
13
+ // Save Custom Data From Meta Boxes
14
+ add_action('save_post', array( &$this, "metabox_savedata" ));
15
+
16
+ }
17
+
18
+ // Returns the default specified when the input is empty
19
+ function rdie($string, $default) {
20
+ if (empty($string)) { return $default; }
21
+ else { return $string; }
22
+ }
23
+
24
+ // Returns the carousel parameters if set
25
+ function find_parameters( $slug = 'default' ) {
26
+ if ( ! get_option('kiwiLGCRSL_'.$slug) ) { return false; }
27
+ else {
28
+ $option = get_option('kiwiLGCRSL_'.$slug);
29
+ if ( empty( $option ) ) { return array(); }
30
+ else { return unserialize(get_option('kiwiLGCRSL_'.$slug)); }
31
+ }
32
+ }
33
+
34
+ // The Custom Post Type
35
+ function cpt(){
36
+ $labels = array (
37
+ 'name' => __('Logos', 'kiwi_logo_carousel' ),
38
+ 'singular_name' => __('Logo', 'kiwi_logo_carousel' ),
39
+ 'add_new' => __( 'Add New Logo', 'kiwi_logo_carousel' ),
40
+ 'add_new_item' => __( 'Add New Logo', 'kiwi_logo_carousel' ),
41
+ 'edit_item' => __( 'Edit Logo', 'kiwi_logo_carousel' ),
42
+ 'new_item' => __( 'New Logo', 'kiwi_logo_carousel' ),
43
+ 'view_item' => __( 'View Logo', 'kiwi_logo_carousel' ),
44
+ 'search_items' => __( 'Search Logos', 'kiwi_logo_carousel' ),
45
+ 'not_found' => __( 'No Logos found', 'kiwi_logo_carousel' ),
46
+ 'not_found_in_trash' => __( 'No Logos found in Trash', 'kiwi_logo_carousel' ),
47
+ 'parent_item_colon' => __( 'Parent Logo:', 'kiwi_logo_carousel' ),
48
+ 'menu_name' => __('Logos', 'kiwi_logo_carousel' ),
49
+ );
50
+ $args = array(
51
+ 'labels' => $labels,
52
+ 'hierarchical' => false,
53
+ 'supports' => array(
54
+ 'title',
55
+ 'thumbnail',
56
+ 'page-attributes'
57
+ ),
58
+ 'public' => false,
59
+ 'show_ui' => true,
60
+ 'show_in_menu' => true,
61
+ 'show_in_nav_menus' => true,
62
+ 'publicly_queryable' => true,
63
+ 'exclude_from_search' => true,
64
+ 'has_archive' => true,
65
+ 'query_var' => true,
66
+ 'can_export' => true,
67
+ 'rewrite' => true,
68
+ 'capability_type' => 'post',
69
+ 'menu_icon' => plugins_url( 'images/icon@2x.png', __FILE__) ,
70
+ );
71
+ register_post_type( 'kwlogos', $args );
72
+ }
73
+
74
+ // If Wordpress 3.8, use font-icon
75
+ function cpt_wordpress_font_icon() {
76
+ $wp_version = floatval( get_bloginfo( 'version' ) );
77
+ if ( $wp_version >= 3.8 ) {
78
+ add_action( 'admin_head', array( &$this, 'cpt_wordpress_font_icon_css' ) );
79
+ }
80
+ else {
81
+ add_action( 'admin_head', array( &$this, 'cpt_wordpress_img_icon_css' ) );
82
+ }
83
+ }
84
+
85
+ // Write font-icon css rules
86
+ function cpt_wordpress_font_icon_css() {
87
+ echo '<style>
88
+ #adminmenu .menu-icon-kwlogos div.wp-menu-image img { display: none; }
89
+ #adminmenu .menu-icon-kwlogos div.wp-menu-image:before { content: "\f180"; }
90
+ </style>';
91
+ }
92
+
93
+ // Write image-icon css rules
94
+ function cpt_wordpress_img_icon_css() {
95
+ echo '<style> #adminmenu .menu-icon-kwlogos div.wp-menu-image img { width:16px; height:16px; } </style>';
96
+ }
97
+
98
+ // The Custom Post Type Taxonomy
99
+ function cpt_taxonomy() {
100
+ register_taxonomy( 'kwlogos-carousel', 'kwlogos', array(
101
+ 'hierarchical' => true,
102
+ 'label' => __('Carousels', 'kiwi_logo_carousel'),
103
+ 'query_var' => true,
104
+ 'rewrite' => true
105
+ ));
106
+ }
107
+
108
+ // Return Carousels in array
109
+ function return_carousels(){
110
+ $carousels = get_object_taxonomies('kwlogos');
111
+ if(count($carousels) > 0) {
112
+ foreach($carousels as $tax) {
113
+ $args = array(
114
+ 'type' => 'kwlogos',
115
+ 'child_of' => 0,
116
+ 'parent' => '',
117
+ 'orderby' => 'name',
118
+ 'order' => 'ASC',
119
+ 'hide_empty' => 0,
120
+ 'hierarchical' => 1,
121
+ 'exclude' => '',
122
+ 'include' => '',
123
+ 'number' => '',
124
+ 'taxonomy' => 'kwlogos-carousel',
125
+ 'pad_counts' => false
126
+ );
127
+ $cats = get_categories( $args );
128
+ }
129
+ }
130
+ $tabs = array( 'default' => __('Default','kiwi-logo-carousel') );
131
+ foreach ($cats as $cat) {
132
+ $tabs[$cat->slug] = $cat->name;
133
+ }
134
+ return $tabs;
135
+ }
136
+
137
+ // Meta Box Logo
138
+ function metabox_logo() {
139
+ remove_meta_box( 'postimagediv', 'kwlogos', 'side' );
140
+ add_meta_box( 'postimagediv', __( 'Logo' ) , 'post_thumbnail_meta_box', 'kwlogos', 'normal', 'high' );
141
+ }
142
+
143
+ // Meta Box Link
144
+ function metabox_link() {
145
+ if ( 'kwlogos' == get_post_type() ){
146
+ add_meta_box("meta_kwlogoslink", __('URL attachment (optional)', 'kiwi_logo_carousel'), array( &$this, "metabox_link_contents" ), "kwlogos", "normal", "low"); //register metabox
147
+ }
148
+ }
149
+
150
+ // Meta Box Link Contents
151
+ function metabox_link_contents() {
152
+ echo '<p>';
153
+ _e('Add an URL to make this logo clickable');
154
+ echo '</p>';
155
+ $value = get_post_meta( get_the_ID(), '_kwlogos_link', true );
156
+ ?> <input style="width:100%;" id="kwlogos_link" class="kwlogos_link" name="kwlogos_link" type="url" value="<?php echo esc_attr($value); ?>" /> <?php
157
+ }
158
+
159
+ // Save the custom metabox data
160
+ function metabox_savedata(){
161
+ if ( 'kwlogos' == $_POST['post_type'] ) {
162
+ if ( ! current_user_can( 'edit_page', $post_id ) ){return;}
163
+ }
164
+ else {return;}
165
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ){ return $post_id; }
166
+ $post_ID = $_POST['post_ID'];
167
+ $kwlogos_link = sanitize_text_field( $_POST['kwlogos_link'] );
168
+ add_post_meta($post_ID, '_kwlogos_link', $kwlogos_link, true) or update_post_meta($post_ID, '_kwlogos_link', $kwlogos_link);
169
+ }
170
+
171
+ // Admin Page
172
+ function admin_pages() {
173
+ add_submenu_page(
174
+ 'edit.php?post_type=kwlogos',
175
+ __('Manage Carousels', 'kiwi_logo_carousel'),
176
+ __('Manage Carousels', 'kiwi_logo_carousel'),
177
+ 'manage_options',
178
+ 'kwlogos_settings',
179
+ array( &$this, 'admin_pages_manage_carousels' )
180
+ );
181
+ }
182
+
183
+ // Admin Page -> Manage Carousels
184
+ function admin_pages_manage_carousels() {
185
+ ?>
186
+ <div class="wrap">
187
+ <?php if ( isset ( $_GET['tab'] ) ) $this->admin_pages_manage_carousels_tabs($_GET['tab']); else $this->admin_pages_manage_carousels_tabs('default'); ?>
188
+ <?php
189
+ if ( isset ( $_GET['tab'] ) ) { $carousel = $_GET['tab']; }
190
+ else { $carousel = 'default'; }
191
+ if ( $this->find_parameters($carousel) == false ){ $this->admin_pages_manage_carousels_register_carousel($carousel); }
192
+ if ( $this->find_parameters($carousel) == false ){ die('Kiwi cannot write or read in the database.'); }
193
+ else {
194
+ if (isset($_POST['submit'])) {
195
+ $parameters = array();
196
+ $parameters['mode'] = $this->rdie($_POST['klc_mode'], 'horizontal');
197
+ $parameters['speed'] = $this->rdie($_POST['klc_speed'], '500');
198
+ $parameters['slideMargin'] = $this->rdie($_POST['klc_slidemargin'], '0');
199
+ $parameters['infiniteLoop'] = $this->rdie($_POST['klc_infiniteloop'], 'true');
200
+ $parameters['hideControlOnEnd'] = $this->rdie($_POST['klc_hidecontrolonend'], 'false');
201
+ $parameters['captions'] = $this->rdie($_POST['klc_captions'], 'false');
202
+ $parameters['ticker'] = $this->rdie($_POST['klc_ticker'], 'false');
203
+ $parameters['tickerHover'] = $this->rdie($_POST['klc_tickerhover'], 'false');
204
+ $parameters['adaptiveHeight'] = $this->rdie($_POST['klc_adaptiveheight'], 'false');
205
+ $parameters['responsive'] = $this->rdie($_POST['klc_responsive'], 'true');
206
+ $parameters['pager'] = $this->rdie($_POST['klc_pager'], 'false');
207
+ $parameters['controls'] = $this->rdie($_POST['klc_controls'], 'true');
208
+ $parameters['autoControls'] = $this->rdie($_POST['klc_autocontrols'], 'false');
209
+ $parameters['minSlides'] = $this->rdie($_POST['klc_minslides'], '1');
210
+ $parameters['maxSlides'] = $this->rdie($_POST['klc_maxslides'], '4');
211
+ $parameters['moveSlides'] = $this->rdie($_POST['klc_moveslides'], '1');
212
+ $parameters['slideWidth'] = $this->rdie($_POST['klc_slidewidth'], '0');
213
+ $parameters['auto'] = $this->rdie($_POST['klc_auto'], 'true');
214
+ $parameters['klco_style'] = $this->rdie($_POST['klco_style'], 'default');
215
+ $parameters['klco_orderby'] = $this->rdie($_POST['klco_orderby'], 'menu_order');
216
+ $parameters['klco_clickablelogos'] = $this->rdie($_POST['klco_clickablelogos'], 'newtab');
217
+ $parameters = serialize($parameters);
218
+ update_option( 'kiwiLGCRSL_'.$carousel, $parameters );
219
+ echo '<div id="setting-error-settings_updated" class="updated settings-error"><p><strong>'.__('Settings saved.').'</strong></p></div>';
220
+ }
221
+ ?>
222
+ <?php $p = $this->find_parameters($carousel);
223
+ if (!isset($p['speed'])) {$p['speed']='500';}
224
+ if (!isset($p['slideMargin'])) {$p['slideMargin']='0';}
225
+ if (!isset($p['minSlides'])) {$p['minSlides']='1';}
226
+ if (!isset($p['maxSlides'])) {$p['maxSlides']='4';}
227
+ if (!isset($p['moveSlides'])) {$p['moveSlides']='1';}
228
+ if (!isset($p['slideWidth'])) {$p['slideWidth']='200';}
229
+ ?>
230
+ <div class="wrap">
231
+ <form method="POST">
232
+ <div id="poststuff" class="metabox-holder has-right-sidebar">
233
+ <div class="inner-sidebar">
234
+ <div id="side-sortables" class="ui-sortable meta-box-sortable">
235
+ <div class="postbox">
236
+ <div title="Click to toggle" class="handlediv"><br></div><h3 class="hndle"><span><?php _e('Carousel','kiwi_logo_carousel'); ?></span></h3>
237
+ <div class="inside">
238
+ <?php submit_button(); ?>
239
+ <p><?php _e('Shortcode','kiwi_logo_carousel'); ?>:<br/> <code>[logo-carousel id=<?php echo $carousel; ?>]</code></p>
240
+ <p><?php _e('PHP Function (No echo required)','kiwi_logo_carousel'); ?>:<br/> <code>kw_sc_logo_carousel(<?php echo $carousel; ?>);</code></p>
241
+ </div>
242
+ </div>
243
+ </div>
244
+ </div>
245
+ <div id="post-body">
246
+ <div id="post-body-content">
247
+ <div id="normal-sortables" class="meta-box-sortables ui-sortable">
248
+ <div class="postbox">
249
+ <div title="Click to toggle" class="handlediv"><br></div><h3 class="hndle"><span><?php _e('General','kiwi_logo_carousel'); ?></span></h3>
250
+ <div class="inside">
251
+ <table class="form-table">
252
+ <tr valign="top">
253
+ <th scope="row"><?php _e('Mode','kiwi_logo_carousel'); ?></th>
254
+ <td><select name="klc_mode">
255
+ <option value="horizontal" <?php if (isset($p['mode']) && $p['mode']=='horizontal'){echo 'selected';} ?>><?php _e('Horizontal','kiwi_logo_carousel'); ?></option>
256
+ <option value="vertical" <?php if (isset($p['mode']) && $p['mode']=='vertical'){echo 'selected';} ?>><?php _e('Vertical','kiwi_logo_carousel'); ?></option>
257
+ </select></td>
258
+ </tr>
259
+ <tr valign="top">
260
+ <th scope="row"><?php _e('Speed (ms)','kiwi_logo_carousel'); ?></th>
261
+ <td><input name="klc_speed" type="number" value="<?=$p['speed'];?>"/></td>
262
+ </tr>
263
+ <tr valign="top">
264
+ <th scope="row"><?php _e('Infinite Loop','kiwi_logo_carousel'); ?></th>
265
+ <td><select name="klc_infiniteloop">
266
+ <option value="true" <?php if (isset($p['infiniteLoop']) && $p['infiniteLoop']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
267
+ <option value="false" <?php if (isset($p['infiniteLoop']) && $p['infiniteLoop']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
268
+ </select></td>
269
+ </tr>
270
+ <tr valign="top">
271
+ <th scope="row"><?php _e('Autoplay','kiwi_logo_carousel'); ?></th>
272
+ <td><select name="klc_auto">
273
+ <option value="true" <?php if (isset($p['auto']) && $p['auto']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
274
+ <option value="false" <?php if (isset($p['auto']) && $p['auto']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
275
+ </select></td>
276
+ </tr>
277
+ <tr valign="top">
278
+ <th scope="row"><?php _e('Use Ticker Mode','kiwi_logo_carousel'); ?></th>
279
+ <td><select name="klc_ticker">
280
+ <option value="false" <?php if (isset($p['ticker']) && $p['ticker']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
281
+ <option value="true" <?php if (isset($p['ticker']) && $p['ticker']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
282
+ </select></td>
283
+ </tr>
284
+ <tr valign="top">
285
+ <th scope="row"><?php _e('Pause Ticker on Hover','kiwi_logo_carousel'); ?></th>
286
+ <td><select name="klc_tickerhover">
287
+ <option value="false" <?php if (isset($p['tickerHover']) && $p['tickerHover']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
288
+ <option value="true" <?php if (isset($p['tickerHover']) && $p['tickerHover']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
289
+ </select></td>
290
+ </tr>
291
+ <tr valign="top">
292
+ <th scope="row"><?php _e('Order by','kiwi_logo_carousel'); ?></th>
293
+ <td><select name="klco_orderby">
294
+ <option value="menu_order" <?php if (isset($p['klco_orderby']) && $p['klco_orderby']=='menuorder'){echo 'selected';} ?>><?php _e('Custom Order','kiwi_logo_carousel'); ?></option>
295
+ <option value="rand" <?php if (isset($p['klco_orderby']) && $p['klco_orderby']=='rand'){echo 'selected';} ?>><?php _e('Random Order','kiwi_logo_carousel'); ?></option>
296
+ <option value="title" <?php if (isset($p['klco_orderby']) && $p['klco_orderby']=='title'){echo 'selected';} ?>><?php _e('Title','kiwi_logo_carousel'); ?></option>
297
+ <option value="date" <?php if (isset($p['klco_orderby']) && $p['klco_orderby']=='date'){echo 'selected';} ?>><?php _e('Date','kiwi_logo_carousel'); ?></option>
298
+ </select></td>
299
+ </tr>
300
+ <tr valign="top">
301
+ <th scope="row"><?php _e('Clickable logos','kiwi_logo_carousel'); ?></th>
302
+ <td><select name="klco_clickablelogos">
303
+ <option value="newtab" <?php if (isset($p['klco_clickablelogos']) && $p['klco_clickablelogos']=='newtab'){echo 'selected';} ?>><?php _e('Open in new tab','kiwi_logo_carousel'); ?></option>
304
+ <option value="samewindow" <?php if (isset($p['klco_clickablelogos']) && $p['klco_clickablelogos']=='samewindow'){echo 'selected';} ?>><?php _e('Open in the same window','kiwi_logo_carousel'); ?></option>
305
+ <option value="off" <?php if (isset($p['klco_clickablelogos']) && $p['klco_clickablelogos']=='off'){echo 'selected';} ?>><?php _e('Turn off','kiwi_logo_carousel'); ?></option>
306
+ </select></td>
307
+ </tr>
308
+ </table>
309
+ </div>
310
+ </div>
311
+ <div class="postbox">
312
+ <div title="Click to toggle" class="handlediv"><br></div><h3 class="hndle"><span><?php _e('Controls','kiwi_logo_carousel'); ?></span></h3>
313
+ <div class="inside">
314
+ <table class="form-table">
315
+ <tr valign="top">
316
+ <th scope="row"><?php _e('Hide next button on last slide','kiwi_logo_carousel'); ?></th>
317
+ <td><select name="klc_hidecontrolonend">
318
+ <option value="false" <?php if (isset($p['hideControlOnEnd']) && $p['hideControlOnEnd']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
319
+ <option value="true" <?php if (isset($p['hideControlOnEnd']) && $p['hideControlOnEnd']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
320
+ </select></td>
321
+ </tr>
322
+ <tr valign="top">
323
+ <th scope="row"><?php _e('Show Controls','kiwi_logo_carousel'); ?></th>
324
+ <td><select name="klc_controls">
325
+ <option value="true" <?php if (isset($p['controls']) && $p['controls']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
326
+ <option value="false" <?php if (isset($p['controls']) && $p['controls']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
327
+ </select></td>
328
+ </tr>
329
+ <tr valign="top">
330
+ <th scope="row"><?php _e('Show Pager','kiwi_logo_carousel'); ?></th>
331
+ <td><select name="klc_pager">
332
+ <option value="false" <?php if (isset($p['pager']) && $p['pager']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
333
+ <option value="true" <?php if (isset($p['pager']) && $p['pager']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
334
+ </select></td>
335
+ </tr>
336
+ <tr valign="top">
337
+ <th scope="row"><?php _e('Show Start and Stop Controls','kiwi_logo_carousel'); ?></th>
338
+ <td><select name="klc_autocontrols">
339
+ <option value="false" <?php if (isset($p['autoControls']) && $p['autoControls']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
340
+ <option value="true" <?php if (isset($p['autoControls']) && $p['autoControls']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
341
+ </select></td>
342
+ </tr>
343
+ </table>
344
+ </div>
345
+ </div>
346
+ <div class="postbox">
347
+ <div title="Click to toggle" class="handlediv"><br></div><h3 class="hndle"><span><?php _e('Styling','kiwi_logo_carousel'); ?></span></h3>
348
+ <div class="inside">
349
+ <table class="form-table">
350
+ <tr valign="top">
351
+ <th scope="row"><?php _e('Logo Margin','kiwi_logo_carousel'); ?></th>
352
+ <td><input name="klc_slidemargin" type="number" value="<?=$p['slideMargin']?>"/></td>
353
+ </tr>
354
+ <tr valign="top">
355
+ <th scope="row"><?php _e('Logo Style','kiwi_logo_carousel'); ?></th>
356
+ <td><select name="klco_style">
357
+ <option value="default" <?php if (isset($p['klco_style']) && $p['klco_style']=='default'){echo 'selected';} ?>><?php _e('Default','kiwi_logo_carousel'); ?></option>
358
+ <option value="gray" <?php if (isset($p['klco_style']) && $p['klco_style']=='gray'){echo 'selected';} ?>><?php _e('Grayscale Images','kiwi_logo_carousel'); ?></option>
359
+ <option value="grayhovercolor" <?php if (isset($p['klco_style']) && $p['klco_style']=='grayhovercolor'){echo 'selected';} ?>><?php _e('Grayscale Images, Default Color on Hover','kiwi_logo_carousel'); ?></option>
360
+ </select></td>
361
+ </tr>
362
+ <tr valign="top">
363
+ <th scope="row"><?php _e('Show captions','kiwi_logo_carousel'); ?></th>
364
+ <td><select name="klc_captions">
365
+ <option value="false" <?php if (isset($p['captions']) && $p['captions']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
366
+ <option value="true" <?php if (isset($p['captions']) && $p['captions']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
367
+ </select></td>
368
+ </tr>
369
+ <tr valign="top">
370
+ <th scope="row"><?php _e('Adaptive Height','kiwi_logo_carousel'); ?></th>
371
+ <td><select name="klc_adaptiveheight">
372
+ <option value="false" <?php if (isset($p['adaptiveHeight']) && $p['adaptiveHeight']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
373
+ <option value="true" <?php if (isset($p['adaptiveHeight']) && $p['adaptiveHeight']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
374
+ </select></td>
375
+ </tr>
376
+ <tr valign="top">
377
+ <th scope="row"><?php _e('Responsive','kiwi_logo_carousel'); ?></th>
378
+ <td><select name="klc_responsive">
379
+ <option value="true" <?php if (isset($p['responsive']) && $p['responsive']=='true'){echo 'selected';} ?>><?php _e('True','kiwi_logo_carousel'); ?></option>
380
+ <option value="false" <?php if (isset($p['responsive']) && $p['responsive']=='false'){echo 'selected';} ?>><?php _e('False','kiwi_logo_carousel'); ?></option>
381
+ </select></td>
382
+ </tr>
383
+ <tr valign="top">
384
+ <th scope="row"><?php _e('Minimal slides','kiwi_logo_carousel'); ?></th>
385
+ <td><input name="klc_minslides" type="number" value="<?=$p['minSlides']?>"/></td>
386
+ </tr>
387
+ <tr valign="top">
388
+ <th scope="row"><?php _e('Maximum slides','kiwi_logo_carousel'); ?></th>
389
+ <td><input name="klc_maxslides" type="number" value="<?=$p['maxSlides']?>"/></td>
390
+ </tr>
391
+ <tr valign="top">
392
+ <th scope="row"><?php _e('Move slides','kiwi_logo_carousel'); ?></th>
393
+ <td><input name="klc_moveslides" type="number" value="<?=$p['moveSlides']?>"/></td>
394
+ </tr>
395
+ <tr valign="top">
396
+ <th scope="row"><?php _e('Slide Width','kiwi_logo_carousel'); ?></th>
397
+ <td><input name="klc_slidewidth" type="number" value="<?=$p['slideWidth']?>"/></td>
398
+ </tr>
399
+ </table>
400
+ </div>
401
+ </div>
402
+ </div>
403
+ </div>
404
+ </div>
405
+ </div>
406
+ </form>
407
+ </div>
408
+ <?php
409
+ }
410
+ ?>
411
+ </div>
412
+ <?php
413
+ }
414
+
415
+ // Admin Pages -> Manage Carousels -> Register Carousel Setting
416
+ function admin_pages_manage_carousels_register_carousel($key) {
417
+ register_setting( 'kiwi_logo_carousel_settings', 'kiwiLGCRSL_'.$key);
418
+ $empty = serialize(array('new'=>'empty'));
419
+ add_option( 'kiwiLGCRSL_'.$key, $empty );
420
+ }
421
+
422
+ // Admin Pages -> Manage Carousels -> Handle Tabs
423
+ function admin_pages_manage_carousels_tabs($current = 'default') {
424
+ $tabs = $this->return_carousels();
425
+ echo '<h2 class="nav-tab-wrapper">';
426
+ foreach( $tabs as $tab => $name ) {
427
+ $class = ( $tab == $current ) ? ' nav-tab-active' : '';
428
+ echo "<a class='nav-tab$class' href='edit.php?post_type=kwlogos&page=kwlogos_settings&tab=$tab'>$name</a>";
429
+ }
430
+ echo '</h2>';
431
+ }
432
+
433
+ }
434
+
435
+ endif;
kiwi_logo_carousel_order.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'kiwi_logo_carousel_order' ) ) :
3
+
4
+ class kiwi_logo_carousel_order {
5
+
6
+ public function __construct() {
7
+ add_action( 'load-edit.php', array( $this, 'load_edit_screen' ) );
8
+ add_action( 'wp_ajax_simple_page_ordering', array( $this, 'ajax_simple_page_ordering' ) );
9
+ }
10
+
11
+ public function load_edit_screen() {
12
+ $screen = get_current_screen();
13
+ $post_type = $screen->post_type;
14
+
15
+ // Check post type
16
+ if ( $post_type != 'kwlogos' )
17
+ return;
18
+
19
+ // Does user have the right to manage these post objects?
20
+ if ( ! $this->check_edit_others_caps( $post_type ) )
21
+ return;
22
+
23
+ add_filter( 'views_' . $screen->id, array( $this, 'sort_by_order_link' ) ); // Add view by menu order to views
24
+ add_action( 'admin_enqueue_scripts', array( $this, 'wp' ) );
25
+ }
26
+
27
+ public function wp() {
28
+ if ( 0 === strpos( get_query_var('orderby'), 'menu_order' ) ) { // We can only sort if we're organized by menu order
29
+ wp_enqueue_script( 'simple-page-ordering', plugins_url( '/third-party/simple-page-ordering/simple-page-ordering.js', __FILE__ ), array('jquery-ui-sortable'), '2.1', true );
30
+ wp_enqueue_style( 'simple-page-ordering', plugins_url( '/third-party/simple-page-ordering/simple-page-ordering.css', __FILE__ ) );
31
+ }
32
+ }
33
+
34
+ public function ajax_simple_page_ordering() {
35
+ // check and make sure we have what we need
36
+ if ( empty( $_POST['id'] ) || ( !isset( $_POST['previd'] ) && !isset( $_POST['nextid'] ) ) )
37
+ die(-1);
38
+
39
+ // real post?
40
+ if ( ! $post = get_post( $_POST['id'] ) )
41
+ die(-1);
42
+
43
+ // does user have the right to manage these post objects?
44
+ if ( ! $this->check_edit_others_caps( $post->post_type ) )
45
+ die(-1);
46
+
47
+ // badly written plug-in hooks for save post can break things
48
+ if ( !defined( 'WP_DEBUG' ) || !WP_DEBUG )
49
+ error_reporting( 0 );
50
+
51
+ $previd = empty( $_POST['previd'] ) ? false : (int) $_POST['previd'];
52
+ $nextid = empty( $_POST['nextid'] ) ? false : (int) $_POST['nextid'];
53
+ $start = empty( $_POST['start'] ) ? 1 : (int) $_POST['start'];
54
+ $excluded = empty( $_POST['excluded'] ) ? array( $post->ID ) : array_filter( (array) $_POST['excluded'], 'intval' );
55
+
56
+ $new_pos = array(); // store new positions for ajax
57
+ $return_data = new stdClass;
58
+
59
+ do_action( 'simple_page_ordering_pre_order_posts', $post, $start );
60
+
61
+ // attempt to get the intended parent... if either sibling has a matching parent ID, use that
62
+ $parent_id = $post->post_parent;
63
+ $next_post_parent = $nextid ? wp_get_post_parent_id( $nextid ) : false;
64
+ if ( $previd == $next_post_parent ) { // if the preceding post is the parent of the next post, move it inside
65
+ $parent_id = $next_post_parent;
66
+ } elseif ( $next_post_parent !== $parent_id ) { // otherwise, if the next post's parent isn't the same as our parent, we need to study
67
+ $prev_post_parent = $previd ? wp_get_post_parent_id( $previd ) : false;
68
+ if ( $prev_post_parent !== $parent_id ) { // if the previous post is not our parent now, make it so!
69
+ $parent_id = ( $prev_post_parent !== false ) ? $prev_post_parent : $next_post_parent;
70
+ }
71
+ }
72
+ // if the next post's parent isn't our parent, it might as well be false (irrelevant to our query)
73
+ if ( $next_post_parent !== $parent_id )
74
+ $nextid = false;
75
+
76
+ $max_sortable_posts = (int) apply_filters( 'simple_page_ordering_limit', 50 ); // should reliably be able to do about 50 at a time
77
+ if ( $max_sortable_posts < 5 ) // don't be ridiculous!
78
+ $max_sortable_posts = 50;
79
+
80
+ // we need to handle all post stati, except trash (in case of custom stati)
81
+ $post_stati = get_post_stati(array(
82
+ 'show_in_admin_all_list' => true,
83
+ ));
84
+
85
+ $siblings = new WP_Query(array(
86
+ 'depth' => 1,
87
+ 'posts_per_page' => $max_sortable_posts,
88
+ 'post_type' => $post->post_type,
89
+ 'post_status' => $post_stati,
90
+ 'post_parent' => $parent_id,
91
+ 'orderby' => 'menu_order title',
92
+ 'order' => 'ASC',
93
+ 'post__not_in' => $excluded,
94
+ 'update_post_term_cache' => false,
95
+ 'update_post_meta_cache' => false,
96
+ 'suppress_filters' => true,
97
+ 'ignore_sticky_posts' => true,
98
+ )); // fetch all the siblings (relative ordering)
99
+
100
+ // don't waste overhead of revisions on a menu order change (especially since they can't *all* be rolled back at once)
101
+ remove_action( 'pre_post_update', 'wp_save_post_revision' );
102
+
103
+ foreach( $siblings->posts as $sibling ) :
104
+
105
+ // don't handle the actual post
106
+ if ( $sibling->ID === $post->ID )
107
+ continue;
108
+
109
+ // if this is the post that comes after our repositioned post, set our repositioned post position and increment menu order
110
+ if ( $nextid === $sibling->ID ) {
111
+ wp_update_post(array(
112
+ 'ID' => $post->ID,
113
+ 'menu_order' => $start,
114
+ 'post_parent' => $parent_id,
115
+ ));
116
+ $ancestors = get_post_ancestors( $post->ID );
117
+ $new_pos[$post->ID] = array(
118
+ 'menu_order' => $start,
119
+ 'post_parent' => $parent_id,
120
+ 'depth' => count( $ancestors ),
121
+ );
122
+ $start++;
123
+ }
124
+
125
+ // if repositioned post has been set, and new items are already in the right order, we can stop
126
+ if ( isset( $new_pos[$post->ID] ) && $sibling->menu_order >= $start ) {
127
+ $return_data->next = false;
128
+ break;
129
+ }
130
+
131
+ // set the menu order of the current sibling and increment the menu order
132
+ if ( $sibling->menu_order != $start ) {
133
+ wp_update_post(array(
134
+ 'ID' => $sibling->ID,
135
+ 'menu_order' => $start,
136
+ ));
137
+ }
138
+ $new_pos[$sibling->ID] = $start;
139
+ $start++;
140
+
141
+ if ( !$nextid && $previd == $sibling->ID ) {
142
+ wp_update_post(array(
143
+ 'ID' => $post->ID,
144
+ 'menu_order' => $start,
145
+ 'post_parent' => $parent_id
146
+ ));
147
+ $ancestors = get_post_ancestors( $post->ID );
148
+ $new_pos[$post->ID] = array(
149
+ 'menu_order' => $start,
150
+ 'post_parent' => $parent_id,
151
+ 'depth' => count($ancestors) );
152
+ $start++;
153
+ }
154
+
155
+ endforeach;
156
+
157
+ // max per request
158
+ if ( !isset( $return_data->next ) && $siblings->max_num_pages > 1 ) {
159
+ $return_data->next = array(
160
+ 'id' => $post->ID,
161
+ 'previd' => $previd,
162
+ 'nextid' => $nextid,
163
+ 'start' => $start,
164
+ 'excluded' => array_merge( array_keys( $new_pos ), $excluded ),
165
+ );
166
+ } else {
167
+ $return_data->next = false;
168
+ }
169
+
170
+ do_action( 'simple_page_ordering_ordered_posts', $post, $new_pos );
171
+
172
+ if ( ! $return_data->next ) {
173
+ // if the moved post has children, we need to refresh the page (unless we're continuing)
174
+ $children = get_posts(array(
175
+ 'numberposts' => 1,
176
+ 'post_type' => $post->post_type,
177
+ 'post_status' => $post_stati,
178
+ 'post_parent' => $post->ID,
179
+ 'fields' => 'ids',
180
+ 'update_post_term_cache' => false,
181
+ 'update_post_meta_cache' => false,
182
+ ));
183
+
184
+ if ( ! empty( $children ) )
185
+ die( 'children' );
186
+ }
187
+
188
+ $return_data->new_pos = $new_pos;
189
+
190
+ die( json_encode( $return_data ) );
191
+ }
192
+
193
+ public function sort_by_order_link( $views ) {
194
+ $class = ( get_query_var('orderby') == 'menu_order title' ) ? 'current' : '';
195
+ $query_string = remove_query_arg(array( 'orderby', 'order' ));
196
+ $query_string = add_query_arg( 'orderby', urlencode('menu_order title'), $query_string );
197
+ $views['byorder'] = '<a href="'. $query_string . '" class="' . $class . '">'.__('Custom Order','kiwi_logo_carousel').'</a>';
198
+ return $views;
199
+ }
200
+
201
+ /**
202
+ * Checks to see if the current user has the capability to "edit others" for a post type
203
+ *
204
+ * @param (string) $post_type Post type name
205
+ * @return (bool) True or false
206
+ */
207
+ public function check_edit_others_caps( $post_type ) {
208
+ $post_type_object = get_post_type_object( $post_type );
209
+ $edit_others_cap = empty( $post_type_object ) ? 'edit_others_' . $post_type . 's' : $post_type_object->cap->edit_others_posts;
210
+ return apply_filters( 'simple_page_ordering_edit_rights', current_user_can( $edit_others_cap ), $post_type );
211
+ }
212
+
213
+ }
214
+
215
+ endif;
languages/kiwi_logo_carousel-nl_NL.mo ADDED
Binary file
languages/kiwi_logo_carousel-nl_NL.po ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Kiwi Logo Carousel\n"
4
+ "POT-Creation-Date: 2014-01-10 11:46+0100\n"
5
+ "PO-Revision-Date: 2014-01-10 11:47+0100\n"
6
+ "Last-Translator: Bjorn Manintveld <bjorn@yourstyledesign.nl>\n"
7
+ "Language-Team: Bjorn Manintveld <bjorn@yourstyledesign.nl>\n"
8
+ "Language: nl\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.3\n"
13
+ "X-Poedit-KeywordsList: _;_e;_x;__\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+ "X-Poedit-SearchPath-1: ..\n"
18
+
19
+ #: ../kiwi_logo_carousel.php:123
20
+ msgid "This carousel is empty, please add some logos."
21
+ msgstr "Deze carrousel is leeg, voeg eerst logo's toe."
22
+
23
+ #: ../kiwi_logo_carousel_admin.php:37 ../kiwi_logo_carousel_admin.php:48
24
+ msgid "Logos"
25
+ msgstr "Logo's"
26
+
27
+ #: ../kiwi_logo_carousel_admin.php:38 ../kiwi_logo_carousel_admin.php:140
28
+ msgid "Logo"
29
+ msgstr "Logo"
30
+
31
+ #: ../kiwi_logo_carousel_admin.php:39 ../kiwi_logo_carousel_admin.php:40
32
+ msgid "Add New Logo"
33
+ msgstr "Nieuw Logo"
34
+
35
+ #: ../kiwi_logo_carousel_admin.php:41
36
+ msgid "Edit Logo"
37
+ msgstr "Logo Bewerken"
38
+
39
+ #: ../kiwi_logo_carousel_admin.php:42
40
+ msgid "New Logo"
41
+ msgstr "Nieuw Logo"
42
+
43
+ #: ../kiwi_logo_carousel_admin.php:43
44
+ msgid "View Logo"
45
+ msgstr "Bekijk Logo"
46
+
47
+ #: ../kiwi_logo_carousel_admin.php:44
48
+ msgid "Search Logos"
49
+ msgstr "Zoeken in Logo's"
50
+
51
+ #: ../kiwi_logo_carousel_admin.php:45
52
+ msgid "No Logos found"
53
+ msgstr "Geen logo's gevonden"
54
+
55
+ #: ../kiwi_logo_carousel_admin.php:46
56
+ msgid "No Logos found in Trash"
57
+ msgstr "Geen logo's gevonden in de prullenbak"
58
+
59
+ #: ../kiwi_logo_carousel_admin.php:47
60
+ msgid "Parent Logo:"
61
+ msgstr "Hoofd Logo:"
62
+
63
+ #: ../kiwi_logo_carousel_admin.php:102
64
+ msgid "Carousels"
65
+ msgstr "Carrousels"
66
+
67
+ #: ../kiwi_logo_carousel_admin.php:130 ../kiwi_logo_carousel_admin.php:357
68
+ msgid "Default"
69
+ msgstr "Standaard"
70
+
71
+ #: ../kiwi_logo_carousel_admin.php:146
72
+ msgid "URL attachment (optional)"
73
+ msgstr "Voeg een URL toe (optioneel)"
74
+
75
+ #: ../kiwi_logo_carousel_admin.php:153
76
+ msgid "Add an URL to make this logo clickable"
77
+ msgstr "Voeg een URL toe om dit logo klikbaar te maken"
78
+
79
+ #: ../kiwi_logo_carousel_admin.php:175 ../kiwi_logo_carousel_admin.php:176
80
+ msgid "Manage Carousels"
81
+ msgstr "Beheer Carrousels"
82
+
83
+ #: ../kiwi_logo_carousel_admin.php:219
84
+ msgid "Settings saved."
85
+ msgstr "Instellingen opgeslagen."
86
+
87
+ #: ../kiwi_logo_carousel_admin.php:236
88
+ msgid "Carousel"
89
+ msgstr "Carrousel"
90
+
91
+ #: ../kiwi_logo_carousel_admin.php:239
92
+ msgid "Shortcode"
93
+ msgstr "Shortcode"
94
+
95
+ #: ../kiwi_logo_carousel_admin.php:240
96
+ msgid "PHP Function (No echo required)"
97
+ msgstr "PHP Functie (Geen echo vereist)"
98
+
99
+ #: ../kiwi_logo_carousel_admin.php:249
100
+ msgid "General"
101
+ msgstr "Algemeen"
102
+
103
+ #: ../kiwi_logo_carousel_admin.php:253
104
+ msgid "Mode"
105
+ msgstr "Modus"
106
+
107
+ #: ../kiwi_logo_carousel_admin.php:255
108
+ msgid "Horizontal"
109
+ msgstr "Horizontaal"
110
+
111
+ #: ../kiwi_logo_carousel_admin.php:256
112
+ msgid "Vertical"
113
+ msgstr "Verticaal"
114
+
115
+ #: ../kiwi_logo_carousel_admin.php:260
116
+ msgid "Speed (ms)"
117
+ msgstr "Snelheid (milliseconden)"
118
+
119
+ #: ../kiwi_logo_carousel_admin.php:264
120
+ msgid "Infinite Loop"
121
+ msgstr "Oneindig"
122
+
123
+ #: ../kiwi_logo_carousel_admin.php:266 ../kiwi_logo_carousel_admin.php:273
124
+ #: ../kiwi_logo_carousel_admin.php:281 ../kiwi_logo_carousel_admin.php:288
125
+ #: ../kiwi_logo_carousel_admin.php:319 ../kiwi_logo_carousel_admin.php:325
126
+ #: ../kiwi_logo_carousel_admin.php:333 ../kiwi_logo_carousel_admin.php:340
127
+ #: ../kiwi_logo_carousel_admin.php:366 ../kiwi_logo_carousel_admin.php:373
128
+ #: ../kiwi_logo_carousel_admin.php:379
129
+ msgid "True"
130
+ msgstr "Ja"
131
+
132
+ #: ../kiwi_logo_carousel_admin.php:267 ../kiwi_logo_carousel_admin.php:274
133
+ #: ../kiwi_logo_carousel_admin.php:280 ../kiwi_logo_carousel_admin.php:287
134
+ #: ../kiwi_logo_carousel_admin.php:318 ../kiwi_logo_carousel_admin.php:326
135
+ #: ../kiwi_logo_carousel_admin.php:332 ../kiwi_logo_carousel_admin.php:339
136
+ #: ../kiwi_logo_carousel_admin.php:365 ../kiwi_logo_carousel_admin.php:372
137
+ #: ../kiwi_logo_carousel_admin.php:380
138
+ msgid "False"
139
+ msgstr "Nee"
140
+
141
+ #: ../kiwi_logo_carousel_admin.php:271
142
+ msgid "Autoplay"
143
+ msgstr "Automatisch afspelen"
144
+
145
+ #: ../kiwi_logo_carousel_admin.php:278
146
+ msgid "Use Ticker Mode"
147
+ msgstr "Gebruik de Ticker Modus"
148
+
149
+ #: ../kiwi_logo_carousel_admin.php:285
150
+ msgid "Pause Ticker on Hover"
151
+ msgstr "Pauzeer Ticker als de muis erop staat"
152
+
153
+ #: ../kiwi_logo_carousel_admin.php:292
154
+ msgid "Order by"
155
+ msgstr "Volgorde"
156
+
157
+ #: ../kiwi_logo_carousel_admin.php:294 ../kiwi_logo_carousel_order.php:197
158
+ msgid "Custom Order"
159
+ msgstr "Aangepaste Volgorde"
160
+
161
+ #: ../kiwi_logo_carousel_admin.php:295
162
+ msgid "Random Order"
163
+ msgstr "Willekeurig"
164
+
165
+ #: ../kiwi_logo_carousel_admin.php:296
166
+ msgid "Title"
167
+ msgstr "Titel"
168
+
169
+ #: ../kiwi_logo_carousel_admin.php:297
170
+ msgid "Date"
171
+ msgstr "Datum"
172
+
173
+ #: ../kiwi_logo_carousel_admin.php:301
174
+ msgid "Clickable logos"
175
+ msgstr "Klikbare logos"
176
+
177
+ #: ../kiwi_logo_carousel_admin.php:303
178
+ msgid "Open in new tab"
179
+ msgstr "Openen in een nieuw tabblad"
180
+
181
+ #: ../kiwi_logo_carousel_admin.php:304
182
+ msgid "Open in the same window"
183
+ msgstr "Openen in hetzelfde scherm"
184
+
185
+ #: ../kiwi_logo_carousel_admin.php:305
186
+ msgid "Turn off"
187
+ msgstr "Uitschakelen"
188
+
189
+ #: ../kiwi_logo_carousel_admin.php:312
190
+ msgid "Controls"
191
+ msgstr "Knoppen"
192
+
193
+ #: ../kiwi_logo_carousel_admin.php:316
194
+ msgid "Hide next button on last slide"
195
+ msgstr "Verberg de \"Volgende\" knop op de laatste dia"
196
+
197
+ #: ../kiwi_logo_carousel_admin.php:323
198
+ msgid "Show Controls"
199
+ msgstr "Laat \"Vorige\" en \"Volgende\" knoppen zien"
200
+
201
+ #: ../kiwi_logo_carousel_admin.php:330
202
+ msgid "Show Pager"
203
+ msgstr "Laat pagina's zien"
204
+
205
+ #: ../kiwi_logo_carousel_admin.php:337
206
+ msgid "Show Start and Stop Controls"
207
+ msgstr "Laat \"Start\" en \"Stop\" knoppen zien"
208
+
209
+ #: ../kiwi_logo_carousel_admin.php:347
210
+ msgid "Styling"
211
+ msgstr "Stijl"
212
+
213
+ #: ../kiwi_logo_carousel_admin.php:351
214
+ msgid "Logo Margin"
215
+ msgstr "Logo marges"
216
+
217
+ #: ../kiwi_logo_carousel_admin.php:355
218
+ msgid "Logo Style"
219
+ msgstr "Logo stijl"
220
+
221
+ #: ../kiwi_logo_carousel_admin.php:358
222
+ msgid "Grayscale Images"
223
+ msgstr "Afbeeldingen met grijstinten"
224
+
225
+ #: ../kiwi_logo_carousel_admin.php:359
226
+ msgid "Grayscale Images, Default Color on Hover"
227
+ msgstr "Afbeeldingen met grijstinten, standaard kleuren als de muis erop staat"
228
+
229
+ #: ../kiwi_logo_carousel_admin.php:363
230
+ msgid "Show captions"
231
+ msgstr "Laat titels zien"
232
+
233
+ #: ../kiwi_logo_carousel_admin.php:370
234
+ msgid "Adaptive Height"
235
+ msgstr "Flexibele hoogte"
236
+
237
+ #: ../kiwi_logo_carousel_admin.php:377
238
+ msgid "Responsive"
239
+ msgstr "Schaalbaar / Responsive"
240
+
241
+ #: ../kiwi_logo_carousel_admin.php:384
242
+ msgid "Minimal slides"
243
+ msgstr "Minimaal aantal dia's"
244
+
245
+ #: ../kiwi_logo_carousel_admin.php:388
246
+ msgid "Maximum slides"
247
+ msgstr "Maximum aantal dia's"
248
+
249
+ #: ../kiwi_logo_carousel_admin.php:392
250
+ msgid "Move slides"
251
+ msgstr "Aantal dia's verplaatsen"
252
+
253
+ #: ../kiwi_logo_carousel_admin.php:396
254
+ msgid "Slide Width"
255
+ msgstr "Dia breedte"
256
+
257
+ #~ msgid "Use CSS animations"
258
+ #~ msgstr "Gebruik CSS animaties"
259
+
260
+ #~ msgid "Sort by Order"
261
+ #~ msgstr "Sorteren op Volgorde"
262
+
263
+ #~ msgid "Run automatically"
264
+ #~ msgstr "Automatisch starten"
265
+
266
+ #~ msgid "Content Toggle"
267
+ #~ msgstr "Content Schakelaar"
268
+
269
+ #~ msgid ""
270
+ #~ "Enable jQuery library ( use this only if the jQuery plugin is not used in "
271
+ #~ "your theme )"
272
+ #~ msgstr ""
273
+ #~ "Gebruik de jQuery bibliotheek ( schakel deze functie in als er in uw "
274
+ #~ "thema geen jQuery bibliotheek voorkomt )"
275
+
276
+ #~ msgid "Off"
277
+ #~ msgstr "Uit"
278
+
279
+ #~ msgid "On"
280
+ #~ msgstr "Aan"
languages/kiwi_logo_carousel.pot ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Kiwi Logo Carousel\n"
4
+ "POT-Creation-Date: 2014-01-10 10:30+0100\n"
5
+ "PO-Revision-Date: 2014-01-10 10:30+0100\n"
6
+ "Last-Translator: Bjorn Manintveld <bjorn@yourstyledesign.nl>\n"
7
+ "Language-Team: Bjorn Manintveld <bjorn@yourstyledesign.nl>\n"
8
+ "Language: en\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.3\n"
13
+ "X-Poedit-KeywordsList: _;_e;__;_x\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+ "X-Poedit-SearchPath-1: ..\n"
18
+
19
+ #: ../kiwi_logo_carousel.php:123
20
+ msgid "This carousel is empty, please add some logos."
21
+ msgstr ""
22
+
23
+ #: ../kiwi_logo_carousel_admin.php:37 ../kiwi_logo_carousel_admin.php:48
24
+ msgid "Logos"
25
+ msgstr ""
26
+
27
+ #: ../kiwi_logo_carousel_admin.php:38 ../kiwi_logo_carousel_admin.php:140
28
+ msgid "Logo"
29
+ msgstr ""
30
+
31
+ #: ../kiwi_logo_carousel_admin.php:39 ../kiwi_logo_carousel_admin.php:40
32
+ msgid "Add New Logo"
33
+ msgstr ""
34
+
35
+ #: ../kiwi_logo_carousel_admin.php:41
36
+ msgid "Edit Logo"
37
+ msgstr ""
38
+
39
+ #: ../kiwi_logo_carousel_admin.php:42
40
+ msgid "New Logo"
41
+ msgstr ""
42
+
43
+ #: ../kiwi_logo_carousel_admin.php:43
44
+ msgid "View Logo"
45
+ msgstr ""
46
+
47
+ #: ../kiwi_logo_carousel_admin.php:44
48
+ msgid "Search Logos"
49
+ msgstr ""
50
+
51
+ #: ../kiwi_logo_carousel_admin.php:45
52
+ msgid "No Logos found"
53
+ msgstr ""
54
+
55
+ #: ../kiwi_logo_carousel_admin.php:46
56
+ msgid "No Logos found in Trash"
57
+ msgstr ""
58
+
59
+ #: ../kiwi_logo_carousel_admin.php:47
60
+ msgid "Parent Logo:"
61
+ msgstr ""
62
+
63
+ #: ../kiwi_logo_carousel_admin.php:102
64
+ msgid "Carousels"
65
+ msgstr ""
66
+
67
+ #: ../kiwi_logo_carousel_admin.php:130 ../kiwi_logo_carousel_admin.php:356
68
+ msgid "Default"
69
+ msgstr ""
70
+
71
+ #: ../kiwi_logo_carousel_admin.php:146
72
+ msgid "URL attachment (optional)"
73
+ msgstr ""
74
+
75
+ #: ../kiwi_logo_carousel_admin.php:153
76
+ msgid "Add an URL to make this logo clickable"
77
+ msgstr ""
78
+
79
+ #: ../kiwi_logo_carousel_admin.php:175 ../kiwi_logo_carousel_admin.php:176
80
+ msgid "Manage Carousels"
81
+ msgstr ""
82
+
83
+ #: ../kiwi_logo_carousel_admin.php:219
84
+ msgid "Settings saved."
85
+ msgstr ""
86
+
87
+ #: ../kiwi_logo_carousel_admin.php:236
88
+ msgid "Carousel"
89
+ msgstr ""
90
+
91
+ #: ../kiwi_logo_carousel_admin.php:239
92
+ msgid "Shortcode"
93
+ msgstr ""
94
+
95
+ #: ../kiwi_logo_carousel_admin.php:248
96
+ msgid "General"
97
+ msgstr ""
98
+
99
+ #: ../kiwi_logo_carousel_admin.php:252
100
+ msgid "Mode"
101
+ msgstr ""
102
+
103
+ #: ../kiwi_logo_carousel_admin.php:254
104
+ msgid "Horizontal"
105
+ msgstr ""
106
+
107
+ #: ../kiwi_logo_carousel_admin.php:255
108
+ msgid "Vertical"
109
+ msgstr ""
110
+
111
+ #: ../kiwi_logo_carousel_admin.php:259
112
+ msgid "Speed (ms)"
113
+ msgstr ""
114
+
115
+ #: ../kiwi_logo_carousel_admin.php:263
116
+ msgid "Infinite Loop"
117
+ msgstr ""
118
+
119
+ #: ../kiwi_logo_carousel_admin.php:265 ../kiwi_logo_carousel_admin.php:272
120
+ #: ../kiwi_logo_carousel_admin.php:280 ../kiwi_logo_carousel_admin.php:287
121
+ #: ../kiwi_logo_carousel_admin.php:318 ../kiwi_logo_carousel_admin.php:324
122
+ #: ../kiwi_logo_carousel_admin.php:332 ../kiwi_logo_carousel_admin.php:339
123
+ #: ../kiwi_logo_carousel_admin.php:365 ../kiwi_logo_carousel_admin.php:372
124
+ #: ../kiwi_logo_carousel_admin.php:378
125
+ msgid "True"
126
+ msgstr ""
127
+
128
+ #: ../kiwi_logo_carousel_admin.php:266 ../kiwi_logo_carousel_admin.php:273
129
+ #: ../kiwi_logo_carousel_admin.php:279 ../kiwi_logo_carousel_admin.php:286
130
+ #: ../kiwi_logo_carousel_admin.php:317 ../kiwi_logo_carousel_admin.php:325
131
+ #: ../kiwi_logo_carousel_admin.php:331 ../kiwi_logo_carousel_admin.php:338
132
+ #: ../kiwi_logo_carousel_admin.php:364 ../kiwi_logo_carousel_admin.php:371
133
+ #: ../kiwi_logo_carousel_admin.php:379
134
+ msgid "False"
135
+ msgstr ""
136
+
137
+ #: ../kiwi_logo_carousel_admin.php:270
138
+ msgid "Autoplay"
139
+ msgstr ""
140
+
141
+ #: ../kiwi_logo_carousel_admin.php:277
142
+ msgid "Use Ticker Mode"
143
+ msgstr ""
144
+
145
+ #: ../kiwi_logo_carousel_admin.php:284
146
+ msgid "Pause Ticker on Hover"
147
+ msgstr ""
148
+
149
+ #: ../kiwi_logo_carousel_admin.php:291
150
+ msgid "Order by"
151
+ msgstr ""
152
+
153
+ #: ../kiwi_logo_carousel_admin.php:293 ../kiwi_logo_carousel_order.php:197
154
+ msgid "Custom Order"
155
+ msgstr ""
156
+
157
+ #: ../kiwi_logo_carousel_admin.php:294
158
+ msgid "Random Order"
159
+ msgstr ""
160
+
161
+ #: ../kiwi_logo_carousel_admin.php:295
162
+ msgid "Title"
163
+ msgstr ""
164
+
165
+ #: ../kiwi_logo_carousel_admin.php:296
166
+ msgid "Date"
167
+ msgstr ""
168
+
169
+ #: ../kiwi_logo_carousel_admin.php:300
170
+ msgid "Clickable logos"
171
+ msgstr ""
172
+
173
+ #: ../kiwi_logo_carousel_admin.php:302
174
+ msgid "Open in new tab"
175
+ msgstr ""
176
+
177
+ #: ../kiwi_logo_carousel_admin.php:303
178
+ msgid "Open in the same window"
179
+ msgstr ""
180
+
181
+ #: ../kiwi_logo_carousel_admin.php:304
182
+ msgid "Turn off"
183
+ msgstr ""
184
+
185
+ #: ../kiwi_logo_carousel_admin.php:311
186
+ msgid "Controls"
187
+ msgstr ""
188
+
189
+ #: ../kiwi_logo_carousel_admin.php:315
190
+ msgid "Hide next button on last slide"
191
+ msgstr ""
192
+
193
+ #: ../kiwi_logo_carousel_admin.php:322
194
+ msgid "Show Controls"
195
+ msgstr ""
196
+
197
+ #: ../kiwi_logo_carousel_admin.php:329
198
+ msgid "Show Pager"
199
+ msgstr ""
200
+
201
+ #: ../kiwi_logo_carousel_admin.php:336
202
+ msgid "Show Start and Stop Controls"
203
+ msgstr ""
204
+
205
+ #: ../kiwi_logo_carousel_admin.php:346
206
+ msgid "Styling"
207
+ msgstr ""
208
+
209
+ #: ../kiwi_logo_carousel_admin.php:350
210
+ msgid "Logo Margin"
211
+ msgstr ""
212
+
213
+ #: ../kiwi_logo_carousel_admin.php:354
214
+ msgid "Logo Style"
215
+ msgstr ""
216
+
217
+ #: ../kiwi_logo_carousel_admin.php:357
218
+ msgid "Grayscale Images"
219
+ msgstr ""
220
+
221
+ #: ../kiwi_logo_carousel_admin.php:358
222
+ msgid "Grayscale Images, Default Color on Hover"
223
+ msgstr ""
224
+
225
+ #: ../kiwi_logo_carousel_admin.php:362
226
+ msgid "Show captions"
227
+ msgstr ""
228
+
229
+ #: ../kiwi_logo_carousel_admin.php:369
230
+ msgid "Adaptive Height"
231
+ msgstr ""
232
+
233
+ #: ../kiwi_logo_carousel_admin.php:376
234
+ msgid "Responsive"
235
+ msgstr ""
236
+
237
+ #: ../kiwi_logo_carousel_admin.php:383
238
+ msgid "Minimal slides"
239
+ msgstr ""
240
+
241
+ #: ../kiwi_logo_carousel_admin.php:387
242
+ msgid "Maximum slides"
243
+ msgstr ""
244
+
245
+ #: ../kiwi_logo_carousel_admin.php:391
246
+ msgid "Move slides"
247
+ msgstr ""
248
+
249
+ #: ../kiwi_logo_carousel_admin.php:395
250
+ msgid "Slide Width"
251
+ msgstr ""
third-party/jquery.bxslider/images/bx_loader.gif ADDED
Binary file
third-party/jquery.bxslider/images/controls.png ADDED
Binary file
third-party/jquery.bxslider/images/controls@2x.png ADDED
Binary file
third-party/jquery.bxslider/images/controls@3x.png ADDED
Binary file
third-party/jquery.bxslider/jquery.bxslider.css ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * BxSlider v4.0 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Written by: Steven Wanderski, 2012
6
+ * http://stevenwanderski.com
7
+ * (while drinking Belgian ales and listening to jazz)
8
+ *
9
+ * CEO and founder of bxCreative, LTD
10
+ * http://bxcreative.com
11
+ */
12
+
13
+
14
+ /** RESET AND LAYOUT
15
+ ===================================*/
16
+
17
+ .bx-wrapper {
18
+ position: relative;
19
+ margin: 0 auto 60px;
20
+ padding: 0;
21
+ *zoom: 1;
22
+ }
23
+
24
+ .bx-wrapper img {
25
+ max-width: 100%;
26
+ display: block;
27
+ }
28
+
29
+ /** THEME
30
+ ===================================*/
31
+
32
+ .bx-wrapper .bx-viewport {
33
+ -moz-box-shadow: 0 0 5px #ccc;
34
+ -webkit-box-shadow: 0 0 5px #ccc;
35
+ box-shadow: 0 0 5px #ccc;
36
+ border: solid #fff 5px;
37
+ left: -5px;
38
+ background: #fff;
39
+ }
40
+
41
+ .bx-wrapper .bx-pager,
42
+ .bx-wrapper .bx-controls-auto {
43
+ position: absolute;
44
+ bottom: -30px;
45
+ width: 100%;
46
+ }
47
+
48
+ /* LOADER */
49
+
50
+ .bx-wrapper .bx-loading {
51
+ min-height: 50px;
52
+ background: url(images/bx_loader.gif) center center no-repeat #fff;
53
+ height: 100%;
54
+ width: 100%;
55
+ position: absolute;
56
+ top: 0;
57
+ left: 0;
58
+ z-index: 2000;
59
+ }
60
+
61
+ /* PAGER */
62
+
63
+ .bx-wrapper .bx-pager {
64
+ text-align: center;
65
+ font-size: .85em;
66
+ font-family: Arial;
67
+ font-weight: bold;
68
+ color: #666;
69
+ padding-top: 20px;
70
+ }
71
+
72
+ .bx-wrapper .bx-pager .bx-pager-item,
73
+ .bx-wrapper .bx-controls-auto .bx-controls-auto-item {
74
+ display: inline-block;
75
+ *zoom: 1;
76
+ *display: inline;
77
+ }
78
+
79
+ .bx-wrapper .bx-pager.bx-default-pager a {
80
+ background: #666;
81
+ text-indent: -9999px;
82
+ display: block;
83
+ width: 10px;
84
+ height: 10px;
85
+ margin: 0 5px;
86
+ outline: 0;
87
+ -moz-border-radius: 5px;
88
+ -webkit-border-radius: 5px;
89
+ border-radius: 5px;
90
+ }
91
+
92
+ .bx-wrapper .bx-pager.bx-default-pager a:hover,
93
+ .bx-wrapper .bx-pager.bx-default-pager a.active {
94
+ background: #000;
95
+ }
96
+
97
+ /* DIRECTION CONTROLS (NEXT / PREV) */
98
+
99
+ .bx-wrapper .bx-prev {
100
+ left: 10px;
101
+ background: url(images/controls.png) no-repeat 0 -32px;
102
+ }
103
+
104
+ .bx-wrapper .bx-next {
105
+ right: 10px;
106
+ background: url(images/controls.png) no-repeat -43px -32px;
107
+ }
108
+
109
+ .bx-wrapper .bx-prev:hover {
110
+ background-position: 0 0;
111
+ }
112
+
113
+ .bx-wrapper .bx-next:hover {
114
+ background-position: -43px 0;
115
+ }
116
+
117
+ .bx-wrapper .bx-controls-direction a {
118
+ position: absolute;
119
+ top: 50%;
120
+ margin-top: -16px;
121
+ outline: 0;
122
+ width: 32px;
123
+ height: 32px;
124
+ text-indent: -9999px;
125
+ z-index: 9999;
126
+ }
127
+
128
+ .bx-wrapper .bx-controls-direction a.disabled {
129
+ display: none;
130
+ }
131
+
132
+ /* AUTO CONTROLS (START / STOP) */
133
+
134
+ .bx-wrapper .bx-controls-auto {
135
+ text-align: center;
136
+ }
137
+
138
+ .bx-wrapper .bx-controls-auto .bx-start {
139
+ display: block;
140
+ text-indent: -9999px;
141
+ width: 10px;
142
+ height: 11px;
143
+ outline: 0;
144
+ background: url(images/controls.png) -86px -11px no-repeat;
145
+ margin: 0 3px;
146
+ }
147
+
148
+ .bx-wrapper .bx-controls-auto .bx-start:hover,
149
+ .bx-wrapper .bx-controls-auto .bx-start.active {
150
+ background-position: -86px 0;
151
+ }
152
+
153
+ .bx-wrapper .bx-controls-auto .bx-stop {
154
+ display: block;
155
+ text-indent: -9999px;
156
+ width: 9px;
157
+ height: 11px;
158
+ outline: 0;
159
+ background: url(images/controls.png) -86px -44px no-repeat;
160
+ margin: 0 3px;
161
+ }
162
+
163
+ .bx-wrapper .bx-controls-auto .bx-stop:hover,
164
+ .bx-wrapper .bx-controls-auto .bx-stop.active {
165
+ background-position: -86px -33px;
166
+ }
167
+
168
+ /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */
169
+
170
+ .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager {
171
+ text-align: left;
172
+ width: 80%;
173
+ }
174
+
175
+ .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto {
176
+ right: 0;
177
+ width: 35px;
178
+ }
179
+
180
+ /* IMAGE CAPTIONS */
181
+
182
+ .bx-wrapper .bx-caption {
183
+ position: absolute;
184
+ bottom: 0;
185
+ left: 0;
186
+ background: #666\9;
187
+ background: rgba(80, 80, 80, 0.75);
188
+ width: 100%;
189
+ }
190
+
191
+ .bx-wrapper .bx-caption span {
192
+ color: #fff;
193
+ font-family: Arial;
194
+ display: block;
195
+ font-size: .85em;
196
+ padding: 10px;
197
+ }
third-party/jquery.bxslider/jquery.bxslider.js ADDED
@@ -0,0 +1,1315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * BxSlider v4.1.1 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Copyright 2013, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
+ * Written while drinking Belgian ales and listening to jazz
7
+ *
8
+ * Released under the MIT license - http://opensource.org/licenses/MIT
9
+ */
10
+
11
+ ;(function($){
12
+
13
+ var plugin = {};
14
+
15
+ var defaults = {
16
+
17
+ // GENERAL
18
+ mode: 'horizontal',
19
+ slideSelector: '',
20
+ infiniteLoop: true,
21
+ hideControlOnEnd: false,
22
+ speed: 500,
23
+ easing: null,
24
+ slideMargin: 0,
25
+ startSlide: 0,
26
+ randomStart: false,
27
+ captions: false,
28
+ ticker: false,
29
+ tickerHover: false,
30
+ adaptiveHeight: false,
31
+ adaptiveHeightSpeed: 500,
32
+ video: false,
33
+ useCSS: false, //default=true
34
+ preloadImages: 'visible',
35
+ responsive: true,
36
+
37
+ // TOUCH
38
+ touchEnabled: true,
39
+ swipeThreshold: 50,
40
+ oneToOneTouch: true,
41
+ preventDefaultSwipeX: true,
42
+ preventDefaultSwipeY: false,
43
+
44
+ // PAGER
45
+ pager: false, //default=true
46
+ pagerType: 'full',
47
+ pagerShortSeparator: ' / ',
48
+ pagerSelector: null,
49
+ buildPager: null,
50
+ pagerCustom: null,
51
+
52
+ // CONTROLS
53
+ controls: true,
54
+ nextText: 'Next',
55
+ prevText: 'Prev',
56
+ nextSelector: null,
57
+ prevSelector: null,
58
+ autoControls: false,
59
+ startText: 'Start',
60
+ stopText: 'Stop',
61
+ autoControlsCombine: false,
62
+ autoControlsSelector: null,
63
+
64
+ // AUTO
65
+ auto: true, //default=false
66
+ pause: 4000,
67
+ autoStart: true,
68
+ autoDirection: 'next',
69
+ autoHover: false,
70
+ autoDelay: 0,
71
+
72
+ // CAROUSEL
73
+ minSlides: 4, //default=1
74
+ maxSlides: 4, //default=1
75
+ moveSlides: 1, //default=0
76
+ slideWidth: 200, //default=0
77
+
78
+ // CALLBACKS
79
+ onSliderLoad: function() {},
80
+ onSlideBefore: function() {},
81
+ onSlideAfter: function() {},
82
+ onSlideNext: function() {},
83
+ onSlidePrev: function() {}
84
+ }
85
+
86
+ $.fn.bxSlider = function(options){
87
+
88
+ if(this.length == 0) return this;
89
+
90
+ // support mutltiple elements
91
+ if(this.length > 1){
92
+ this.each(function(){$(this).bxSlider(options)});
93
+ return this;
94
+ }
95
+
96
+ // create a namespace to be used throughout the plugin
97
+ var slider = {};
98
+ // set a reference to our slider element
99
+ var el = this;
100
+ plugin.el = this;
101
+
102
+ /**
103
+ * Makes slideshow responsive
104
+ */
105
+ // first get the original window dimens (thanks alot IE)
106
+ var windowWidth = $(window).width();
107
+ var windowHeight = $(window).height();
108
+
109
+
110
+
111
+ /**
112
+ * ===================================================================================
113
+ * = PRIVATE FUNCTIONS
114
+ * ===================================================================================
115
+ */
116
+
117
+ /**
118
+ * Initializes namespace settings to be used throughout plugin
119
+ */
120
+ var init = function(){
121
+ // merge user-supplied options with the defaults
122
+ slider.settings = $.extend({}, defaults, options);
123
+ // parse slideWidth setting
124
+ slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
125
+ // store the original children
126
+ slider.children = el.children(slider.settings.slideSelector);
127
+ // check if actual number of slides is less than minSlides / maxSlides
128
+ if(slider.children.length < slider.settings.minSlides) slider.settings.minSlides = slider.children.length;
129
+ if(slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides = slider.children.length;
130
+ // if random start, set the startSlide setting to random number
131
+ if(slider.settings.randomStart) slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
132
+ // store active slide information
133
+ slider.active = { index: slider.settings.startSlide }
134
+ // store if the slider is in carousel mode (displaying / moving multiple slides)
135
+ slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
136
+ // if carousel, force preloadImages = 'all'
137
+ if(slider.carousel) slider.settings.preloadImages = 'all';
138
+ // calculate the min / max width thresholds based on min / max number of slides
139
+ // used to setup and update carousel slides dimensions
140
+ slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
141
+ slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
142
+ // store the current state of the slider (if currently animating, working is true)
143
+ slider.working = false;
144
+ // initialize the controls object
145
+ slider.controls = {};
146
+ // initialize an auto interval
147
+ slider.interval = null;
148
+ // determine which property to use for transitions
149
+ slider.animProp = slider.settings.mode == 'vertical' ? 'top' : 'left';
150
+ // determine if hardware acceleration can be used
151
+ slider.usingCSS = slider.settings.useCSS && slider.settings.mode != 'fade' && (function(){
152
+ // create our test div element
153
+ var div = document.createElement('div');
154
+ // css transition properties
155
+ var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
156
+ // test for each property
157
+ for(var i in props){
158
+ if(div.style[props[i]] !== undefined){
159
+ slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
160
+ slider.animProp = '-' + slider.cssPrefix + '-transform';
161
+ return true;
162
+ }
163
+ }
164
+ return false;
165
+ }());
166
+ // if vertical mode always make maxSlides and minSlides equal
167
+ if(slider.settings.mode == 'vertical') slider.settings.maxSlides = slider.settings.minSlides;
168
+ // save original style data
169
+ el.data("origStyle", el.attr("style"));
170
+ el.children(slider.settings.slideSelector).each(function() {
171
+ $(this).data("origStyle", $(this).attr("style"));
172
+ });
173
+ // perform all DOM / CSS modifications
174
+ setup();
175
+ }
176
+
177
+ /**
178
+ * Performs all DOM and CSS modifications
179
+ */
180
+ var setup = function(){
181
+ // wrap el in a wrapper
182
+ el.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>');
183
+ // store a namspace reference to .bx-viewport
184
+ slider.viewport = el.parent();
185
+ // add a loading div to display while images are loading
186
+ slider.loader = $('<div class="bx-loading" />');
187
+ slider.viewport.prepend(slider.loader);
188
+ // set el to a massive width, to hold any needed slides
189
+ // also strip any margin and padding from el
190
+ el.css({
191
+ width: slider.settings.mode == 'horizontal' ? (slider.children.length * 100 + 215) + '%' : 'auto',
192
+ position: 'relative'
193
+ });
194
+ // if using CSS, add the easing property
195
+ if(slider.usingCSS && slider.settings.easing){
196
+ el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
197
+ // if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
198
+ }else if(!slider.settings.easing){
199
+ slider.settings.easing = 'swing';
200
+ }
201
+ var slidesShowing = getNumberSlidesShowing();
202
+ // make modifications to the viewport (.bx-viewport)
203
+ slider.viewport.css({
204
+ width: '100%',
205
+ overflow: 'hidden',
206
+ position: 'relative'
207
+ });
208
+ slider.viewport.parent().css({
209
+ maxWidth: getViewportMaxWidth()
210
+ });
211
+ // make modification to the wrapper (.bx-wrapper)
212
+ if(!slider.settings.pager) {
213
+ slider.viewport.parent().css({
214
+ margin: '0 auto 0px'
215
+ });
216
+ }
217
+ // apply css to all slider children
218
+ slider.children.css({
219
+ 'float': slider.settings.mode == 'horizontal' ? 'left' : 'none',
220
+ listStyle: 'none',
221
+ position: 'relative'
222
+ });
223
+ // apply the calculated width after the float is applied to prevent scrollbar interference
224
+ slider.children.css('width', getSlideWidth());
225
+ // if slideMargin is supplied, add the css
226
+ if(slider.settings.mode == 'horizontal' && slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin);
227
+ if(slider.settings.mode == 'vertical' && slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin);
228
+ // if "fade" mode, add positioning and z-index CSS
229
+ if(slider.settings.mode == 'fade'){
230
+ slider.children.css({
231
+ position: 'absolute',
232
+ zIndex: 0,
233
+ display: 'none'
234
+ });
235
+ // prepare the z-index on the showing element
236
+ slider.children.eq(slider.settings.startSlide).css({zIndex: 50, display: 'block'});
237
+ }
238
+ // create an element to contain all slider controls (pager, start / stop, etc)
239
+ slider.controls.el = $('<div class="bx-controls" />');
240
+ // if captions are requested, add them
241
+ if(slider.settings.captions) appendCaptions();
242
+ // check if startSlide is last slide
243
+ slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
244
+ // if video is true, set up the fitVids plugin
245
+ if(slider.settings.video) el.fitVids();
246
+ // set the default preload selector (visible)
247
+ var preloadSelector = slider.children.eq(slider.settings.startSlide);
248
+ if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
249
+ // only check for control addition if not in "ticker" mode
250
+ if(!slider.settings.ticker){
251
+ // if pager is requested, add it
252
+ if(slider.settings.pager) appendPager();
253
+ // if controls are requested, add them
254
+ if(slider.settings.controls) appendControls();
255
+ // if auto is true, and auto controls are requested, add them
256
+ if(slider.settings.auto && slider.settings.autoControls) appendControlsAuto();
257
+ // if any control option is requested, add the controls wrapper
258
+ if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager) slider.viewport.after(slider.controls.el);
259
+ // if ticker mode, do not allow a pager
260
+ }else{
261
+ slider.settings.pager = false;
262
+ }
263
+ // preload all images, then perform final DOM / CSS modifications that depend on images being loaded
264
+ loadElements(preloadSelector, start);
265
+ }
266
+
267
+ var loadElements = function(selector, callback){
268
+ var total = selector.find('img, iframe').length;
269
+ if (total == 0){
270
+ callback();
271
+ return;
272
+ }
273
+ var count = 0;
274
+ selector.find('img, iframe').each(function(){
275
+ $(this).one('load', function() {
276
+ if(++count == total) callback();
277
+ }).each(function() {
278
+ if(this.complete) $(this).load();
279
+ });
280
+ });
281
+ }
282
+
283
+ /**
284
+ * Start the slider
285
+ */
286
+ var start = function(){
287
+ // if infinite loop, prepare additional slides
288
+ if(slider.settings.infiniteLoop && slider.settings.mode != 'fade' && !slider.settings.ticker){
289
+ var slice = slider.settings.mode == 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
290
+ var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
291
+ var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
292
+ el.append(sliceAppend).prepend(slicePrepend);
293
+ }
294
+ // remove the loading DOM element
295
+ slider.loader.remove();
296
+ // set the left / top position of "el"
297
+ setSlidePosition();
298
+ // if "vertical" mode, always use adaptiveHeight to prevent odd behavior
299
+ if (slider.settings.mode == 'vertical') slider.settings.adaptiveHeight = true;
300
+ // set the viewport height
301
+ slider.viewport.height(getViewportHeight());
302
+ // make sure everything is positioned just right (same as a window resize)
303
+ el.redrawSlider();
304
+ // onSliderLoad callback
305
+ slider.settings.onSliderLoad(slider.active.index);
306
+ // slider has been fully initialized
307
+ slider.initialized = true;
308
+ // bind the resize call to the window
309
+ if (slider.settings.responsive) $(window).bind('resize', resizeWindow);
310
+ // if auto is true, start the show
311
+ if (slider.settings.auto && slider.settings.autoStart) initAuto();
312
+ // if ticker is true, start the ticker
313
+ if (slider.settings.ticker) initTicker();
314
+ // if pager is requested, make the appropriate pager link active
315
+ if (slider.settings.pager) updatePagerActive(slider.settings.startSlide);
316
+ // check for any updates to the controls (like hideControlOnEnd updates)
317
+ if (slider.settings.controls) updateDirectionControls();
318
+ // if touchEnabled is true, setup the touch events
319
+ if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
320
+ }
321
+
322
+ /**
323
+ * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
324
+ */
325
+ var getViewportHeight = function(){
326
+ var height = 0;
327
+ // first determine which children (slides) should be used in our height calculation
328
+ var children = $();
329
+ // if mode is not "vertical" and adaptiveHeight is false, include all children
330
+ if(slider.settings.mode != 'vertical' && !slider.settings.adaptiveHeight){
331
+ children = slider.children;
332
+ }else{
333
+ // if not carousel, return the single active child
334
+ if(!slider.carousel){
335
+ children = slider.children.eq(slider.active.index);
336
+ // if carousel, return a slice of children
337
+ }else{
338
+ // get the individual slide index
339
+ var currentIndex = slider.settings.moveSlides == 1 ? slider.active.index : slider.active.index * getMoveBy();
340
+ // add the current slide to the children
341
+ children = slider.children.eq(currentIndex);
342
+ // cycle through the remaining "showing" slides
343
+ for (i = 1; i <= slider.settings.maxSlides - 1; i++){
344
+ // if looped back to the start
345
+ if(currentIndex + i >= slider.children.length){
346
+ children = children.add(slider.children.eq(i - 1));
347
+ }else{
348
+ children = children.add(slider.children.eq(currentIndex + i));
349
+ }
350
+ }
351
+ }
352
+ }
353
+ // if "vertical" mode, calculate the sum of the heights of the children
354
+ if(slider.settings.mode == 'vertical'){
355
+ children.each(function(index) {
356
+ height += $(this).outerHeight();
357
+ });
358
+ // add user-supplied margins
359
+ if(slider.settings.slideMargin > 0){
360
+ height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
361
+ }
362
+ // if not "vertical" mode, calculate the max height of the children
363
+ }else{
364
+ height = Math.max.apply(Math, children.map(function(){
365
+ return $(this).outerHeight(false);
366
+ }).get());
367
+ }
368
+ return height;
369
+ }
370
+
371
+ /**
372
+ * Returns the calculated width to be used for the outer wrapper / viewport
373
+ */
374
+ var getViewportMaxWidth = function(){
375
+ var width = '100%';
376
+ if(slider.settings.slideWidth > 0){
377
+ if(slider.settings.mode == 'horizontal'){
378
+ width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
379
+ }else{
380
+ width = slider.settings.slideWidth;
381
+ }
382
+ }
383
+ return width;
384
+ }
385
+
386
+ /**
387
+ * Returns the calculated width to be applied to each slide
388
+ */
389
+ var getSlideWidth = function(){
390
+ // start with any user-supplied slide width
391
+ var newElWidth = slider.settings.slideWidth;
392
+ // get the current viewport width
393
+ var wrapWidth = slider.viewport.width();
394
+ // if slide width was not supplied, or is larger than the viewport use the viewport width
395
+ if(slider.settings.slideWidth == 0 ||
396
+ (slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
397
+ slider.settings.mode == 'vertical'){
398
+ newElWidth = wrapWidth;
399
+ // if carousel, use the thresholds to determine the width
400
+ }else if(slider.settings.maxSlides > 1 && slider.settings.mode == 'horizontal'){
401
+ if(wrapWidth > slider.maxThreshold){
402
+ // newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
403
+ }else if(wrapWidth < slider.minThreshold){
404
+ newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
405
+ }
406
+ }
407
+ return newElWidth;
408
+ }
409
+
410
+ /**
411
+ * Returns the number of slides currently visible in the viewport (includes partially visible slides)
412
+ */
413
+ var getNumberSlidesShowing = function(){
414
+ var slidesShowing = 1;
415
+ if(slider.settings.mode == 'horizontal' && slider.settings.slideWidth > 0){
416
+ // if viewport is smaller than minThreshold, return minSlides
417
+ if(slider.viewport.width() < slider.minThreshold){
418
+ slidesShowing = slider.settings.minSlides;
419
+ // if viewport is larger than minThreshold, return maxSlides
420
+ }else if(slider.viewport.width() > slider.maxThreshold){
421
+ slidesShowing = slider.settings.maxSlides;
422
+ // if viewport is between min / max thresholds, divide viewport width by first child width
423
+ }else{
424
+ var childWidth = slider.children.first().width();
425
+ slidesShowing = Math.floor(slider.viewport.width() / childWidth);
426
+ }
427
+ // if "vertical" mode, slides showing will always be minSlides
428
+ }else if(slider.settings.mode == 'vertical'){
429
+ slidesShowing = slider.settings.minSlides;
430
+ }
431
+ return slidesShowing;
432
+ }
433
+
434
+ /**
435
+ * Returns the number of pages (one full viewport of slides is one "page")
436
+ */
437
+ var getPagerQty = function(){
438
+ var pagerQty = 0;
439
+ // if moveSlides is specified by the user
440
+ if(slider.settings.moveSlides > 0){
441
+ if(slider.settings.infiniteLoop){
442
+ pagerQty = slider.children.length / getMoveBy();
443
+ }else{
444
+ // use a while loop to determine pages
445
+ var breakPoint = 0;
446
+ var counter = 0
447
+ // when breakpoint goes above children length, counter is the number of pages
448
+ while (breakPoint < slider.children.length){
449
+ ++pagerQty;
450
+ breakPoint = counter + getNumberSlidesShowing();
451
+ counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
452
+ }
453
+ }
454
+ // if moveSlides is 0 (auto) divide children length by sides showing, then round up
455
+ }else{
456
+ pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
457
+ }
458
+ return pagerQty;
459
+ }
460
+
461
+ /**
462
+ * Returns the number of indivual slides by which to shift the slider
463
+ */
464
+ var getMoveBy = function(){
465
+ // if moveSlides was set by the user and moveSlides is less than number of slides showing
466
+ if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
467
+ return slider.settings.moveSlides;
468
+ }
469
+ // if moveSlides is 0 (auto)
470
+ return getNumberSlidesShowing();
471
+ }
472
+
473
+ /**
474
+ * Sets the slider's (el) left or top position
475
+ */
476
+ var setSlidePosition = function(){
477
+ // if last slide, not infinite loop, and number of children is larger than specified maxSlides
478
+ if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
479
+ if (slider.settings.mode == 'horizontal'){
480
+ // get the last child's position
481
+ var lastChild = slider.children.last();
482
+ var position = lastChild.position();
483
+ // set the left position
484
+ setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);
485
+ }else if(slider.settings.mode == 'vertical'){
486
+ // get the last showing index's position
487
+ var lastShowingIndex = slider.children.length - slider.settings.minSlides;
488
+ var position = slider.children.eq(lastShowingIndex).position();
489
+ // set the top position
490
+ setPositionProperty(-position.top, 'reset', 0);
491
+ }
492
+ // if not last slide
493
+ }else{
494
+ // get the position of the first showing slide
495
+ var position = slider.children.eq(slider.active.index * getMoveBy()).position();
496
+ // check for last slide
497
+ if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
498
+ // set the repective position
499
+ if (position != undefined){
500
+ if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
501
+ else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
502
+ }
503
+ }
504
+ }
505
+
506
+ /**
507
+ * Sets the el's animating property position (which in turn will sometimes animate el).
508
+ * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
509
+ *
510
+ * @param value (int)
511
+ * - the animating property's value
512
+ *
513
+ * @param type (string) 'slider', 'reset', 'ticker'
514
+ * - the type of instance for which the function is being
515
+ *
516
+ * @param duration (int)
517
+ * - the amount of time (in ms) the transition should occupy
518
+ *
519
+ * @param params (array) optional
520
+ * - an optional parameter containing any variables that need to be passed in
521
+ */
522
+ var setPositionProperty = function(value, type, duration, params){
523
+ // use CSS transform
524
+ if(slider.usingCSS){
525
+ // determine the translate3d value
526
+ var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
527
+ // add the CSS transition-duration
528
+ el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
529
+ if(type == 'slide'){
530
+ // set the property value
531
+ el.css(slider.animProp, propValue);
532
+ // bind a callback method - executes when CSS transition completes
533
+ el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
534
+ // unbind the callback
535
+ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
536
+ updateAfterSlideTransition();
537
+ });
538
+ }else if(type == 'reset'){
539
+ el.css(slider.animProp, propValue);
540
+ }else if(type == 'ticker'){
541
+ // make the transition use 'linear'
542
+ el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
543
+ el.css(slider.animProp, propValue);
544
+ // bind a callback method - executes when CSS transition completes
545
+ el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
546
+ // unbind the callback
547
+ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
548
+ // reset the position
549
+ setPositionProperty(params['resetValue'], 'reset', 0);
550
+ // start the loop again
551
+ tickerLoop();
552
+ });
553
+ }
554
+ // use JS animate
555
+ }else{
556
+ var animateObj = {};
557
+ animateObj[slider.animProp] = value;
558
+ if(type == 'slide'){
559
+ el.animate(animateObj, duration, slider.settings.easing, function(){
560
+ updateAfterSlideTransition();
561
+ });
562
+ }else if(type == 'reset'){
563
+ el.css(slider.animProp, value)
564
+ }else if(type == 'ticker'){
565
+ el.animate(animateObj, speed, 'linear', function(){
566
+ setPositionProperty(params['resetValue'], 'reset', 0);
567
+ // run the recursive loop after animation
568
+ tickerLoop();
569
+ });
570
+ }
571
+ }
572
+ }
573
+
574
+ /**
575
+ * Populates the pager with proper amount of pages
576
+ */
577
+ var populatePager = function(){
578
+ var pagerHtml = '';
579
+ var pagerQty = getPagerQty();
580
+ // loop through each pager item
581
+ for(var i=0; i < pagerQty; i++){
582
+ var linkContent = '';
583
+ // if a buildPager function is supplied, use it to get pager link value, else use index + 1
584
+ if(slider.settings.buildPager && $.isFunction(slider.settings.buildPager)){
585
+ linkContent = slider.settings.buildPager(i);
586
+ slider.pagerEl.addClass('bx-custom-pager');
587
+ }else{
588
+ linkContent = i + 1;
589
+ slider.pagerEl.addClass('bx-default-pager');
590
+ }
591
+ // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1;
592
+ // add the markup to the string
593
+ pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
594
+ };
595
+ // populate the pager element with pager links
596
+ slider.pagerEl.html(pagerHtml);
597
+ }
598
+
599
+ /**
600
+ * Appends the pager to the controls element
601
+ */
602
+ var appendPager = function(){
603
+ if(!slider.settings.pagerCustom){
604
+ // create the pager DOM element
605
+ slider.pagerEl = $('<div class="bx-pager" />');
606
+ // if a pager selector was supplied, populate it with the pager
607
+ if(slider.settings.pagerSelector){
608
+ $(slider.settings.pagerSelector).html(slider.pagerEl);
609
+ // if no pager selector was supplied, add it after the wrapper
610
+ }else{
611
+ slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
612
+ }
613
+ // populate the pager
614
+ populatePager();
615
+ }else{
616
+ slider.pagerEl = $(slider.settings.pagerCustom);
617
+ }
618
+ // assign the pager click binding
619
+ slider.pagerEl.delegate('a', 'click', clickPagerBind);
620
+ }
621
+
622
+ /**
623
+ * Appends prev / next controls to the controls element
624
+ */
625
+ var appendControls = function(){
626
+ slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
627
+ slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
628
+ // bind click actions to the controls
629
+ slider.controls.next.bind('click', clickNextBind);
630
+ slider.controls.prev.bind('click', clickPrevBind);
631
+ // if nextSlector was supplied, populate it
632
+ if(slider.settings.nextSelector){
633
+ $(slider.settings.nextSelector).append(slider.controls.next);
634
+ }
635
+ // if prevSlector was supplied, populate it
636
+ if(slider.settings.prevSelector){
637
+ $(slider.settings.prevSelector).append(slider.controls.prev);
638
+ }
639
+ // if no custom selectors were supplied
640
+ if(!slider.settings.nextSelector && !slider.settings.prevSelector){
641
+ // add the controls to the DOM
642
+ slider.controls.directionEl = $('<div class="bx-controls-direction" />');
643
+ // add the control elements to the directionEl
644
+ slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
645
+ // slider.viewport.append(slider.controls.directionEl);
646
+ slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
647
+ }
648
+ }
649
+
650
+ /**
651
+ * Appends start / stop auto controls to the controls element
652
+ */
653
+ var appendControlsAuto = function(){
654
+ slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
655
+ slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
656
+ // add the controls to the DOM
657
+ slider.controls.autoEl = $('<div class="bx-controls-auto" />');
658
+ // bind click actions to the controls
659
+ slider.controls.autoEl.delegate('.bx-start', 'click', clickStartBind);
660
+ slider.controls.autoEl.delegate('.bx-stop', 'click', clickStopBind);
661
+ // if autoControlsCombine, insert only the "start" control
662
+ if(slider.settings.autoControlsCombine){
663
+ slider.controls.autoEl.append(slider.controls.start);
664
+ // if autoControlsCombine is false, insert both controls
665
+ }else{
666
+ slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
667
+ }
668
+ // if auto controls selector was supplied, populate it with the controls
669
+ if(slider.settings.autoControlsSelector){
670
+ $(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
671
+ // if auto controls selector was not supplied, add it after the wrapper
672
+ }else{
673
+ slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
674
+ }
675
+ // update the auto controls
676
+ updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
677
+ }
678
+
679
+ /**
680
+ * Appends image captions to the DOM
681
+ */
682
+ var appendCaptions = function(){
683
+ // cycle through each child
684
+ slider.children.each(function(index){
685
+ // get the image title attribute
686
+ var title = $(this).find('img:first').attr('title');
687
+ // append the caption
688
+ if (title != undefined && ('' + title).length) {
689
+ $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
690
+ }
691
+ });
692
+ }
693
+
694
+ /**
695
+ * Click next binding
696
+ *
697
+ * @param e (event)
698
+ * - DOM event object
699
+ */
700
+ var clickNextBind = function(e){
701
+ // if auto show is running, stop it
702
+ if (slider.settings.auto) el.stopAuto();
703
+ el.goToNextSlide();
704
+ e.preventDefault();
705
+ }
706
+
707
+ /**
708
+ * Click prev binding
709
+ *
710
+ * @param e (event)
711
+ * - DOM event object
712
+ */
713
+ var clickPrevBind = function(e){
714
+ // if auto show is running, stop it
715
+ if (slider.settings.auto) el.stopAuto();
716
+ el.goToPrevSlide();
717
+ e.preventDefault();
718
+ }
719
+
720
+ /**
721
+ * Click start binding
722
+ *
723
+ * @param e (event)
724
+ * - DOM event object
725
+ */
726
+ var clickStartBind = function(e){
727
+ el.startAuto();
728
+ e.preventDefault();
729
+ }
730
+
731
+ /**
732
+ * Click stop binding
733
+ *
734
+ * @param e (event)
735
+ * - DOM event object
736
+ */
737
+ var clickStopBind = function(e){
738
+ el.stopAuto();
739
+ e.preventDefault();
740
+ }
741
+
742
+ /**
743
+ * Click pager binding
744
+ *
745
+ * @param e (event)
746
+ * - DOM event object
747
+ */
748
+ var clickPagerBind = function(e){
749
+ // if auto show is running, stop it
750
+ if (slider.settings.auto) el.stopAuto();
751
+ var pagerLink = $(e.currentTarget);
752
+ var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
753
+ // if clicked pager link is not active, continue with the goToSlide call
754
+ if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
755
+ e.preventDefault();
756
+ }
757
+
758
+ /**
759
+ * Updates the pager links with an active class
760
+ *
761
+ * @param slideIndex (int)
762
+ * - index of slide to make active
763
+ */
764
+ var updatePagerActive = function(slideIndex){
765
+ // if "short" pager type
766
+ var len = slider.children.length; // nb of children
767
+ if(slider.settings.pagerType == 'short'){
768
+ if(slider.settings.maxSlides > 1) {
769
+ len = Math.ceil(slider.children.length/slider.settings.maxSlides);
770
+ }
771
+ slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
772
+ return;
773
+ }
774
+ // remove all pager active classes
775
+ slider.pagerEl.find('a').removeClass('active');
776
+ // apply the active class for all pagers
777
+ slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
778
+ }
779
+
780
+ /**
781
+ * Performs needed actions after a slide transition
782
+ */
783
+ var updateAfterSlideTransition = function(){
784
+ // if infinte loop is true
785
+ if(slider.settings.infiniteLoop){
786
+ var position = '';
787
+ // first slide
788
+ if(slider.active.index == 0){
789
+ // set the new position
790
+ position = slider.children.eq(0).position();
791
+ // carousel, last slide
792
+ }else if(slider.active.index == getPagerQty() - 1 && slider.carousel){
793
+ position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
794
+ // last slide
795
+ }else if(slider.active.index == slider.children.length - 1){
796
+ position = slider.children.eq(slider.children.length - 1).position();
797
+ }
798
+ if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0);; }
799
+ else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0);; }
800
+ }
801
+ // declare that the transition is complete
802
+ slider.working = false;
803
+ // onSlideAfter callback
804
+ slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
805
+ }
806
+
807
+ /**
808
+ * Updates the auto controls state (either active, or combined switch)
809
+ *
810
+ * @param state (string) "start", "stop"
811
+ * - the new state of the auto show
812
+ */
813
+ var updateAutoControls = function(state){
814
+ // if autoControlsCombine is true, replace the current control with the new state
815
+ if(slider.settings.autoControlsCombine){
816
+ slider.controls.autoEl.html(slider.controls[state]);
817
+ // if autoControlsCombine is false, apply the "active" class to the appropriate control
818
+ }else{
819
+ slider.controls.autoEl.find('a').removeClass('active');
820
+ slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
821
+ }
822
+ }
823
+
824
+ /**
825
+ * Updates the direction controls (checks if either should be hidden)
826
+ */
827
+ var updateDirectionControls = function(){
828
+ if(getPagerQty() == 1){
829
+ slider.controls.prev.addClass('disabled');
830
+ slider.controls.next.addClass('disabled');
831
+ }else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
832
+ // if first slide
833
+ if (slider.active.index == 0){
834
+ slider.controls.prev.addClass('disabled');
835
+ slider.controls.next.removeClass('disabled');
836
+ // if last slide
837
+ }else if(slider.active.index == getPagerQty() - 1){
838
+ slider.controls.next.addClass('disabled');
839
+ slider.controls.prev.removeClass('disabled');
840
+ // if any slide in the middle
841
+ }else{
842
+ slider.controls.prev.removeClass('disabled');
843
+ slider.controls.next.removeClass('disabled');
844
+ }
845
+ }
846
+ }
847
+
848
+ /**
849
+ * Initialzes the auto process
850
+ */
851
+ var initAuto = function(){
852
+ // if autoDelay was supplied, launch the auto show using a setTimeout() call
853
+ if(slider.settings.autoDelay > 0){
854
+ var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
855
+ // if autoDelay was not supplied, start the auto show normally
856
+ }else{
857
+ el.startAuto();
858
+ }
859
+ // if autoHover is requested
860
+ if(slider.settings.autoHover){
861
+ // on el hover
862
+ el.hover(function(){
863
+ // if the auto show is currently playing (has an active interval)
864
+ if(slider.interval){
865
+ // stop the auto show and pass true agument which will prevent control update
866
+ el.stopAuto(true);
867
+ // create a new autoPaused value which will be used by the relative "mouseout" event
868
+ slider.autoPaused = true;
869
+ }
870
+ }, function(){
871
+ // if the autoPaused value was created be the prior "mouseover" event
872
+ if(slider.autoPaused){
873
+ // start the auto show and pass true agument which will prevent control update
874
+ el.startAuto(true);
875
+ // reset the autoPaused value
876
+ slider.autoPaused = null;
877
+ }
878
+ });
879
+ }
880
+ }
881
+
882
+ /**
883
+ * Initialzes the ticker process
884
+ */
885
+ var initTicker = function(){
886
+ var startPosition = 0;
887
+ // if autoDirection is "next", append a clone of the entire slider
888
+ if(slider.settings.autoDirection == 'next'){
889
+ el.append(slider.children.clone().addClass('bx-clone'));
890
+ // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
891
+ }else{
892
+ el.prepend(slider.children.clone().addClass('bx-clone'));
893
+ var position = slider.children.first().position();
894
+ startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
895
+ }
896
+ setPositionProperty(startPosition, 'reset', 0);
897
+ // do not allow controls in ticker mode
898
+ slider.settings.pager = false;
899
+ slider.settings.controls = false;
900
+ slider.settings.autoControls = false;
901
+ // if autoHover is requested
902
+ if(slider.settings.tickerHover && !slider.usingCSS){
903
+ // on el hover
904
+ slider.viewport.hover(function(){
905
+ el.stop();
906
+ }, function(){
907
+ // calculate the total width of children (used to calculate the speed ratio)
908
+ var totalDimens = 0;
909
+ slider.children.each(function(index){
910
+ totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
911
+ });
912
+ // calculate the speed ratio (used to determine the new speed to finish the paused animation)
913
+ var ratio = slider.settings.speed / totalDimens;
914
+ // determine which property to use
915
+ var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
916
+ // calculate the new speed
917
+ var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
918
+ tickerLoop(newSpeed);
919
+ });
920
+ }
921
+ // start the ticker loop
922
+ tickerLoop();
923
+ }
924
+
925
+ /**
926
+ * Runs a continuous loop, news ticker-style
927
+ */
928
+ var tickerLoop = function(resumeSpeed){
929
+ speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
930
+ var position = {left: 0, top: 0};
931
+ var reset = {left: 0, top: 0};
932
+ // if "next" animate left position to last child, then reset left to 0
933
+ if(slider.settings.autoDirection == 'next'){
934
+ position = el.find('.bx-clone').first().position();
935
+ // if "prev" animate left position to 0, then reset left to first non-clone child
936
+ }else{
937
+ reset = slider.children.first().position();
938
+ }
939
+ var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
940
+ var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
941
+ var params = {resetValue: resetValue};
942
+ setPositionProperty(animateProperty, 'ticker', speed, params);
943
+ }
944
+
945
+ /**
946
+ * Initializes touch events
947
+ */
948
+ var initTouch = function(){
949
+ // initialize object to contain all touch values
950
+ slider.touch = {
951
+ start: {x: 0, y: 0},
952
+ end: {x: 0, y: 0}
953
+ }
954
+ slider.viewport.bind('touchstart', onTouchStart);
955
+ }
956
+
957
+ /**
958
+ * Event handler for "touchstart"
959
+ *
960
+ * @param e (event)
961
+ * - DOM event object
962
+ */
963
+ var onTouchStart = function(e){
964
+ if(slider.working){
965
+ e.preventDefault();
966
+ }else{
967
+ // record the original position when touch starts
968
+ slider.touch.originalPos = el.position();
969
+ var orig = e.originalEvent;
970
+ // record the starting touch x, y coordinates
971
+ slider.touch.start.x = orig.changedTouches[0].pageX;
972
+ slider.touch.start.y = orig.changedTouches[0].pageY;
973
+ // bind a "touchmove" event to the viewport
974
+ slider.viewport.bind('touchmove', onTouchMove);
975
+ // bind a "touchend" event to the viewport
976
+ slider.viewport.bind('touchend', onTouchEnd);
977
+ }
978
+ }
979
+
980
+ /**
981
+ * Event handler for "touchmove"
982
+ *
983
+ * @param e (event)
984
+ * - DOM event object
985
+ */
986
+ var onTouchMove = function(e){
987
+ var orig = e.originalEvent;
988
+ // if scrolling on y axis, do not prevent default
989
+ var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
990
+ var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
991
+ // x axis swipe
992
+ if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
993
+ e.preventDefault();
994
+ // y axis swipe
995
+ }else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
996
+ e.preventDefault();
997
+ }
998
+ if(slider.settings.mode != 'fade' && slider.settings.oneToOneTouch){
999
+ var value = 0;
1000
+ // if horizontal, drag along x axis
1001
+ if(slider.settings.mode == 'horizontal'){
1002
+ var change = orig.changedTouches[0].pageX - slider.touch.start.x;
1003
+ value = slider.touch.originalPos.left + change;
1004
+ // if vertical, drag along y axis
1005
+ }else{
1006
+ var change = orig.changedTouches[0].pageY - slider.touch.start.y;
1007
+ value = slider.touch.originalPos.top + change;
1008
+ }
1009
+ setPositionProperty(value, 'reset', 0);
1010
+ }
1011
+ }
1012
+
1013
+ /**
1014
+ * Event handler for "touchend"
1015
+ *
1016
+ * @param e (event)
1017
+ * - DOM event object
1018
+ */
1019
+ var onTouchEnd = function(e){
1020
+ slider.viewport.unbind('touchmove', onTouchMove);
1021
+ var orig = e.originalEvent;
1022
+ var value = 0;
1023
+ // record end x, y positions
1024
+ slider.touch.end.x = orig.changedTouches[0].pageX;
1025
+ slider.touch.end.y = orig.changedTouches[0].pageY;
1026
+ // if fade mode, check if absolute x distance clears the threshold
1027
+ if(slider.settings.mode == 'fade'){
1028
+ var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1029
+ if(distance >= slider.settings.swipeThreshold){
1030
+ slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
1031
+ el.stopAuto();
1032
+ }
1033
+ // not fade mode
1034
+ }else{
1035
+ var distance = 0;
1036
+ // calculate distance and el's animate property
1037
+ if(slider.settings.mode == 'horizontal'){
1038
+ distance = slider.touch.end.x - slider.touch.start.x;
1039
+ value = slider.touch.originalPos.left;
1040
+ }else{
1041
+ distance = slider.touch.end.y - slider.touch.start.y;
1042
+ value = slider.touch.originalPos.top;
1043
+ }
1044
+ // if not infinite loop and first / last slide, do not attempt a slide transition
1045
+ if(!slider.settings.infiniteLoop && ((slider.active.index == 0 && distance > 0) || (slider.active.last && distance < 0))){
1046
+ setPositionProperty(value, 'reset', 200);
1047
+ }else{
1048
+ // check if distance clears threshold
1049
+ if(Math.abs(distance) >= slider.settings.swipeThreshold){
1050
+ distance < 0 ? el.goToNextSlide() : el.goToPrevSlide();
1051
+ el.stopAuto();
1052
+ }else{
1053
+ // el.animate(property, 200);
1054
+ setPositionProperty(value, 'reset', 200);
1055
+ }
1056
+ }
1057
+ }
1058
+ slider.viewport.unbind('touchend', onTouchEnd);
1059
+ }
1060
+
1061
+ /**
1062
+ * Window resize event callback
1063
+ */
1064
+ var resizeWindow = function(e){
1065
+ // get the new window dimens (again, thank you IE)
1066
+ var windowWidthNew = $(window).width();
1067
+ var windowHeightNew = $(window).height();
1068
+ // make sure that it is a true window resize
1069
+ // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
1070
+ // are resized. Can you just die already?*
1071
+ if(windowWidth != windowWidthNew || windowHeight != windowHeightNew){
1072
+ // set the new window dimens
1073
+ windowWidth = windowWidthNew;
1074
+ windowHeight = windowHeightNew;
1075
+ // update all dynamic elements
1076
+ el.redrawSlider();
1077
+ }
1078
+ }
1079
+
1080
+ /**
1081
+ * ===================================================================================
1082
+ * = PUBLIC FUNCTIONS
1083
+ * ===================================================================================
1084
+ */
1085
+
1086
+ /**
1087
+ * Performs slide transition to the specified slide
1088
+ *
1089
+ * @param slideIndex (int)
1090
+ * - the destination slide's index (zero-based)
1091
+ *
1092
+ * @param direction (string)
1093
+ * - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1094
+ */
1095
+ el.goToSlide = function(slideIndex, direction){
1096
+ // if plugin is currently in motion, ignore request
1097
+ if(slider.working || slider.active.index == slideIndex) return;
1098
+ // declare that plugin is in motion
1099
+ slider.working = true;
1100
+ // store the old index
1101
+ slider.oldIndex = slider.active.index;
1102
+ // if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
1103
+ if(slideIndex < 0){
1104
+ slider.active.index = getPagerQty() - 1;
1105
+ // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
1106
+ }else if(slideIndex >= getPagerQty()){
1107
+ slider.active.index = 0;
1108
+ // set active index to requested slide
1109
+ }else{
1110
+ slider.active.index = slideIndex;
1111
+ }
1112
+ // onSlideBefore, onSlideNext, onSlidePrev callbacks
1113
+ slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1114
+ if(direction == 'next'){
1115
+ slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1116
+ }else if(direction == 'prev'){
1117
+ slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1118
+ }
1119
+ // check if last slide
1120
+ slider.active.last = slider.active.index >= getPagerQty() - 1;
1121
+ // update the pager with active class
1122
+ if(slider.settings.pager) updatePagerActive(slider.active.index);
1123
+ // // check for direction control update
1124
+ if(slider.settings.controls) updateDirectionControls();
1125
+ // if slider is set to mode: "fade"
1126
+ if(slider.settings.mode == 'fade'){
1127
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1128
+ if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
1129
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1130
+ }
1131
+ // fade out the visible child and reset its z-index value
1132
+ slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0});
1133
+ // fade in the newly requested slide
1134
+ slider.children.eq(slider.active.index).css('zIndex', 51).fadeIn(slider.settings.speed, function(){
1135
+ $(this).css('zIndex', 50);
1136
+ updateAfterSlideTransition();
1137
+ });
1138
+ // slider mode is not "fade"
1139
+ }else{
1140
+ // if adaptiveHeight is true and next height is different from current height, animate to the new height
1141
+ if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
1142
+ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
1143
+ }
1144
+ var moveBy = 0;
1145
+ var position = {left: 0, top: 0};
1146
+ // if carousel and not infinite loop
1147
+ if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
1148
+ if(slider.settings.mode == 'horizontal'){
1149
+ // get the last child position
1150
+ var lastChild = slider.children.eq(slider.children.length - 1);
1151
+ position = lastChild.position();
1152
+ // calculate the position of the last slide
1153
+ moveBy = slider.viewport.width() - lastChild.outerWidth();
1154
+ }else{
1155
+ // get last showing index position
1156
+ var lastShowingIndex = slider.children.length - slider.settings.minSlides;
1157
+ position = slider.children.eq(lastShowingIndex).position();
1158
+ }
1159
+ // horizontal carousel, going previous while on first slide (infiniteLoop mode)
1160
+ }else if(slider.carousel && slider.active.last && direction == 'prev'){
1161
+ // get the last child position
1162
+ var eq = slider.settings.moveSlides == 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
1163
+ var lastChild = el.children('.bx-clone').eq(eq);
1164
+ position = lastChild.position();
1165
+ // if infinite loop and "Next" is clicked on the last slide
1166
+ }else if(direction == 'next' && slider.active.index == 0){
1167
+ // get the last clone position
1168
+ position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
1169
+ slider.active.last = false;
1170
+ // normal non-zero requests
1171
+ }else if(slideIndex >= 0){
1172
+ var requestEl = slideIndex * getMoveBy();
1173
+ position = slider.children.eq(requestEl).position();
1174
+ }
1175
+
1176
+ /* If the position doesn't exist
1177
+ * (e.g. if you destroy the slider on a next click),
1178
+ * it doesn't throw an error.
1179
+ */
1180
+ if ("undefined" !== typeof(position)) {
1181
+ var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
1182
+ // plugin values to be animated
1183
+ setPositionProperty(value, 'slide', slider.settings.speed);
1184
+ }
1185
+ }
1186
+ }
1187
+
1188
+ /**
1189
+ * Transitions to the next slide in the show
1190
+ */
1191
+ el.goToNextSlide = function(){
1192
+ // if infiniteLoop is false and last page is showing, disregard call
1193
+ if (!slider.settings.infiniteLoop && slider.active.last) return;
1194
+ var pagerIndex = parseInt(slider.active.index) + 1;
1195
+ el.goToSlide(pagerIndex, 'next');
1196
+ }
1197
+
1198
+ /**
1199
+ * Transitions to the prev slide in the show
1200
+ */
1201
+ el.goToPrevSlide = function(){
1202
+ // if infiniteLoop is false and last page is showing, disregard call
1203
+ if (!slider.settings.infiniteLoop && slider.active.index == 0) return;
1204
+ var pagerIndex = parseInt(slider.active.index) - 1;
1205
+ el.goToSlide(pagerIndex, 'prev');
1206
+ }
1207
+
1208
+ /**
1209
+ * Starts the auto show
1210
+ *
1211
+ * @param preventControlUpdate (boolean)
1212
+ * - if true, auto controls state will not be updated
1213
+ */
1214
+ el.startAuto = function(preventControlUpdate){
1215
+ // if an interval already exists, disregard call
1216
+ if(slider.interval) return;
1217
+ // create an interval
1218
+ slider.interval = setInterval(function(){
1219
+ slider.settings.autoDirection == 'next' ? el.goToNextSlide() : el.goToPrevSlide();
1220
+ }, slider.settings.pause);
1221
+ // if auto controls are displayed and preventControlUpdate is not true
1222
+ if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('stop');
1223
+ }
1224
+
1225
+ /**
1226
+ * Stops the auto show
1227
+ *
1228
+ * @param preventControlUpdate (boolean)
1229
+ * - if true, auto controls state will not be updated
1230
+ */
1231
+ el.stopAuto = function(preventControlUpdate){
1232
+ // if no interval exists, disregard call
1233
+ if(!slider.interval) return;
1234
+ // clear the interval
1235
+ clearInterval(slider.interval);
1236
+ slider.interval = null;
1237
+ // if auto controls are displayed and preventControlUpdate is not true
1238
+ if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('start');
1239
+ }
1240
+
1241
+ /**
1242
+ * Returns current slide index (zero-based)
1243
+ */
1244
+ el.getCurrentSlide = function(){
1245
+ return slider.active.index;
1246
+ }
1247
+
1248
+ /**
1249
+ * Returns number of slides in show
1250
+ */
1251
+ el.getSlideCount = function(){
1252
+ return slider.children.length;
1253
+ }
1254
+
1255
+ /**
1256
+ * Update all dynamic slider elements
1257
+ */
1258
+ el.redrawSlider = function(){
1259
+ // resize all children in ratio to new screen size
1260
+ slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth());
1261
+ // adjust the height
1262
+ slider.viewport.css('height', getViewportHeight());
1263
+ // update the slide position
1264
+ if(!slider.settings.ticker) setSlidePosition();
1265
+ // if active.last was true before the screen resize, we want
1266
+ // to keep it last no matter what screen size we end on
1267
+ if (slider.active.last) slider.active.index = getPagerQty() - 1;
1268
+ // if the active index (page) no longer exists due to the resize, simply set the index as last
1269
+ if (slider.active.index >= getPagerQty()) slider.active.last = true;
1270
+ // if a pager is being displayed and a custom pager is not being used, update it
1271
+ if(slider.settings.pager && !slider.settings.pagerCustom){
1272
+ populatePager();
1273
+ updatePagerActive(slider.active.index);
1274
+ }
1275
+ }
1276
+
1277
+ /**
1278
+ * Destroy the current instance of the slider (revert everything back to original state)
1279
+ */
1280
+ el.destroySlider = function(){
1281
+ // don't do anything if slider has already been destroyed
1282
+ if(!slider.initialized) return;
1283
+ slider.initialized = false;
1284
+ $('.bx-clone', this).remove();
1285
+ slider.children.each(function() {
1286
+ $(this).data("origStyle") != undefined ? $(this).attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
1287
+ });
1288
+ $(this).data("origStyle") != undefined ? this.attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
1289
+ $(this).unwrap().unwrap();
1290
+ if(slider.controls.el) slider.controls.el.remove();
1291
+ if(slider.controls.next) slider.controls.next.remove();
1292
+ if(slider.controls.prev) slider.controls.prev.remove();
1293
+ if(slider.pagerEl) slider.pagerEl.remove();
1294
+ $('.bx-caption', this).remove();
1295
+ if(slider.controls.autoEl) slider.controls.autoEl.remove();
1296
+ clearInterval(slider.interval);
1297
+ if(slider.settings.responsive) $(window).unbind('resize', resizeWindow);
1298
+ }
1299
+
1300
+ /**
1301
+ * Reload the slider (revert all DOM changes, and re-initialize)
1302
+ */
1303
+ el.reloadSlider = function(settings){
1304
+ if (settings != undefined) options = settings;
1305
+ el.destroySlider();
1306
+ init();
1307
+ }
1308
+
1309
+ init();
1310
+
1311
+ // returns the current jQuery object
1312
+ return this;
1313
+ }
1314
+
1315
+ })(jQuery);
third-party/jquery.bxslider/jquery.bxslider.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * BxSlider v4.1.1 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Copyright 2013, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
+ * Written while drinking Belgian ales and listening to jazz
7
+ *
8
+ * Released under the MIT license - http://opensource.org/licenses/MIT
9
+ */
10
+ !function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length<o.settings.minSlides&&(o.settings.minSlides=o.children.length),o.children.length<o.settings.maxSlides&&(o.settings.maxSlides=o.children.length),o.settings.randomStart&&(o.settings.startSlide=Math.floor(Math.random()*o.children.length)),o.active={index:o.settings.startSlide},o.carousel=o.settings.minSlides>1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>'),o.viewport=r.parent(),o.loader=t('<div class="bx-loading" />'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:v()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:50,display:"block"})),o.controls.el=t('<div class="bx-controls" />'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(p()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",B),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&I(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},p=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},v=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e<o.minThreshold&&(t=(e-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),t},f=function(){var t=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()<o.minThreshold)t=o.settings.minSlides;else if(o.viewport.width()>o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<o.children.length;)++t,e=i+f(),i+=o.settings.moveSlides<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+s+'" class="bx-pager-link">'+n+"</a></div>"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('<div class="bx-pager" />'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.delegate("a","click",q)},C=function(){o.controls.next=t('<a class="bx-next" href="">'+o.settings.nextText+"</a>"),o.controls.prev=t('<a class="bx-prev" href="">'+o.settings.prevText+"</a>"),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('<div class="bx-controls-direction" />'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+o.settings.startText+"</a></div>"),o.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+o.settings.stopText+"</a></div>"),o.controls.autoEl=t('<div class="bx-controls-auto" />'),o.controls.autoEl.delegate(".bx-start","click",k),o.controls.autoEl.delegate(".bx-stop","click",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('<div class="bx-caption"><span>'+e+"</span></div>")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},q=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},I=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),"horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0)}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},B=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider())};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&I(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",51).fadeIn(o.settings.speed,function(){t(this).css("zIndex",50),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=p()&&o.viewport.animate({height:p()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",p()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),I(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",B))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
third-party/jquery.bxslider/plugins/jquery.easing.1.3.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ // t: current time, b: begInnIng value, c: change In value, d: duration
39
+ jQuery.easing['jswing'] = jQuery.easing['swing'];
40
+
41
+ jQuery.extend( jQuery.easing,
42
+ {
43
+ def: 'easeOutQuad',
44
+ swing: function (x, t, b, c, d) {
45
+ //alert(jQuery.easing.default);
46
+ return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47
+ },
48
+ easeInQuad: function (x, t, b, c, d) {
49
+ return c*(t/=d)*t + b;
50
+ },
51
+ easeOutQuad: function (x, t, b, c, d) {
52
+ return -c *(t/=d)*(t-2) + b;
53
+ },
54
+ easeInOutQuad: function (x, t, b, c, d) {
55
+ if ((t/=d/2) < 1) return c/2*t*t + b;
56
+ return -c/2 * ((--t)*(t-2) - 1) + b;
57
+ },
58
+ easeInCubic: function (x, t, b, c, d) {
59
+ return c*(t/=d)*t*t + b;
60
+ },
61
+ easeOutCubic: function (x, t, b, c, d) {
62
+ return c*((t=t/d-1)*t*t + 1) + b;
63
+ },
64
+ easeInOutCubic: function (x, t, b, c, d) {
65
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
66
+ return c/2*((t-=2)*t*t + 2) + b;
67
+ },
68
+ easeInQuart: function (x, t, b, c, d) {
69
+ return c*(t/=d)*t*t*t + b;
70
+ },
71
+ easeOutQuart: function (x, t, b, c, d) {
72
+ return -c * ((t=t/d-1)*t*t*t - 1) + b;
73
+ },
74
+ easeInOutQuart: function (x, t, b, c, d) {
75
+ if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
76
+ return -c/2 * ((t-=2)*t*t*t - 2) + b;
77
+ },
78
+ easeInQuint: function (x, t, b, c, d) {
79
+ return c*(t/=d)*t*t*t*t + b;
80
+ },
81
+ easeOutQuint: function (x, t, b, c, d) {
82
+ return c*((t=t/d-1)*t*t*t*t + 1) + b;
83
+ },
84
+ easeInOutQuint: function (x, t, b, c, d) {
85
+ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
86
+ return c/2*((t-=2)*t*t*t*t + 2) + b;
87
+ },
88
+ easeInSine: function (x, t, b, c, d) {
89
+ return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
90
+ },
91
+ easeOutSine: function (x, t, b, c, d) {
92
+ return c * Math.sin(t/d * (Math.PI/2)) + b;
93
+ },
94
+ easeInOutSine: function (x, t, b, c, d) {
95
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
96
+ },
97
+ easeInExpo: function (x, t, b, c, d) {
98
+ return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
99
+ },
100
+ easeOutExpo: function (x, t, b, c, d) {
101
+ return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
102
+ },
103
+ easeInOutExpo: function (x, t, b, c, d) {
104
+ if (t==0) return b;
105
+ if (t==d) return b+c;
106
+ if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
107
+ return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
108
+ },
109
+ easeInCirc: function (x, t, b, c, d) {
110
+ return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
111
+ },
112
+ easeOutCirc: function (x, t, b, c, d) {
113
+ return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
114
+ },
115
+ easeInOutCirc: function (x, t, b, c, d) {
116
+ if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
117
+ return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
118
+ },
119
+ easeInElastic: function (x, t, b, c, d) {
120
+ var s=1.70158;var p=0;var a=c;
121
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
122
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
123
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
124
+ return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
125
+ },
126
+ easeOutElastic: function (x, t, b, c, d) {
127
+ var s=1.70158;var p=0;var a=c;
128
+ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
129
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
130
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
131
+ return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
132
+ },
133
+ easeInOutElastic: function (x, t, b, c, d) {
134
+ var s=1.70158;var p=0;var a=c;
135
+ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
136
+ if (a < Math.abs(c)) { a=c; var s=p/4; }
137
+ else var s = p/(2*Math.PI) * Math.asin (c/a);
138
+ if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
139
+ return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
140
+ },
141
+ easeInBack: function (x, t, b, c, d, s) {
142
+ if (s == undefined) s = 1.70158;
143
+ return c*(t/=d)*t*((s+1)*t - s) + b;
144
+ },
145
+ easeOutBack: function (x, t, b, c, d, s) {
146
+ if (s == undefined) s = 1.70158;
147
+ return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
148
+ },
149
+ easeInOutBack: function (x, t, b, c, d, s) {
150
+ if (s == undefined) s = 1.70158;
151
+ if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
152
+ return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
153
+ },
154
+ easeInBounce: function (x, t, b, c, d) {
155
+ return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
156
+ },
157
+ easeOutBounce: function (x, t, b, c, d) {
158
+ if ((t/=d) < (1/2.75)) {
159
+ return c*(7.5625*t*t) + b;
160
+ } else if (t < (2/2.75)) {
161
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
162
+ } else if (t < (2.5/2.75)) {
163
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
164
+ } else {
165
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
166
+ }
167
+ },
168
+ easeInOutBounce: function (x, t, b, c, d) {
169
+ if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
170
+ return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
171
+ }
172
+ });
173
+
174
+ /*
175
+ *
176
+ * TERMS OF USE - EASING EQUATIONS
177
+ *
178
+ * Open source under the BSD License.
179
+ *
180
+ * Copyright © 2001 Robert Penner
181
+ * All rights reserved.
182
+ *
183
+ * Redistribution and use in source and binary forms, with or without modification,
184
+ * are permitted provided that the following conditions are met:
185
+ *
186
+ * Redistributions of source code must retain the above copyright notice, this list of
187
+ * conditions and the following disclaimer.
188
+ * Redistributions in binary form must reproduce the above copyright notice, this list
189
+ * of conditions and the following disclaimer in the documentation and/or other materials
190
+ * provided with the distribution.
191
+ *
192
+ * Neither the name of the author nor the names of contributors may be used to endorse
193
+ * or promote products derived from this software without specific prior written permission.
194
+ *
195
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
196
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
197
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
198
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
199
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
200
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
201
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
202
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
203
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
204
+ *
205
+ */
third-party/jquery.bxslider/plugins/jquery.fitvids.js ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*global jQuery */
2
+ /*jshint multistr:true browser:true */
3
+ /*!
4
+ * FitVids 1.0
5
+ *
6
+ * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
+ * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
+ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
+ *
10
+ * Date: Thu Sept 01 18:00:00 2011 -0500
11
+ */
12
+
13
+ (function( $ ){
14
+
15
+ "use strict";
16
+
17
+ $.fn.fitVids = function( options ) {
18
+ var settings = {
19
+ customSelector: null
20
+ };
21
+
22
+ var div = document.createElement('div'),
23
+ ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];
24
+
25
+ div.className = 'fit-vids-style';
26
+ div.innerHTML = '&shy;<style> \
27
+ .fluid-width-video-wrapper { \
28
+ width: 100%; \
29
+ position: relative; \
30
+ padding: 0; \
31
+ } \
32
+ \
33
+ .fluid-width-video-wrapper iframe, \
34
+ .fluid-width-video-wrapper object, \
35
+ .fluid-width-video-wrapper embed { \
36
+ position: absolute; \
37
+ top: 0; \
38
+ left: 0; \
39
+ width: 100%; \
40
+ height: 100%; \
41
+ } \
42
+ </style>';
43
+
44
+ ref.parentNode.insertBefore(div,ref);
45
+
46
+ if ( options ) {
47
+ $.extend( settings, options );
48
+ }
49
+
50
+ return this.each(function(){
51
+ var selectors = [
52
+ "iframe[src*='player.vimeo.com']",
53
+ "iframe[src*='www.youtube.com']",
54
+ "iframe[src*='www.kickstarter.com']",
55
+ "object",
56
+ "embed"
57
+ ];
58
+
59
+ if (settings.customSelector) {
60
+ selectors.push(settings.customSelector);
61
+ }
62
+
63
+ var $allVideos = $(this).find(selectors.join(','));
64
+
65
+ $allVideos.each(function(){
66
+ var $this = $(this);
67
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
68
+ var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
69
+ width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
70
+ aspectRatio = height / width;
71
+ if(!$this.attr('id')){
72
+ var videoID = 'fitvid' + Math.floor(Math.random()*999999);
73
+ $this.attr('id', videoID);
74
+ }
75
+ $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
76
+ $this.removeAttr('height').removeAttr('width');
77
+ });
78
+ });
79
+ };
80
+ })( jQuery );
third-party/jquery.bxslider/readme.md ADDED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #bxSlider 4.1.1
2
+ ##The fully-loaded, responsive jQuery content slider
3
+
4
+ ###Why should I use this slider?
5
+ * Fully responsive - will adapt to any device
6
+ * Horizontal, vertical, and fade modes
7
+ * Slides can contain images, video, or HTML content
8
+ * Full callback API and public methods
9
+ * Small file size, fully themed, simple to implement
10
+ * Browser support: Firefox, Chrome, Safari, iOS, Android, IE7+
11
+ * Tons of configuration options
12
+
13
+ For complete documentation, tons of examples, and a good time, visit:
14
+
15
+ [http://bxslider.com](http://bxslider.com)
16
+
17
+ Written by: Steven Wanderski - [http://stevenwanderski.com](http://stevenwanderski.com)
18
+
19
+ ###License
20
+ Released under the MIT license - http://opensource.org/licenses/MIT
21
+
22
+ Let's get on with it!
23
+
24
+ ##Installation
25
+
26
+ ###Step 1: Link required files
27
+
28
+ First and most important, the jQuery library needs to be included (no need to download - link directly from Google). Next, download the package from this site and link the bxSlider CSS file (for the theme) and the bxSlider Javascript file.
29
+
30
+ ```html
31
+ <!-- jQuery library (served from Google) -->
32
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
33
+ <!-- bxSlider Javascript file -->
34
+ <script src="/js/jquery.bxslider.min.js"></script>
35
+ <!-- bxSlider CSS file -->
36
+ <link href="/lib/jquery.bxslider.css" rel="stylesheet" />
37
+ ```
38
+
39
+ ###Step 2: Create HTML markup
40
+
41
+ Create a `<ul class="bxslider">` element, with a `<li>` for each slide. Slides can contain images, video, or any other HTML content!
42
+
43
+ ```html
44
+ <ul class="bxslider">
45
+ <li><img src="/images/pic1.jpg" /></li>
46
+ <li><img src="/images/pic2.jpg" /></li>
47
+ <li><img src="/images/pic3.jpg" /></li>
48
+ <li><img src="/images/pic4.jpg" /></li>
49
+ </ul>
50
+ ```
51
+
52
+ ###Step 3: Call the bxSlider
53
+
54
+ Call .bxslider() on `<ul class="bxslider">`. Note that the call must be made inside of a $(document).ready() call, or the plugin will not work!
55
+
56
+ ```javascript
57
+ $(document).ready(function(){
58
+ $('.bxslider').bxSlider();
59
+ });
60
+ ```
61
+
62
+ ##Configuration options
63
+
64
+ ###General
65
+
66
+ **mode**
67
+ Type of transition between slides
68
+ ```
69
+ default: 'horizontal'
70
+ options: 'horizontal', 'vertical', 'fade'
71
+ ```
72
+
73
+ **speed**
74
+ Slide transition duration (in ms)
75
+ ```
76
+ default: 500
77
+ options: integer
78
+ ```
79
+
80
+ **slideMargin**
81
+ Margin between each slide
82
+ ```
83
+ default: 0
84
+ options: integer
85
+ ```
86
+
87
+ **startSlide**
88
+ Starting slide index (zero-based)
89
+ ```
90
+ default: 0
91
+ options: integer
92
+ ```
93
+
94
+ **randomStart**
95
+ Start slider on a random slide
96
+ ```
97
+ default: false
98
+ options: boolean (true / false)
99
+ ```
100
+
101
+ **slideSelector**
102
+ Element to use as slides (ex. <code>'div.slide'</code>).<br />Note: by default, bxSlider will use all immediate children of the slider element
103
+ ```
104
+ default: ''
105
+ options: jQuery selector
106
+ ```
107
+
108
+ **infiniteLoop**
109
+ If <code>true</code>, clicking "Next" while on the last slide will transition to the first slide and vice-versa
110
+ ```
111
+ default: true
112
+ options: boolean (true / false)
113
+ ```
114
+
115
+ **hideControlOnEnd**
116
+ If <code>true</code>, "Prev" and "Next" controls will receive a class <code>disabled</code> when slide is the first or the last<br/>Note: Only used when <code>infiniteLoop: false</code>
117
+ ```
118
+ default: false
119
+ options: boolean (true / false)
120
+ ```
121
+
122
+ **easing**
123
+ The type of "easing" to use during transitions. If using CSS transitions, include a value for the <code>transition-timing-function</code> property. If not using CSS transitions, you may include <code>plugins/jquery.easing.1.3.js</code> for many options.<br />See <a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">http://gsgd.co.uk/sandbox/jquery/easing/</a> for more info.
124
+ ```
125
+ default: null
126
+ options: if using CSS: 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'cubic-bezier(n,n,n,n)'. If not using CSS: 'swing', 'linear' (see the above file for more options)
127
+ ```
128
+
129
+ **captions**
130
+ Include image captions. Captions are derived from the image's <code>title</code> attribute
131
+ ```
132
+ default: false
133
+ options: boolean (true / false)
134
+ ```
135
+
136
+ **ticker**
137
+ Use slider in ticker mode (similar to a news ticker)
138
+ ```
139
+ default: false
140
+ options: boolean (true / false)
141
+ ```
142
+
143
+ **tickerHover**
144
+ Ticker will pause when mouse hovers over slider. Note: this functionality does NOT work if using CSS transitions!
145
+ ```
146
+ default: false
147
+ options: boolean (true / false)
148
+ ```
149
+
150
+ **adaptiveHeight**
151
+ Dynamically adjust slider height based on each slide's height
152
+ ```
153
+ default: false
154
+ options: boolean (true / false)
155
+ ```
156
+
157
+ **adaptiveHeightSpeed**
158
+ Slide height transition duration (in ms). Note: only used if <code>adaptiveHeight: true</code>
159
+ ```
160
+ default: 500
161
+ options: integer
162
+ ```
163
+
164
+ **video**
165
+ If any slides contain video, set this to <code>true</code>. Also, include <code>plugins/jquery.fitvids.js</code><br />See <a href="http://fitvidsjs.com/" target="_blank">http://fitvidsjs.com/</a> for more info
166
+ ```
167
+ default: false
168
+ options: boolean (true / false)
169
+ ```
170
+
171
+ **responsive**
172
+ Enable or disable auto resize of the slider. Useful if you need to use fixed width sliders.
173
+ ```
174
+ default: true
175
+ options: boolean (true /false)
176
+ ```
177
+
178
+ **useCSS**
179
+ If true, CSS transitions will be used for horizontal and vertical slide animations (this uses native hardware acceleration). If false, jQuery animate() will be used.
180
+ ```
181
+ default: true
182
+ options: boolean (true / false)
183
+ ```
184
+
185
+ **preloadImages**
186
+ If 'all', preloads all images before starting the slider. If 'visible', preloads only images in the initially visible slides before starting the slider (tip: use 'visible' if all slides are identical dimensions)
187
+ ```
188
+ default: 'visible'
189
+ options: 'all', 'visible'
190
+ ```
191
+
192
+ **touchEnabled**
193
+ If <code>true</code>, slider will allow touch swipe transitions
194
+ ```
195
+ default: true
196
+ options: boolean (true / false)
197
+ ```
198
+
199
+ **swipeThreshold**
200
+ Amount of pixels a touch swipe needs to exceed in order to execute a slide transition. Note: only used if <code>touchEnabled: true</code>
201
+ ```
202
+ default: 50
203
+ options: integer
204
+ ```
205
+
206
+ **oneToOneTouch**
207
+ If <code>true</code>, non-fade slides follow the finger as it swipes
208
+ ```
209
+ default: true
210
+ options: boolean (true / false)
211
+ ```
212
+
213
+ **preventDefaultSwipeX**
214
+ If <code>true</code>, touch screen will not move along the x-axis as the finger swipes
215
+ ```
216
+ default: true
217
+ options: boolean (true / false)
218
+ ```
219
+
220
+ **preventDefaultSwipeY**
221
+ If <code>true</code>, touch screen will not move along the y-axis as the finger swipes
222
+ ```
223
+ default: false
224
+ options: boolean (true / false)
225
+ ```
226
+
227
+ ###Pager
228
+
229
+ **pager**
230
+ If <code>true</code>, a pager will be added
231
+ ```
232
+ default: true
233
+ options: boolean (true / false)
234
+ ```
235
+
236
+ **pagerType**
237
+ If <code>'full'</code>, a pager link will be generated for each slide. If <code>'short'</code>, a x / y pager will be used (ex. 1 / 5)
238
+ ```
239
+ default: 'full'
240
+ options: 'full', 'short'
241
+ ```
242
+
243
+ **pagerShortSeparator**
244
+ If <code>pagerType: 'short'</code>, pager will use this value as the separating character
245
+ ```
246
+ default: ' / '
247
+ options: string
248
+ ```
249
+
250
+ **pagerSelector**
251
+ Element used to populate the populate the pager. By default, the pager is appended to the bx-viewport
252
+ ```
253
+ default: ''
254
+ options: jQuery selector
255
+ ```
256
+
257
+ **pagerCustom**
258
+ Parent element to be used as the pager. Parent element must contain a <code>&lt;a data-slide-index="x"&gt;</code> element for each slide. See example <a href="/examples/thumbnail-method-1">here</a>. Not for use with dynamic carousels.
259
+ ```
260
+ default: null
261
+ options: jQuery selector
262
+ ```
263
+
264
+ **buildPager**
265
+ If supplied, function is called on every slide element, and the returned value is used as the pager item markup.<br />See <a href="http://bxslider.com/examples">examples</a> for detailed implementation
266
+ ```
267
+ default: null
268
+ options: function(slideIndex)
269
+ ```
270
+
271
+ ###Controls
272
+
273
+ **controls**
274
+ If <code>true</code>, "Next" / "Prev" controls will be added
275
+ ```
276
+ default: true
277
+ options: boolean (true / false)
278
+ ```
279
+
280
+ **nextText**
281
+ Text to be used for the "Next" control
282
+ ```
283
+ default: 'Next'
284
+ options: string
285
+ ```
286
+
287
+ **prevText**
288
+ Text to be used for the "Prev" control
289
+ ```
290
+ default: 'Prev'
291
+ options: string
292
+ ```
293
+
294
+ **nextSelector**
295
+ Element used to populate the "Next" control
296
+ ```
297
+ default: null
298
+ options: jQuery selector
299
+ ```
300
+
301
+ **prevSelector**
302
+ Element used to populate the "Prev" control
303
+ ```
304
+ default: null
305
+ options: jQuery selector
306
+ ```
307
+
308
+ **autoControls**
309
+ If <code>true</code>, "Start" / "Stop" controls will be added
310
+ ```
311
+ default: false
312
+ options: boolean (true / false)
313
+ ```
314
+
315
+ **startText**
316
+ Text to be used for the "Start" control
317
+ ```
318
+ default: 'Start'
319
+ options: string
320
+ ```
321
+
322
+ **stopText**
323
+ Text to be used for the "Stop" control
324
+ ```
325
+ default: 'Stop'
326
+ options: string
327
+ ```
328
+
329
+ **autoControlsCombine**
330
+ When slideshow is playing only "Stop" control is displayed and vice-versa
331
+ ```
332
+ default: false
333
+ options: boolean (true / false)
334
+ ```
335
+
336
+ **autoControlsSelector**
337
+ Element used to populate the auto controls
338
+ ```
339
+ default: null
340
+ options: jQuery selector
341
+ ```
342
+
343
+ ###Auto
344
+
345
+ **auto**
346
+ Slides will automatically transition
347
+ ```
348
+ default: false
349
+ options: boolean (true / false)
350
+ ```
351
+
352
+ **pause**
353
+ The amount of time (in ms) between each auto transition
354
+ ```
355
+ default: 4000
356
+ options: integer
357
+ ```
358
+
359
+ **autoStart**
360
+ Auto show starts playing on load. If <code>false</code>, slideshow will start when the "Start" control is clicked
361
+ ```
362
+ default: true
363
+ options: boolean (true / false)
364
+ ```
365
+
366
+ **autoDirection**
367
+ The direction of auto show slide transitions
368
+ ```
369
+ default: 'next'
370
+ options: 'next', 'prev'
371
+ ```
372
+
373
+ **autoHover**
374
+ Auto show will pause when mouse hovers over slider
375
+ ```
376
+ default: false
377
+ options: boolean (true / false)
378
+ ```
379
+
380
+ **autoDelay**
381
+ Time (in ms) auto show should wait before starting
382
+ ```
383
+ default: 0
384
+ options: integer
385
+ ```
386
+
387
+ ###Carousel
388
+
389
+ **minSlides**
390
+ The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size.
391
+ ```
392
+ default: 1
393
+ options: integer
394
+ ```
395
+
396
+ **maxSlides**
397
+ The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size.
398
+ ```
399
+ default: 1
400
+ options: integer
401
+ ```
402
+
403
+ **moveSlides**
404
+ The number of slides to move on transition. This value must be <code>>= minSlides</code>, and <code><= maxSlides</code>. If zero (default), the number of fully-visible slides will be used.
405
+ ```
406
+ default: 0
407
+ options: integer
408
+ ```
409
+
410
+ **slideWidth**
411
+ The width of each slide. This setting is required for all horizontal carousels!
412
+ ```
413
+ default: 0
414
+ options: integer
415
+ ```
416
+
417
+ ###Callbacks
418
+
419
+ **onSliderLoad**
420
+ Executes immediately after the slider is fully loaded
421
+ ```
422
+ default: function(){}
423
+ options: function(currentIndex){ // your code here }
424
+ arguments:
425
+ currentIndex: element index of the current slide
426
+ ```
427
+
428
+ **onSlideBefore**
429
+ Executes immediately before each slide transition.
430
+ ```
431
+ default: function(){}
432
+ options: function($slideElement, oldIndex, newIndex){ // your code here }
433
+ arguments:
434
+ $slideElement: jQuery element of the destination element
435
+ oldIndex: element index of the previous slide (before the transition)
436
+ newIndex: element index of the destination slide (after the transition)
437
+ ```
438
+
439
+ **onSlideAfter**
440
+ Executes immediately after each slide transition. Function argument is the current slide element (when transition completes).
441
+ ```
442
+ default: function(){}
443
+ options: function($slideElement, oldIndex, newIndex){ // your code here }
444
+ arguments:
445
+ $slideElement: jQuery element of the destination element
446
+ oldIndex: element index of the previous slide (before the transition)
447
+ newIndex: element index of the destination slide (after the transition)
448
+ ```
449
+
450
+ **onSlideNext**
451
+ Executes immediately before each "Next" slide transition. Function argument is the target (next) slide element.
452
+ ```
453
+ default: function(){}
454
+ options: function($slideElement, oldIndex, newIndex){ // your code here }
455
+ arguments:
456
+ $slideElement: jQuery element of the destination element
457
+ oldIndex: element index of the previous slide (before the transition)
458
+ newIndex: element index of the destination slide (after the transition)
459
+ ```
460
+
461
+ **onSlidePrev**
462
+ Executes immediately before each "Prev" slide transition. Function argument is the target (prev) slide element.
463
+ ```
464
+ default: function(){}
465
+ options: function($slideElement, oldIndex, newIndex){ // your code here }
466
+ arguments:
467
+ $slideElement: jQuery element of the destination element
468
+ oldIndex: element index of the previous slide (before the transition)
469
+ newIndex: element index of the destination slide (after the transition)
470
+ ```
471
+
472
+ ###Public methods
473
+
474
+ **goToSlide**
475
+ Performs a slide transition to the supplied slide index (zero-based)
476
+ ```
477
+ example:
478
+ slider = $('.bxslider').bxSlider();
479
+ slider.goToSlide(3);
480
+ ```
481
+
482
+ **goToNextSlide**
483
+ Performs a "Next" slide transition
484
+ ```
485
+ example:
486
+ slider = $('.bxslider').bxSlider();
487
+ slider.goToNextSlide();
488
+ ```
489
+
490
+ **goToPrevSlide**
491
+ Performs a "Prev" slide transition
492
+ ```
493
+ example:
494
+ slider = $('.bxslider').bxSlider();
495
+ slider.goToPrevSlide();
496
+ ```
497
+
498
+ **startAuto**
499
+ Starts the auto show. Provide an argument <code>false</code> to prevent the auto controls from being updated.
500
+ ```
501
+ example:
502
+ slider = $('.bxslider').bxSlider();
503
+ slider.startAuto();
504
+ ```
505
+
506
+ **stopAuto**
507
+ Stops the auto show. Provide an argument <code>false</code> to prevent the auto controls from being updated.
508
+ ```
509
+ example:
510
+ slider = $('.bxslider').bxSlider();
511
+ slider.stopAuto();
512
+ ```
513
+
514
+ **getCurrentSlide**
515
+ Returns the current active slide
516
+ ```
517
+ example:
518
+ slider = $('.bxslider').bxSlider();
519
+ var current = slider.getCurrentSlide();
520
+ ```
521
+
522
+ **getSlideCount**
523
+ Returns the total number of slides in the slider
524
+ ```
525
+ example:
526
+ slider = $('.bxslider').bxSlider();
527
+ var slideQty = slider.getSlideCount();
528
+ ```
529
+
530
+ **reloadSlider**
531
+ Reload the slider. Useful when adding slides on the fly. Accepts an optional settings object. <a href="/examples/reload-slider-settings">See here for an example.</a>
532
+ ```
533
+ example:
534
+ slider = $('.bxslider').bxSlider();
535
+ slider.reloadSlider();
536
+ ```
537
+
538
+ **destroySlider**
539
+ Destroy the slider. This reverts all slider elements back to their original state (before calling the slider).
540
+ ```
541
+ example:
542
+ slider = $('.bxslider').bxSlider();
543
+ slider.destroySlider();
544
+ ```
545
+
546
+ ## Changelog
547
+
548
+ ### Version 4.1.1
549
+ * Removed imagesLoaded library and added iframe preloading support
550
+ * Added responsive option - setting to false will prevent $(window).resize binding
551
+
552
+ ### Version 4.1
553
+ * Carousel mode (minSlides / maxSlides) was re-written to be more intuitive.
554
+ * SlideWidth now acts as it should (slides respect the width value).
555
+ * SlideWidth now properly parsed: accepts string ("600px") or integer (600).
556
+ * Slider now only needs to load visible slides (by default) in order to initialize which results in much faster loading. A "preloadImages" setting allows for configuration.
557
+
558
+
559
+ Long live Zep.
third-party/simple-page-ordering/simple-page-ordering.css ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wp-list-table .ui-sortable tr {
2
+ cursor: move;
3
+ }
4
+ .wp-list-table .spo-updating tr {
5
+ cursor: default;
6
+ }
7
+ .wp-list-table .ui-sortable-placeholder {
8
+ border: 0;
9
+ height: 51px;
10
+ background: #808080;
11
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
12
+ background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
13
+ background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
14
+ background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
15
+ background-image: linear-gradient(to top, #6d6d6d, #808080);
16
+ visibility: visible !important;
17
+ }
18
+ .wp-list-table .ui-sortable-helper {
19
+ background-color: #fff;
20
+ margin-left: -1px;
21
+ border: 1px solid #dfdfdf;
22
+ }
23
+ .wp-list-table .ui-sortable-helper th,
24
+ .wp-list-table .ui-sortable-helper td {
25
+ border-bottom-width: 0 !important;
26
+ }
27
+
28
+ .spo-updating-row .check-column {
29
+ background: url('../../../../../wp-admin/images/wpspin_light.gif') center no-repeat;
30
+ }
31
+ @media print,
32
+ (-o-min-device-pixel-ratio: 5/4),
33
+ (-webkit-min-device-pixel-ratio: 1.25),
34
+ (min-resolution: 120dpi) {
35
+ .spo-updating-row .check-column {
36
+ background-image: url('../../../../../wp-admin/images/wpspin_light-2x.gif');
37
+ background-size: 16px 16px;
38
+ }
39
+ }
40
+ .spo-updating-row .check-column input {
41
+ visibility: hidden;
42
+ }
third-party/simple-page-ordering/simple-page-ordering.js ADDED
@@ -0,0 +1 @@
 
1
+ function update_simple_ordering_callback(e){if("children"===e){window.location.reload();return}var t=jQuery.parseJSON(e);var n=t.new_pos;for(var r in n){if("next"===r)continue;var i=document.getElementById("inline_"+r);if(null!==i&&n.hasOwnProperty(r)){var s=i.querySelector(".menu_order");if(undefined!==n[r]["menu_order"]){if(null!==s)s.innerHTML=n[r]["menu_order"];var o=i.querySelector(".post_parent");if(null!==o)o.innerHTML=n[r]["post_parent"];var u=null;var a=i.querySelector(".post_title");if(null!==a)u=a.innerHTML;var f=0;while(f<n[r]["depth"]){u="— "+u;f++}var l=i.parentNode.querySelector(".row-title");if(null!==l&&null!==u)l.innerHTML=u}else if(null!==s){s.innerHTML=n[r]}}}if(t.next){jQuery.post(ajaxurl,{action:"simple_page_ordering",id:t.next["id"],previd:t.next["previd"],nextid:t.next["nextid"],start:t.next["start"],excluded:t.next["excluded"]},update_simple_ordering_callback)}else{jQuery(document.querySelector(".spo-updating-row")).removeClass("spo-updating-row");sortable_post_table.removeClass("spo-updating").sortable("enable")}}var sortable_post_table=jQuery(document.querySelector(".wp-list-table tbody"));sortable_post_table.sortable({items:"> tr",cursor:"move",axis:"y",containment:"table.widefat",scrollSensitivity:40,cancel:".inline-edit-row",distance:5,opacity:.85,forceHelperSize:true,update:function(e,t){sortable_post_table.sortable("disable").addClass("spo-updating");t.item.addClass("spo-updating-row");var n=t.item[0].id.substr(5);var r=false;var i=t.item.prev();if(i.length>0){r=i.attr("id").substr(5)}var s=false;var o=t.item.next();if(o.length>0){s=o.attr("id").substr(5)}jQuery.post(ajaxurl,{action:"simple_page_ordering",id:n,previd:r,nextid:s},update_simple_ordering_callback);var u=document.querySelectorAll("tr.iedit"),a=u.length;while(a--){if(a%2==0){jQuery(u[a]).addClass("alternate")}else{jQuery(u[a]).removeClass("alternate")}}}})