diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/css/slides.css b/css/slides.css old mode 100644 new mode 100755 index 664fa49..1690935 --- a/css/slides.css +++ b/css/slides.css @@ -15,6 +15,10 @@ outline: none; } +.navis-slideshow .pagination li { + list-style-type:none !important; +} + /* Set the width of your slides container */ .slides_container { width: 100%; @@ -79,7 +83,7 @@ div.slides_control { width: 100% !important; } -.navis-slideshow .pagination { +.navis-slideshow .pagination { margin: 0 !important; width: 95%; padding: 0; diff --git a/img/pagination.png b/img/pagination.png old mode 100644 new mode 100755 diff --git a/img/slide-nav.png b/img/slide-nav.png old mode 100644 new mode 100755 diff --git a/img/slide-permalink.png b/img/slide-permalink.png old mode 100644 new mode 100755 diff --git a/img/slideshow-icon.png b/img/slideshow-icon.png old mode 100644 new mode 100755 diff --git a/img/slideshow-keyboard.png b/img/slideshow-keyboard.png old mode 100644 new mode 100755 diff --git a/js/navis-slideshows.js b/js/navis-slideshows.js old mode 100644 new mode 100755 index b0d9ce1..336c44e --- a/js/navis-slideshows.js +++ b/js/navis-slideshows.js @@ -16,11 +16,11 @@ function loadSlideshow( postID, permalink, totalSlides ) { startSlide = slideNum; ensureImageIsLoaded( postID, slideNum ); - ensureImageIsLoaded( postID, - getNextSlideNum( slideNum, totalSlides ) + ensureImageIsLoaded( postID, + getNextSlideNum( slideNum, totalSlides ) ); - ensureImageIsLoaded( postID, - getPrevSlideNum( slideNum, totalSlides ) + ensureImageIsLoaded( postID, + getPrevSlideNum( slideNum, totalSlides ) ); jQuery( slidePermalinkElement ).attr( "href", permalink + "#" + startSlide ); @@ -40,8 +40,8 @@ function loadSlideshow( postID, permalink, totalSlides ) { var curSlide = "#" + current; ensureImageIsLoaded( postID, current ); - ensureImageIsLoaded( - postID, getNextSlideNum( current, totalSlides ) + ensureImageIsLoaded( + postID, getNextSlideNum( current, totalSlides ) ); jQuery( slidePermalinkElement ).attr( "href", permalink + curSlide @@ -60,15 +60,15 @@ function loadSlideshow( postID, permalink, totalSlides ) { // Ensure the previous image is loaded when the user goes back jQuery( ".navis-slideshow .slide-nav .prev" ).click( function( evt ) { - ensureImageIsLoaded( - postID, getPrevSlideNum( currentSlide, totalSlides ) + ensureImageIsLoaded( + postID, getPrevSlideNum( currentSlide, totalSlides ) ); }); // Ensure the previous image is loaded when the user goes back jQuery( ".navis-slideshow .slide-nav .next" ).click( function( evt ) { - ensureImageIsLoaded( - postID, getNextSlideNum( currentSlide, totalSlides ) + ensureImageIsLoaded( + postID, getNextSlideNum( currentSlide, totalSlides ) ); }); } @@ -93,14 +93,15 @@ function ensureImageIsLoaded( postID, slideNum ) { var slideDiv = jQuery( "#" + getSlideElement( postID, slideNum ) ); // Do nothing if the slide image already exists - if ( slideDiv.has( "img" ).length ) - return; + if ( slideDiv.has( "img" ).length ) return; - var imgData = slideDiv.attr( "data-src" ); + var imgData = slideDiv.attr( "data-src" ), + urlData = slideDiv.attr( "data-href" ); if ( imgData ) { var parts = imgData.split( "*" ); var img = jQuery( "" ) - .attr( "src", parts[0] ) + .attr( "src", parts[0] ); + if ( urlData ) img = img.wrap("").parent(); slideDiv.prepend( img ); } } @@ -110,4 +111,4 @@ function ensureAllImagesAreLoaded( postID, count ) { for ( i = 1; i <= count; i++ ) { ensureImageIsLoaded( getSlideElement( postID, i ) ); } -} +} \ No newline at end of file diff --git a/js/slides.jquery.js b/js/slides.jquery.js old mode 100644 new mode 100755 diff --git a/js/slides.min.jquery.js b/js/slides.min.jquery.js old mode 100644 new mode 100755 diff --git a/navis-slideshows.php b/navis-slideshows.php old mode 100644 new mode 100755 index 10d0ef7..884cca1 --- a/navis-slideshows.php +++ b/navis-slideshows.php @@ -2,252 +2,299 @@ /** * Plugin Name: Navis Slideshows * Description: Slideshows that take advantage of the Slides jQuery plugin. - * Version: 0.1 - * Author: Project Argo + * Version: 0.3 + * Author: Project Argo, Crowd Favorite, Cornershop Creative * License: GPLv2 */ /* - Copyright 2011 National Public Radio, Inc. + Copyright 2011 National Public Radio, Inc. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Navis_Slideshows { - static $include_slideshow_deps; - - function __construct() { - add_action( 'init', array( &$this, 'add_slideshow_header' ) ); - add_action('wp_head', array( &$this, 'argo_slideshow_css' ) ); - - add_filter( - 'wp_footer', array( &$this, 'conditionally_add_slideshow_deps' ) - ); - - add_filter( - 'post_gallery', array( &$this, 'handle_slideshow' ), 10, 2 - ); - - if ( ! is_admin() ) - return; - - add_action( - 'save_post', array( &$this, 'tag_post_as_slideshow' ), 10, 2 - ); - - } - - - function add_slideshow_header() { - // slides-specific CSS - $slides_css = plugins_url( 'css/slides.css', __FILE__ ); - wp_enqueue_style( - 'navis-slides', $slides_css, array(), '1.0' - ); - } - - //add slideshow width to header - function argo_slideshow_css() { - ?> - - 'ASC', - 'orderby' => 'menu_order ID', - 'id' => $post->ID, - 'itemtag' => 'dl', - 'icontag' => 'dt', - 'captiontag' => 'dd', - 'columns' => 3, - 'size' => 'thumbnail', - ), $attr ) ); - - $id = intval( $id ); - // XXX: this could be factored out to a common function for getting - // a post's images - $attachments = get_children( array( - 'post_parent' => $id, - 'post_status' => 'inherit', - 'post_type' => 'attachment', - 'post_mime_type' => 'image', - 'order' => $order, - 'orderby' => $orderby - ) ); - - if ( empty( $attachments ) ) - return ''; - - if ( is_feed() ) { - $output = "\n"; - foreach ( $attachments as $id => $attachment ) - $output .= wp_get_attachment_link( $id, $size, true ) . "\n"; - return $output; - } - - $postid = $post->ID; - $plink = get_permalink(); - - $output .= ' -