Plugin Directory

Changeset 915665


Ignore:
Timestamp:
05/16/2014 03:30:45 PM (12 years ago)
Author:
weptile
Message:

update 1.1.0

Location:
weptile-image-slider-widget/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • weptile-image-slider-widget/trunk/js/weptile-image-slider-widget-admin.js

    r661771 r915665  
    4242    });
    4343
     44
    4445    window.weptile_send_to_editor = function (html) {
    4546        var imgurl = jQuery('img', html).attr('src');
     
    6364            parent_li.find('input').prop('disabled', false);
    6465        }
     66
     67        jQuery(this).parent().parent().parent().parent().find('input[name=savewidget]').click();
    6568    });
    6669
     
    125128
    126129});
     130
  • weptile-image-slider-widget/trunk/readme.txt

    r663058 r915665  
    44Tags: image, slider, widget, slideshow, nivo, sidebar, rotator, responsive
    55Requires at least: 3.3
    6 Tested up to: 3.5.1
    7 Stable tag: 1.0.5
     6Tested up to: 3.9.1
     7Stable tag: 1.1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Easily create responsive & lightweight image slider (rotator) widgets in your sidebars.
     11Easily create responsive & lightweight image slider (rotator) widgets in any sidebar, post or page.
    1212
    1313== Description ==
    1414
    15 Weptile Image Slider Widget is a responsive, easy, lightweight image slider widget plugin. Integrates nivo slider script without any conflicts.
     15Weptile Image Slider Widget is a responsive, easy, lightweight image slider widget plugin integrating nivo slider script to any sidebar, post or page without any conflicts.
    1616
    1717You can add images to rotate in any sidebar. Arrange image order with drag & drop. You can also add links to each image.
     
    2121You can use multiple sliders on multiple sidebars on the same page.
    2222
     23You can use the shortcode support to add it to your posts or pages.
     24
     25Example shortcode:
     26[weptile-slider imgs='http://url-to-image1.jpg,http://url-to-image2.jpg,http://url-to-image3.jpg' width=700 height=100 responsive=0 effect=boxRandom directionalnav=0 buttonnav=1 pausehover=1 startrandom=1 slices=30]
     27
     28Shortcode Variables:
     29imgs : images to rotate in slider. with comma (',') in between url's.
     30width : number pixel value, without px at the end
     31height : number pixel value, without px at the end
     32responsive : 0 or 1 (off / on)
     33theme : default,light,dark,bar
     34directional-nav : 0 or 1 (deafult: 0)
     35button-nav : 0 or 1 (deafult: 0)
     36pause-hover : 0 or 1 (deafult: 0)
     37start-random : 0 or 1 (deafult: 0)
     38slices : any integer value (default is 15)
     39box-columns : any integer value (default is 8)
     40box-rows (sayi degeri olacak, default:4)
     41prev-text : any text for the previous button (default:Previous)
     42next-text : any text for the next button (default:Next)
     43effect : (fade,fold,slideInLeft,slideInRight,random,sliceDown,sliceDownLeft,sliceUp,sliceUpLeft,sliceUpDown,sliceUpDownLeft,boxRandom,boxRain,boxRainReverse,boxRainGrow,boxRainGrowReverse)
     44
    2345== Installation ==
    2446
     
    26482. Activate the plugin through the 'Plugins' menu in WordPress
    27493. Add your "weptile image slider widget" to any sidebar from the 'Widgets' screen.
    28 4. Setup the slider / rotator setting within the widget
     504. Setup the slider / rotator setting within the widget or use the shortcode in the post/page editor.
    29515. Enjoy!
    3052
    3153== Frequently asked questions ==
     54
     55= Can we use the slider in any sidebar?=
     56Yes.
     57
     58= Can we use the slider in any page or post?=
     59Yes! (just added this in this update - more to follow)
    3260
    3361= Can we add links to images? =
  • weptile-image-slider-widget/trunk/weptile-image-slider-widget.php

    r663058 r915665  
    44Plugin URI: http://weptile.com
    55Description: Easy, lightweight, responsive sidebar image slider widget. Utilizes the Nivo slider script. Includes lots and lots of customization options and all done within the widget. Allows multiple widgets on one screen and can be used in any sidebar. (Please visit <a href="http://weptile.com" target="_blank" title="wordpress development">Weptile.com</a> for more. You can also <a href="http://weptile.com" target="_blank" title="wordpress development">HIRE WEPTILE</a> for all your Wordpress projects and/or for WP support.)
    6 Version: 1.0.5
    7 Author: Weptile (Algün & Ufuk)
     6Version: 1.1.0
     7Author: Weptile (Onur & Ufuk)
    88Author URI: http://weptile.com
    99License: GPL v3
     
    514514        return $instance;
    515515    }
    516 
    517 
    518516}
    519517
     
    558556 */
    559557function weptile_image_slider_widget_admin_actions($hook) {
    560     if ('widgets.php' != $hook) {
     558    if (('widgets.php' != $hook) && ('customize.php' != $hook)) {
    561559        return;
    562560    }
     
    606604add_action('wp_enqueue_scripts', 'weptile_image_slider_widget_actions');
    607605add_action('widgets_init', create_function('', 'register_widget( "weptile_image_slider_Widget" );'));
     606
     607function weptile_image_slider_shortcode( $atts, $content = null ) {
     608    extract( shortcode_atts( array(
     609        'imgs' => '',
     610        'width' => '0',
     611        'height' => '0',
     612        'theme' => 'default',
     613        'effect' => '',
     614        'speed' => '',
     615        'duration' => '',
     616        'slice' => '',
     617        'boxcolumns' => '',
     618        'boxrows' => '',
     619        'prevtext' => '',
     620        'nexttext' => '',
     621        'responsive' => '0',
     622        'directionalnav' => '',
     623        'buttonnav' => '',
     624        'pausehover' => '',
     625        'startrandom' => ''
     626
     627    ), $atts ) );
     628    $textdomain_shortcode = 'weptile_image_slider_textdomain';
     629    $default_themes = array('default','light','dark','bar');
     630    $shortcode_id = 'widget-weptile-image-slider-widget-shortcode-weptile-image-slider-widget-nivo-slider';
     631    $is_there_a_problem = false;
     632    $imgs = str_replace(' ', '', $imgs);
     633    $shortcode_images = explode(',',$imgs);
     634    if (count($shortcode_images) === 0) {
     635        $is_there_a_problem = true;
     636        $error_message = '<p>'. __('No image found for slider', $textdomain_shortcode) .'</p>';
     637    }
     638
     639    if ($width < 50 || $height < 50){
     640        $is_there_a_problem = true;
     641        $error_message = '<p>'. __('Slider height and/or width are not valid or smaller than 50px', $textdomain_shortcode) .'</p>';
     642    }
     643
     644
     645    if ($is_there_a_problem === false) {
     646        $slider_options = array(
     647            'width' => $width,
     648            'height' => $height,
     649            'theme' => $theme,
     650            'effect' => $effect,
     651            'speed' => $speed,
     652            'duration' => $duration,
     653            'directional-nav' => $directionalnav,
     654            'button-nav' => $buttonnav,
     655            'pause-hover' => $pausehover,
     656            'start-random' => $startrandom,
     657            'slices' => $slices,
     658            'box-columns' => $boxcolumns,
     659            'box-rows' => $boxrows,
     660            'prev-text' => $prevtext,
     661            'next-text' => $nexttext,
     662            'responsive' => $responsive
     663        );
     664
     665        if (empty($slider_options['theme'])) {
     666            $slider_options['theme'] = 'default';
     667        }
     668
     669        if (array_search($slider_options['theme'],$default_themes) === false){
     670            //if this is a custom theme
     671            //first check if the specified folder exists
     672            if (is_dir(WP_PLUGIN_DIR.'/'.$slider_options['theme']))
     673                wp_register_style('weptile-image-slider-widget-nivo-slider-theme-'.$slider_options['theme'], WP_PLUGIN_URL . '/'.$slider_options['theme'].'/'.$slider_options['theme'].'.css');
     674            else
     675                $slider_options['theme'] = 'default';
     676        }
     677
     678        wp_enqueue_style('weptile-image-slider-widget-nivo-slider-theme-' . $slider_options['theme']);
     679
     680        if ($slider_options['responsive'] != '1')
     681            echo '<style type="text/css" >.slider-wrapper.' . $shortcode_id . '{ width:' . $slider_options['width'] . 'px; /*height:' . $slider_options['height'] . 'px;*/ }</style>';
     682
     683        echo
     684            '<div class="slider-wrapper weptile-image-slider-widget-slider-wrapper theme-' . $slider_options['theme'] . ' ' . $shortcode_id . '">'.
     685            '<div class="nivoSliderWeptile" id="' . $shortcode_id . '">';
     686        foreach ($shortcode_images  as $shortcode_image) {
     687
     688            $image_path = str_ireplace(get_site_url(), '', $image);
     689            $image_path = weptile_get_wp_config_path() . $image_path;
     690
     691            $image_file_name = substr($image_path, strripos($image_path, '/') + 1);
     692            $suffix = 'resized-' . $slider_options['width'] . 'x' . $slider_options['height'];
     693
     694
     695            $image_url = $shortcode_image;
     696            echo ( !empty($instance['slider-image-links'][$i]) ? '<a href="'.$instance['slider-image-links'][$i].'" target="'.$instance['slider-image-link-targets'][$i].'" rel="'.$instance['slider-image-link-rels'][$i].'" >' : '' );
     697            echo '<img src="' . $image_url . '" alt="'. (!empty($instance['slider-image-alts'][$i]) ? $instance['slider-image-alts'][$i] : '') .'" title="'. ( !empty($instance['slider-image-captions'][$i]) ? $instance['slider-image-captions'][$i] : '' ) .'" />';
     698            echo ( !empty($instance['slider-image-links'][$i]) ? '</a>' : '' );
     699        }
     700        echo
     701            '</div>'.
     702            '</div>';
     703        echo '<script>
     704            jQuery(window).load(function() {
     705                jQuery("#' . $shortcode_id . '").nivoSliderWeptile({
     706                    animSpeed:' . (empty($slider_options['speed']) ? 650 : $slider_options['speed'] ) . ',
     707                    pauseTime:' . (empty($slider_options['duration']) ? 5000 : $slider_options['duration'] ) . ',
     708                    effect:"' . (empty($slider_options['effect']) ? 'fade' : $slider_options['effect'] ) . '",
     709                    prevText: "' . __('Previous', $textdomain_shortcode) . '",
     710                    nextText: "' . __('Next', $textdomain_shortcode) . '",
     711                    directionNav: ' . ($slider_options['directional-nav'] ? 'true' : 'false') . ',
     712                    controlNav: ' . ($slider_options['button-nav'] ? 'true' : 'false') . ',
     713                    pauseOnHover: ' . ($slider_options['pause-hover'] ? 'true' : 'false') . ',
     714                    randomStart: ' . ($slider_options['start-random'] ? 'true' : 'false') . ',
     715                    slices: ' . (empty($slider_options['slices']) ? '15' : $slider_options['slices']) . ',
     716                    boxCols:' . (empty($slider_options['box-columns']) ? '8' : $slider_options['box-columns']) . ',
     717                    boxRows:' . (empty($slider_options['box-rows']) ? '4' : $slider_options['box-rows']) . ',
     718                    prevText: "' . (empty($slider_options['prev-text']) ? 'Previous' : $slider_options['prev-text']) . '",
     719                    nextText: "' . (empty($slider_options['next-text']) ? 'Next' : $slider_options['next-text']) . '"
     720                });
     721            });
     722            </script>';
     723
     724        // Else
     725    } else {
     726        echo $error_message;
     727    }
     728}
     729add_shortcode( 'weptile-slider', 'weptile_image_slider_shortcode' );
Note: See TracChangeset for help on using the changeset viewer.