WordPress.org

Plugin Directory

Changeset 388744


Ignore:
Timestamp:
05/25/11 01:19:54 (3 years ago)
Author:
c3mdigital
Message:

Upgrading to 0.2.4

Location:
wp-coda-slider/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-coda-slider/trunk/js/coda.slider.js

    r300402 r388744  
    66 * 
    77 * TERMS OF USE - jQuery Easing 
    8  *  
    9  * Open source under the BSD License.  
    10  *  
     8 * 
     9 * Open source under the BSD License. 
     10 * 
    1111 * Copyright © 2008 George McGinley Smith 
    1212 * All rights reserved. 
    13  *  
    14  * Redistribution and use in source and binary forms, with or without modification,  
     13 * 
     14 * Redistribution and use in source and binary forms, with or without modification, 
    1515 * are permitted provided that the following conditions are met: 
    16  *  
    17  * Redistributions of source code must retain the above copyright notice, this list of  
     16 * 
     17 * Redistributions of source code must retain the above copyright notice, this list of 
    1818 * 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  
     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 
    2121 * provided with the distribution. 
    22  *  
    23  * Neither the name of the author nor the names of contributors may be used to endorse  
     22 * 
     23 * Neither the name of the author nor the names of contributors may be used to endorse 
    2424 * 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  
     25 * 
     26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
    2727 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
    2828 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
    2929 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
    3030 *  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  
     31 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
    3232 * 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.  
     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. 
    3535 * 
    3636*/ 
     
    148148    }, 
    149149    easeInOutBack: function (x, t, b, c, d, s) { 
    150         if (s == undefined) s = 1.70158;  
     150        if (s == undefined) s = 1.70158; 
    151151        if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
    152152        return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
     
    179179 
    180180jQuery(document).ready(function($){ 
    181        // your $ based code here will work fine  
     181 
    182182$(function(){ 
    183     // Remove the coda-slider-no-js class from the body 
     183 
     184    var plugin_path = Plugin_Url.plugin_url; 
    184185    $("body").removeClass("coda-slider-no-js"); 
    185186    // Preloader 
    186     $(".coda-slider").children('.panel').hide().end().prepend('<p class="loading">Loading...<br /><img src="ajax-loader.gif" alt="loading..." /></p>'); 
     187    $(".coda-slider").children('.panel').hide().end().prepend('<p class="loading">Loading...<br /><img src="'+ plugin_path +'/ajax-loader.gif" alt="loading..." /></p>'); 
    187188}); 
    188189}); 
    189190var sliderCount = 1; 
    190191jQuery(document).ready(function($){ 
    191        // your $ based code here will work fine  
     192       // your $ based code here will work fine 
    192193$.fn.codaSlider = function(settings) { 
    193194 
     
    212213        slideEaseFunction: "easeInOutExpo" 
    213214    }, settings); 
    214      
     215 
    215216    return this.each(function(){ 
    216          
     217 
    217218        // Uncomment the line below to test your preloader 
    218219        // alert("Testing preloader"); 
    219          
     220 
    220221        var slider = $(this); 
    221          
     222 
    222223        // If we need arrows 
    223224        if (settings.dynamicArrows) { 
     
    226227            slider.after('<div class="coda-nav-right" id="coda-nav-right-' + sliderCount + '"><a href="#">' + settings.dynamicArrowRightText + '</a></div>'); 
    227228        }; 
    228          
     229 
    229230        var panelWidth = slider.find(".panel").width(); 
    230231        var panelCount = slider.find(".panel").size(); 
    231232        var panelContainerWidth = panelWidth*panelCount; 
    232233        var navClicks = 0; // Used if autoSlideStopWhenClicked = true 
    233          
     234 
    234235        // Surround the collection of panel divs with a container div (wide enough for all panels to be lined up end-to-end) 
    235236        $('.panel', slider).wrapAll('<div class="panel-container"></div>'); 
    236237        // Specify the width of the container div (wide enough for all panels to be lined up end-to-end) 
    237238        $(".panel-container", slider).css({ width: panelContainerWidth }); 
    238          
     239 
    239240        // Specify the current panel. 
    240241        // If the loaded URL has a hash (cross-linking), we're going to use that hash to give the slider a specific starting position... 
     
    244245            $('.panel-container', slider).css({ marginLeft: offset }); 
    245246        // If that's not the case, check to see if we're supposed to load a panel other than Panel 1 initially... 
    246         } else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) {  
     247        } else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) { 
    247248            var currentPanel = settings.firstPanelToLoad; 
    248249            var offset = - (panelWidth*(currentPanel - 1)); 
    249250            $('.panel-container', slider).css({ marginLeft: offset }); 
    250251        // Otherwise, we'll just set the current panel to 1... 
    251         } else {  
     252        } else { 
    252253            var currentPanel = 1; 
    253254        }; 
    254              
     255 
    255256        // Left arrow click 
    256257        $("#coda-nav-left-" + sliderCount + " a").click(function(){ 
     
    271272            return false; 
    272273        }); 
    273              
     274 
    274275        // Right arrow click 
    275276        $('#coda-nav-right-' + sliderCount + ' a').click(function(){ 
     
    290291            return false; 
    291292        }); 
    292          
     293 
    293294        // If we need a dynamic menu 
    294295        if (settings.dynamicTabs) { 
     
    305306            // Create the nav items 
    306307            $('.panel', slider).each(function(n) { 
    307                 ul.append('<li class="tab' + (n+1) + '"><a href="#' + (n+1) + '">' + $(this).find(settings.panelTitleSelector).text() + '</a></li>');                                                
     308                ul.append('<li class="tab' + (n+1) + '"><a href="#' + (n+1) + '">' + $(this).find(settings.panelTitleSelector).text() + '</a></li>'); 
    308309            }); 
    309310            navContainerWidth = slider.width() + slider.siblings('.coda-nav-left').width() + slider.siblings('.coda-nav-right').width(); 
     
    318319            }; 
    319320        }; 
    320              
     321 
    321322        // If we need a tabbed nav 
    322323        $('#coda-nav-' + sliderCount + ' a').each(function(z) { 
     
    332333            }); 
    333334        }); 
    334          
     335 
    335336        // External triggers (anywhere on the page) 
    336337        $(settings.externalTriggerSelector).each(function() { 
     
    351352            }; 
    352353        }); 
    353              
     354 
    354355        // Specify which tab is initially set to "current". Depends on if the loaded URL had a hash or not (cross-linking). 
    355356        if (settings.crossLinking && location.hash && parseInt(location.hash.slice(1)) <= panelCount) { 
     
    362363            $("#coda-nav-" + sliderCount + " a:eq(0)").addClass("current"); 
    363364        }; 
    364          
     365 
    365366        // Set the height of the first panel 
    366367        if (settings.autoHeight) { 
     
    368369            slider.css({ height: panelHeight }); 
    369370        }; 
    370          
     371 
    371372        // Trigger autoSlide 
    372373        if (settings.autoSlide) { 
     
    375376            }); 
    376377        }; 
    377          
     378 
    378379        function alterPanelHeight(x) { 
    379380            if (settings.autoHeight) { 
     
    382383            }; 
    383384        }; 
    384          
     385 
    385386        function autoSlide() { 
    386387            if (navClicks == 0 || !settings.autoSlideStopWhenClicked) { 
     
    400401            }; 
    401402        }; 
    402          
     403 
    403404        // Kill the preloader 
    404405        $('.panel', slider).show().end().find("p.loading").remove(); 
    405406        slider.removeClass("preload"); 
    406          
     407 
    407408        sliderCount++; 
    408          
     409 
    409410    }); }; 
    410411}); 
  • wp-coda-slider/trunk/readme.txt

    r386484 r388744  
    6262Here is a full listing of settings you can add to args= 
    6363 
    64 * autoHeight 
     64*autoHeight* 
    6565Values: true, false, 1, 0 
    6666Default: true 
     
    6868Notes: If set to false or 0, the height of the slider will be set to the height of the tallest panel. 
    6969 
    70 * autoHeightEaseDuration 
     70* autoHeightEaseDuration * 
    7171Values: Any amount of milliseconds. 
    7272Default: 1000 
     
    7474Notes: Ideally, this should use the same value as slideEaseDuration (see below). Depends on autoHeight being set to true or 1. 
    7575 
    76 * autoHeightEaseFunction 
     76* autoHeightEaseFunction * 
    7777Values: See Robert Penner's Equations Visualizer for the full list. 
    7878Default: "easeInOutExpo" 
     
    8080Notes: Value must be enclosed in quotes. Depends on autoHeight being set to true or 1. 
    8181 
    82 * autoSlide 
     82* autoSlide * 
    8383Values: true, false, 1, 0 
    8484Default: false 
    8585Description: Specifies whether slider should move between panels automatically. 
    8686 
    87 * autoSlideInterval 
     87* autoSlideInterval * 
    8888Values: Any amount of milliseconds. 
    8989Default: 7000 
     
    9191Notes: Depends on autoSlide being set to true or 1. 
    9292 
    93 * autoSlideStopWhenClicked 
     93* autoSlideStopWhenClicked * 
    9494Values: true, false, 1, 0 
    9595Default: true 
     
    9797Notes: Depends on autoSlide being set to true or 1. 
    9898 
    99 * crossLinking 
     99* crossLinking * 
    100100Values: true, false, 1, 0 
    101101Default: true 
     
    103103Notes: Works best if autoSlide (see above) is disabled. Only numbers can be used for the hash values; they are automatically generated by the script. If this cross-linking is enabled and a valid URL hash is presnt, and setting specified for firstPanelToLoad (see below) will be overruled. 
    104104 
    105 * dynamicArrows 
     105* dynamicArrows * 
    106106Values: true, false, 1, 0 
    107107Default: true 
     
    109109Notes: Set this to false or 0 and you can still hardcode the left and eight buttons in the HTML, giving you more flexibility with positioning. See Example 4 in the demos. 
    110110 
    111 * dynamicArrowLeftText 
     111* dynamicArrowLeftText * 
    112112Values: Anything you want. 
    113113Default: "&#171; left" 
     
    115115Notes: Depends on dynamicArrows being set to true or 1. 
    116116 
    117 * dynamicArrowRightText 
     117* dynamicArrowRightText * 
    118118Values: Anything you want. 
    119119Default: "right &#187;" 
     
    121121Notes: Depends on dynamicArrows being set to true or 1. 
    122122 
    123 * dynamicTabs 
     123* dynamicTabs * 
    124124Values: true, false, 1, 0 
    125125Default: true 
     
    127127Notes: panelTitleSelector (see below) lets you specify what anchor text is used in each tab. 
    128128 
    129 * dynamicTabsAlign 
     129* dynamicTabsAlign * 
    130130Values: "center", "left", "right" 
    131131Default: "center" 
     
    133133Notes: Depends on dynamicTabs being set to true or 1. Value must be enclosed in quotes. 
    134134 
    135 * dynamicTabsPosition 
     135* dynamicTabsPosition * 
    136136Values: "bottom", "top" 
    137137Default: "top" 
     
    139139Notes: Depends on dynamicTabs being set to true or 1. Value must be enclosed in quotes. 
    140140 
    141 * externalTriggerSelector 
     141* externalTriggerSelector * 
    142142Values: Pretty much any jQuery selector, but best to reference an anchor. 
    143143Default: "a.xtrig" 
     
    145145Notes: Value must be enclosed in quotes. The external trigger must have a rel attribute to specify the id of the slider which it should affect. If cross linking is required, also be sure to include a href attribute, specifying the appropriate URL hash. See Example 3 in the demos. 
    146146 
    147 * firstPanelToLoad 
     147* firstPanelToLoad * 
    148148Values: Any integer corresponding to a panel (e.g. use 2 if you want the second panel to load first). 
    149149Default: 1 
     
    151151Notes: See Example 5 in the demos. 
    152152 
    153 * panelTitleSelector 
     153* panelTitleSelector * 
    154154Values: Pretty much any jQuery selector. 
    155155Default: "h2.title" 
     
    157157Notes: Depends on dynamicTabs being set to true or 1. Value must be enclosed in quotes. 
    158158 
    159 * slideEaseDuration 
     159* slideEaseDuration * 
    160160Values: Any amount of milliseconds. 
    161161Default: 1000 
     
    163163Notes: Ideally, this should use the same value as autoHeightEaseDuration (see above). Depends on autoHeight being set to true or 1. 
    164164 
    165 * slideEaseFunction 
     165* slideEaseFunction * 
    166166Values: See Robert Penner's Equations Visualizer for the full list. 
    167167Default: "easeInOutExpo" 
     
    171171== Frequently Asked Questions == 
    172172 
    173 = What does the id argument do? = 
     173=  What does the id argument do? = 
    174174 
    175175The id argument is the div id that will be assigned to the slider.  Make sure each slider has a unique id. 
     
    191191 
    192192== Screenshots == 
     193 
    193194See demo at:   http://wp-performance.com/wp-coda-slider/ 
    194195 
    195196== Changelog == 
    196197 
     198= 0.2.4 = 
     199 
     200Updated query strings to arrays.  This won't change anything for most users. 
     201 
     202**Please Note:** The next version will see a complete code rerwite.  If you rely on this plugin please plan accordingly.  Current short tags will continue to work in the next version but template tags will be deprecated with a new options API to replace 
    197203= 0.2.3 = 
     204 
    198205Bug fixes: 
    199206Fixed documentation error for template tag function call Props:Bira 
     
    202209 
    203210= 0.2.2.1 = 
     211 
    204212Add a template tag method to call the slider to use when calling posts that contain other shortcodes.   
    205213 
    206214= 0.2.1 = 
     215 
    207216Added the description for the arguments in the shortcode 
    208217 
    209218= 0.2 = 
     219 
    210220Fixed the readme file to display full description 
    211221 
     
    218228 
    219229= 0.2.1 = 
     230 
    220231Please upgrade and check the readme.txt file for a full description on using the plugin shortcode arguments 
    221232 
    222233= 0.1 = 
     234 
    223235Hey this is the first version.  No need to upgrade until a new version comes out 
  • wp-coda-slider/trunk/wpcodaslider.php

    r300406 r388744  
    66Author: c3mdigital 
    77Author URI: http://c3mdigital.com/ 
    8 Version: 0.2.3.1 
     8Version: 0.2.4 
    99License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1010*/ 
     
    2020//Template tag function 
    2121 
    22     function c3m_wpcodaslider($id, $cat, $show, $args) {    
     22function c3m_wpcodaslider($id, $cat, $show, $args) { 
    2323 
     24    $template_tag_args = array( 
     25    'post_type' => 'post', 
     26    'cat'       => $cat, 
     27    'posts_per_page' => $show 
     28    ); 
    2429 
    25         query_posts('post_type=post&order=desc&cat=' . $cat . '&posts_per_page= ' . $show . ''); 
     30        query_posts( $template_tag_args ); 
    2631 
    2732            echo  '<div class="coda-slider-wrapper"> <!-- yes --> 
     
    4247                        </div> <!-- .panel --> 
    4348 
    44              <?php endwhile; else:  
    45                    endif;  
     49             <?php endwhile; else: 
     50                   endif; 
    4651         wp_reset_query(); ?> 
    4752 
     
    6974 
    7075        function c3m_coda_scripts() { 
    71                  wp_enqueue_script('coda_slider', WP_PLUGIN_URL . '/wp-coda-slider/js/coda.slider.js', array('jquery')); 
    72 //enqueue style sheet 
    73                 wp_enqueue_style('coda_slider', WP_PLUGIN_URL . '/wp-coda-slider/css/coda-slider-2.0.1.css'); 
     76                 wp_enqueue_script('coda_slider', WP_PLUGIN_URL . '/wp-coda-slider/js/coda.slider.js', array( 'jquery' )); 
     77                wp_enqueue_style('coda_slider_css', WP_PLUGIN_URL . '/wp-coda-slider/css/coda-slider-2.0.1.css'); 
     78                wp_localize_script( 'coda_slider', 'Plugin_Url', array( 'plugin_url' => WP_PLUGIN_URL ) ); 
    7479    } 
    7580 
     
    104109                        <div class="coda-slider preload" id="'. $id .'">'; 
    105110 
    106                 $posts = get_posts('post_type=post&order=desc&cat= '. $cat . '&posts_per_page= ' . $show . ''); 
     111                $shortcode_args = array( 
     112                    'post_type' => 'post', 
     113                    'cat'       => $cat, 
     114                    'posts_per_page' => $show 
     115    ); 
     116 
     117                $posts = get_posts( $shortcode_args ); 
     118 
    107119                foreach($posts as $post){ 
    108120 
    109                         $o.= 
     121                    $o.= 
    110122                        '<div class="panel" id="post-' . $post->ID . '"> 
    111123                                <div class="panel-wrapper"> 
Note: See TracChangeset for help on using the changeset viewer.