Changeset 915665
- Timestamp:
- 05/16/2014 03:30:45 PM (12 years ago)
- Location:
- weptile-image-slider-widget/trunk
- Files:
-
- 3 edited
-
js/weptile-image-slider-widget-admin.js (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
weptile-image-slider-widget.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
weptile-image-slider-widget/trunk/js/weptile-image-slider-widget-admin.js
r661771 r915665 42 42 }); 43 43 44 44 45 window.weptile_send_to_editor = function (html) { 45 46 var imgurl = jQuery('img', html).attr('src'); … … 63 64 parent_li.find('input').prop('disabled', false); 64 65 } 66 67 jQuery(this).parent().parent().parent().parent().find('input[name=savewidget]').click(); 65 68 }); 66 69 … … 125 128 126 129 }); 130 -
weptile-image-slider-widget/trunk/readme.txt
r663058 r915665 4 4 Tags: image, slider, widget, slideshow, nivo, sidebar, rotator, responsive 5 5 Requires at least: 3.3 6 Tested up to: 3. 5.17 Stable tag: 1. 0.56 Tested up to: 3.9.1 7 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Easily create responsive & lightweight image slider (rotator) widgets in your sidebars.11 Easily create responsive & lightweight image slider (rotator) widgets in any sidebar, post or page. 12 12 13 13 == Description == 14 14 15 Weptile Image Slider Widget is a responsive, easy, lightweight image slider widget plugin . Integrates nivo slider scriptwithout any conflicts.15 Weptile 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. 16 16 17 17 You can add images to rotate in any sidebar. Arrange image order with drag & drop. You can also add links to each image. … … 21 21 You can use multiple sliders on multiple sidebars on the same page. 22 22 23 You can use the shortcode support to add it to your posts or pages. 24 25 Example 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 28 Shortcode Variables: 29 imgs : images to rotate in slider. with comma (',') in between url's. 30 width : number pixel value, without px at the end 31 height : number pixel value, without px at the end 32 responsive : 0 or 1 (off / on) 33 theme : default,light,dark,bar 34 directional-nav : 0 or 1 (deafult: 0) 35 button-nav : 0 or 1 (deafult: 0) 36 pause-hover : 0 or 1 (deafult: 0) 37 start-random : 0 or 1 (deafult: 0) 38 slices : any integer value (default is 15) 39 box-columns : any integer value (default is 8) 40 box-rows (sayi degeri olacak, default:4) 41 prev-text : any text for the previous button (default:Previous) 42 next-text : any text for the next button (default:Next) 43 effect : (fade,fold,slideInLeft,slideInRight,random,sliceDown,sliceDownLeft,sliceUp,sliceUpLeft,sliceUpDown,sliceUpDownLeft,boxRandom,boxRain,boxRainReverse,boxRainGrow,boxRainGrowReverse) 44 23 45 == Installation == 24 46 … … 26 48 2. Activate the plugin through the 'Plugins' menu in WordPress 27 49 3. Add your "weptile image slider widget" to any sidebar from the 'Widgets' screen. 28 4. Setup the slider / rotator setting within the widget 50 4. Setup the slider / rotator setting within the widget or use the shortcode in the post/page editor. 29 51 5. Enjoy! 30 52 31 53 == Frequently asked questions == 54 55 = Can we use the slider in any sidebar?= 56 Yes. 57 58 = Can we use the slider in any page or post?= 59 Yes! (just added this in this update - more to follow) 32 60 33 61 = Can we add links to images? = -
weptile-image-slider-widget/trunk/weptile-image-slider-widget.php
r663058 r915665 4 4 Plugin URI: http://weptile.com 5 5 Description: 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.57 Author: Weptile ( Algün& Ufuk)6 Version: 1.1.0 7 Author: Weptile (Onur & Ufuk) 8 8 Author URI: http://weptile.com 9 9 License: GPL v3 … … 514 514 return $instance; 515 515 } 516 517 518 516 } 519 517 … … 558 556 */ 559 557 function weptile_image_slider_widget_admin_actions($hook) { 560 if ( 'widgets.php' != $hook) {558 if (('widgets.php' != $hook) && ('customize.php' != $hook)) { 561 559 return; 562 560 } … … 606 604 add_action('wp_enqueue_scripts', 'weptile_image_slider_widget_actions'); 607 605 add_action('widgets_init', create_function('', 'register_widget( "weptile_image_slider_Widget" );')); 606 607 function 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 } 729 add_shortcode( 'weptile-slider', 'weptile_image_slider_shortcode' );
Note: See TracChangeset
for help on using the changeset viewer.